@@ -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