You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/python/multiple-axes.md
+103-2
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ jupyter:
8
8
format_version: '1.3'
9
9
jupytext_version: 1.14.1
10
10
kernelspec:
11
-
display_name: Python 3
11
+
display_name: Python 3 (ipykernel)
12
12
language: python
13
13
name: python3
14
14
language_info:
@@ -20,7 +20,7 @@ jupyter:
20
20
name: python
21
21
nbconvert_exporter: python
22
22
pygments_lexer: ipython3
23
-
version: 3.8.8
23
+
version: 3.8.0
24
24
plotly:
25
25
description: How to make a graph with multiple axes (dual y-axis plots, plots
26
26
with secondary axes) in python.
@@ -249,5 +249,106 @@ fig.update_layout(
249
249
fig.show()
250
250
```
251
251
252
+
#### Automatically Shifting Axes
253
+
254
+
To automatically reposition axes to avoid overlap with other axes with the same `overlaying` value, set `autoshift=True`. For `autoshift` to work on an axis, you'll also need to set `anchor="free"` on that axis.
Set a `shift` value on an axis to shift an axis by that number of pixels. A positive value shifts an axis to the right. A negative value shifts it to the left. Here, we shift `yaxis4` 100 pixels further to the left.
title_text="Shifting y-axes by a specific number of pixels",
347
+
)
348
+
349
+
fig.show()
350
+
351
+
```
352
+
252
353
#### Reference
253
354
All of the y-axis properties are found here: https://plotly.com/python/reference/YAxis/. For more information on creating subplots see the [Subplots in Python](/python/subplots/) section.
0 commit comments