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

Skip to content

Commit 19981c5

Browse files
committed
Merged revisions 7115 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint ........ r7115 | leejjoon | 2009-05-17 18:04:38 -0400 (Sun, 17 May 2009) | 2 lines Fix bug(#2749174) that some properties of minor ticks are not conserved. ........ svn path=/trunk/matplotlib/; revision=7116
1 parent e2e2347 commit 19981c5

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2009-05-17 Fix bug(#2749174) that some properties of minor ticks are
2+
not conserved -JJL
3+
14
2009-05-17 applied Michiel's sf patch 2790638 to turn off gtk event
25
loop in setupext for pygtk>=2.15.10 - JDH
36

lib/matplotlib/axis.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,8 +1325,12 @@ def set_ticks_position(self, position):
13251325
assert position in ('top', 'bottom', 'both', 'default', 'none')
13261326

13271327

1328-
ticks = list( self.get_major_ticks() ) # a copy
1329-
ticks.extend( self.get_minor_ticks() )
1328+
# The first ticks of major & minor ticks should always be
1329+
# included, otherwise, the information can be lost. Thus, use
1330+
# majorTicks instead of get_major_ticks() which may return
1331+
# empty list.
1332+
ticks = list( self.majorTicks ) # a copy
1333+
ticks.extend( self.minorTicks )
13301334

13311335
if position == 'top':
13321336
for t in ticks:
@@ -1566,8 +1570,12 @@ def set_ticks_position(self, position):
15661570
"""
15671571
assert position in ('left', 'right', 'both', 'default', 'none')
15681572

1569-
ticks = list( self.get_major_ticks() ) # a copy
1570-
ticks.extend( self.get_minor_ticks() )
1573+
# The first ticks of major & minor ticks should always be
1574+
# included, otherwise, the information can be lost. Thus, use
1575+
# majorTicks instead of get_major_ticks() which may return
1576+
# empty list.
1577+
ticks = list( self.majorTicks ) # a copy
1578+
ticks.extend( self.minorTicks )
15711579

15721580
if position == 'right':
15731581
self.set_offset_position('right')

0 commit comments

Comments
 (0)