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

Skip to content

Commit 6546a60

Browse files
committed
Fix bug(#2749174) that some properties of minor ticks are not conserved.
svn path=/branches/v0_98_5_maint/; revision=7115
1 parent 2a51f4a commit 6546a60

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

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
======================================================================
25
2008-05-17 Release 0.98.5.3 at r7107
36

lib/matplotlib/axis.py

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

12751275

1276-
ticks = list( self.get_major_ticks() ) # a copy
1277-
ticks.extend( self.get_minor_ticks() )
1276+
# The first ticks of major & minor ticks should always be
1277+
# included, otherwise, the information can be lost. Thus, use
1278+
# majorTicks instead of get_major_ticks() which may return
1279+
# empty list.
1280+
ticks = list( self.majorTicks ) # a copy
1281+
ticks.extend( self.minorTicks )
12781282

12791283
if position == 'top':
12801284
for t in ticks:
@@ -1514,8 +1518,12 @@ def set_ticks_position(self, position):
15141518
"""
15151519
assert position in ('left', 'right', 'both', 'default', 'none')
15161520

1517-
ticks = list( self.get_major_ticks() ) # a copy
1518-
ticks.extend( self.get_minor_ticks() )
1521+
# The first ticks of major & minor ticks should always be
1522+
# included, otherwise, the information can be lost. Thus, use
1523+
# majorTicks instead of get_major_ticks() which may return
1524+
# empty list.
1525+
ticks = list( self.majorTicks ) # a copy
1526+
ticks.extend( self.minorTicks )
15191527

15201528
if position == 'right':
15211529
self.set_offset_position('right')

0 commit comments

Comments
 (0)