Skip to content

Commit

Permalink
add insiderange example
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamConnors committed Oct 20, 2023
1 parent 44c5857 commit 53e28f5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions doc/python/axes.md
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,23 @@ fig.update_yaxes(range=[3, 9])
fig.show()
```

#### Exclude Inside Tick Labels from Range

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.

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.

```python
import plotly.express as px
df = px.data.stocks(indexed=True)

fig = px.line(df, df.index, y="GOOG")
fig.update_yaxes(ticklabelposition="inside", title="Price")
fig.update_xaxes(insiderange=['2018-10-01', '2019-01-01'], title="Date")

fig.show()
```

#### Setting only a Lower or Upper Bound for Range

*New in 5.17*
Expand Down

0 comments on commit 53e28f5

Please sign in to comment.