Skip to content

Commit 53e28f5

Browse files
committed
add insiderange example
1 parent 44c5857 commit 53e28f5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

doc/python/axes.md

+17
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,23 @@ fig.update_yaxes(range=[3, 9])
559559
fig.show()
560560
```
561561

562+
#### Exclude Inside Tick Labels from Range
563+
564+
You can use `insiderange` instead of `range` on an axis if you have tick labels positioned on the inside of another axis (`ticklabelposition="inside"`) and you don't want the range to overlap with those labels.
565+
566+
In this example, we have a y axis with `ticklabelposition="inside"` and by setting `insiderange=['2018-10-01', '2019-01-01']` on the x axis, the data point of `2018-10-01` is displayed after the y axis labels.
567+
568+
```python
569+
import plotly.express as px
570+
df = px.data.stocks(indexed=True)
571+
572+
fig = px.line(df, df.index, y="GOOG")
573+
fig.update_yaxes(ticklabelposition="inside", title="Price")
574+
fig.update_xaxes(insiderange=['2018-10-01', '2019-01-01'], title="Date")
575+
576+
fig.show()
577+
```
578+
562579
#### Setting only a Lower or Upper Bound for Range
563580

564581
*New in 5.17*

0 commit comments

Comments
 (0)