Skip to content

Commit 162dab5

Browse files
committed
Update axes.md
1 parent 4b53922 commit 162dab5

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

Diff for: doc/python/axes.md

+18-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.2'
9-
jupytext_version: 1.4.2
8+
format_version: '1.3'
9+
jupytext_version: 1.13.7
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.7
23+
version: 3.9.0
2424
plotly:
2525
description: How to adjust axes properties in Python - axes titles, styling and
2626
coloring axes and grid lines, ticks, tick labels and more.
@@ -291,6 +291,20 @@ fig.update_yaxes(ticks="outside", tickwidth=2, tickcolor='crimson', ticklen=10,
291291
fig.show()
292292
```
293293

294+
##### Step for tick labels
295+
296+
You can set a step for tick labels with `ticklabelstep`. In this example, we hide labels between every `2` ticks on the y axes. Similarly, this can be used with `fig.update_xaxes` for x axes: `fig.update_xaxes(ticklabelstep=2)`.
297+
298+
```python
299+
import plotly.express as px
300+
df = px.data.iris()
301+
302+
fig = px.scatter(df, x="sepal_width", y="sepal_length", facet_col="species")
303+
fig.update_yaxes(ticklabelstep=2)
304+
305+
fig.show()
306+
```
307+
294308
##### Toggling axis labels
295309

296310
The axis tick mark labels can be disabled by setting the `showticklabels` axis property to `False`.

0 commit comments

Comments
 (0)