@@ -387,6 +387,7 @@ def __init__(self, ax, cmap=None,
387
387
self .outline = None
388
388
self .patch = None
389
389
self .dividers = None
390
+ self ._manual_tick_data_values = None
390
391
391
392
if ticklocation == 'auto' :
392
393
ticklocation = 'bottom' if orientation == 'horizontal' else 'right'
@@ -574,7 +575,17 @@ def set_ticks(self, ticks, update_ticks=True):
574
575
575
576
def get_ticks (self , minor = False ):
576
577
"""Return the x ticks as a list of locations"""
577
- return self ._tick_data_values
578
+ if self ._manual_tick_data_values is None :
579
+ ax = self .ax
580
+ if self .orientation == 'vertical' :
581
+ long_axis , short_axis = ax .yaxis , ax .xaxis
582
+ else :
583
+ long_axis , short_axis = ax .xaxis , ax .yaxis
584
+ return long_axis .get_majorticklocs ()
585
+ else :
586
+ # We made the axes manually, the old way, and the ylim is 0-1,
587
+ # so the majorticklocs are in those units, not data units.
588
+ return self ._manual_tick_data_values
578
589
579
590
def set_ticklabels (self , ticklabels , update_ticks = True ):
580
591
"""
@@ -756,7 +767,7 @@ def _ticker(self, locator, formatter):
756
767
else :
757
768
eps = (intv [1 ] - intv [0 ]) * 1e-10
758
769
b = b [(b <= intv [1 ] + eps ) & (b >= intv [0 ] - eps )]
759
- self ._tick_data_values = b
770
+ self ._manual_tick_data_values = b
760
771
ticks = self ._locate (b )
761
772
formatter .set_locs (b )
762
773
ticklabels = [formatter (t , i ) for i , t in enumerate (b )]
0 commit comments