Skip to content

Commit e9b45bd

Browse files
Update facet-plots.md
Update 'Synchronizing axes in subplots with matches' title; mention pan in this section.
1 parent 0d4fcc6 commit e9b45bd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: doc/python/facet-plots.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,20 @@ fig.show()
119119

120120
```
121121

122-
### Zooming subplots to the same range
122+
### Synchronizing axes in subplots with `matches`
123123

124-
Using `facet_col` from `plotly.express` let zoom each facet to the same range implicitly. However, if the subplots are created with `make_subplots`, the axis needs to be updated with `matches` parameter to zoom all the subplots accordingly. Zoom in one trace below, to see the other subplots zoomed to the same x-axis range:
124+
Using `facet_col` from `plotly.express` let [zoom](https://help.plot.ly/zoom-pan-hover-controls/#step-3-zoom-in-and-zoom-out-autoscale-the-plot) and [pan](https://help.plot.ly/zoom-pan-hover-controls/#step-6-pan-along-axes) each facet to the same range implicitly. However, if the subplots are created with `make_subplots`, the axis needs to be updated with `matches` parameter to update all the subplots accordingly.
125+
126+
Zoom in one trace below, to see the other subplots zoomed to the same x-axis range. To pan all the subplots, click and drag from the center of x-axis to the side:
125127

126128
```python
127129
import plotly.graph_objects as go
128130
from plotly.subplots import make_subplots
129131
import numpy as np
132+
130133
N = 20
131134
x = np.linspace(0, 1, N)
135+
132136
fig = make_subplots(1, 3)
133137
for i in range(1, 4):
134138
fig.add_trace(go.Scatter(x=x, y=np.random.random(N)), 1, i)

0 commit comments

Comments
 (0)