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

Skip to content

Commit 5312266

Browse files
committed
twiny to pylab
svn path=/trunk/matplotlib/; revision=3015
1 parent 5d00b17 commit 5312266

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

CHANGELOG

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
2006-02-13 Added twiny to pylab - JDH
2+
13
2006-02-12 Moved data files into lib/matplotlib so that setuptools'
24
develop mode works. Re-organized the mpl-data layout so
35
that this source structure is maintained in the
46
installation. (I.e. the 'fonts' and 'images'
57
sub-directories are maintained in site-packages.) Suggest
68
removing site-packages/matplotlib/mpl-data and
7-
~/.matplotlib/ttffont.cache before installing
8-
9-
- ADS
9+
~/.matplotlib/ttffont.cache before installing - ADS
1010

1111
2006-02-07 Committed Rob Hetland's patch for qt4: remove
1212
references to text()/latin1(), plus some improvements

lib/matplotlib/pylab.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,23 @@ def twinx(ax=None):
10291029
return ax2
10301030

10311031

1032+
def twiny(ax=None):
1033+
"""
1034+
Make a second axes overlay ax (or the current axes if ax is None)
1035+
sharing the yaxis. The ticks for ax2 will be placed on the top,
1036+
and the ax2 instance is returned.
1037+
"""
1038+
if ax is None:
1039+
ax=gca()
1040+
1041+
1042+
ax2 = gcf().add_axes(ax.get_position(), sharey=ax, frameon=False)
1043+
ax2.xaxis.tick_top()
1044+
ax2.xaxis.set_label_position('top')
1045+
ax.xaxis.tick_bottom()
1046+
draw_if_interactive()
1047+
return ax2
1048+
10321049
def title(s, *args, **kwargs):
10331050
"""
10341051
Set the title of the current axis to s

0 commit comments

Comments
 (0)