Skip to content

Commit 4ec6ad1

Browse files
SylwiaOliwia2nicolaskruchten
authored andcommitted
Update subplots.md
added shared_yaxes=True and some spacing for better readability in the section 'Subplots with Shared Colorscale'
1 parent 8626e20 commit 4ec6ad1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Diff for: doc/python/subplots.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,17 @@ To share colorscale information in multiple subplots, you can use [coloraxis](ht
303303
```python
304304
from plotly.subplots import make_subplots
305305
import plotly.graph_objects as go
306-
fig = make_subplots(1, 2)
306+
307+
fig = make_subplots(rows=1, cols=2, shared_yaxes=True)
308+
307309
fig.add_trace(go.Bar(x=[1, 2, 3], y=[4, 5, 6],
308-
marker=dict(color=[4, 5, 6], coloraxis="coloraxis1")),
310+
marker=dict(color=[4, 5, 6], coloraxis="coloraxis")),
309311
1, 1)
312+
310313
fig.add_trace(go.Bar(x=[1, 2, 3], y=[2, 3, 5],
311-
marker=dict(color=[2, 3, 5], coloraxis="coloraxis1")),
314+
marker=dict(color=[2, 3, 5], coloraxis="coloraxis")),
312315
1, 2)
316+
313317
fig.update_layout(coloraxis=dict(colorscale='Bluered_r'), showlegend=False)
314318
fig.show()
315319
```

0 commit comments

Comments
 (0)