Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2c3c907

Browse files
committed
Make pyplot.twinx() and twiny() draw after creating the axes
svn path=/trunk/matplotlib/; revision=6300
1 parent 3b09ede commit 2c3c907

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lib/matplotlib/pyplot.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,12 +631,13 @@ def twinx(ax=None):
631631
the right, and the *ax2* instance is returned.
632632
633633
.. seealso::
634-
:file:`examples/pylab_examples/two_scales.py`
634+
:file:`examples/api_examples/two_scales.py`
635635
"""
636636
if ax is None:
637637
ax=gca()
638+
ax1 = ax.twinx()
638639
draw_if_interactive()
639-
return ax.twinx()
640+
return ax1
640641

641642

642643
def twiny(ax=None):
@@ -647,8 +648,9 @@ def twiny(ax=None):
647648
"""
648649
if ax is None:
649650
ax=gca()
651+
ax1 = ax.twiny()
650652
draw_if_interactive()
651-
return ax.twiny()
653+
return ax1
652654

653655

654656

0 commit comments

Comments
 (0)