Skip to content

Commit dde093e

Browse files
adamgreenhally-p
authored and
y-p
committed
ylabels for secondary_y axis
modified Selective Plotting on Secondary Y-axis example to show how to set ylabels for both left and right y axis
1 parent 828f9f9 commit dde093e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

doc/source/visualization.rst

+6-3
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,12 @@ keyword:
129129
.. ipython:: python
130130
131131
plt.figure()
132+
ax = df.plot(secondary_y=['A', 'B'])
133+
ax.set_ylabel('CD scale')
134+
@savefig frame_plot_secondary_y.png width=4.5in
135+
ax.right_ax.set_ylabel('AB scale')
136+
132137
133-
@savefig frame_plot_secondary_y.png width=4.5in
134-
df.plot(secondary_y=['A', 'B'])
135138
136139
Note that the columns plotted on the secondary y-axis is automatically marked
137140
with "(right)" in the legend. To turn off the automatic marking, use the
@@ -141,7 +144,7 @@ with "(right)" in the legend. To turn off the automatic marking, use the
141144
142145
plt.figure()
143146
144-
@savefig frame_plot_secondary_y.png width=4.5in
147+
@savefig frame_plot_secondary_y_no_right.png width=4.5in
145148
df.plot(secondary_y=['A', 'B'], mark_right=False)
146149
147150

0 commit comments

Comments
 (0)