Skip to content

Commit 581b753

Browse files
committed
add example with "max reversed"
1 parent 22681bc commit 581b753

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/python/axes.md

+15
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,21 @@ fig.update_yaxes(range=[9, None], autorange="min reversed")
743743
fig.show()
744744
```
745745

746+
*New in 5.17*
747+
748+
To use a reversed axis while specifying only an upper bound for the range, set `autorange="max reversed"`:
749+
750+
```python
751+
import plotly.express as px
752+
753+
df = px.data.iris()
754+
755+
fig = px.scatter(df, x="sepal_width", y="sepal_length", facet_col="species")
756+
fig.update_yaxes(range=[None, 3], autorange="max reversed")
757+
758+
fig.show()
759+
```
760+
746761
### Axis range for log axis type
747762

748763
If you are using a `log` type of axis and you want to set the range of the axis, you have to give the `log10` value of the bounds when using `fig.update_xaxes` or `fig.update_layout`. However, with `plotly.express` functions you pass directly the values of the range bounds (`plotly.express` then computes the appropriate values to pass to the figure layout).

0 commit comments

Comments
 (0)