@@ -1273,8 +1273,12 @@ def set_ticks_position(self, position):
1273
1273
assert position in ('top' , 'bottom' , 'both' , 'default' , 'none' )
1274
1274
1275
1275
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 )
1278
1282
1279
1283
if position == 'top' :
1280
1284
for t in ticks :
@@ -1514,8 +1518,12 @@ def set_ticks_position(self, position):
1514
1518
"""
1515
1519
assert position in ('left' , 'right' , 'both' , 'default' , 'none' )
1516
1520
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 )
1519
1527
1520
1528
if position == 'right' :
1521
1529
self .set_offset_position ('right' )
0 commit comments