@@ -387,6 +387,7 @@ def __init__(self, ax, cmap=None,
387387 self .outline = None
388388 self .patch = None
389389 self .dividers = None
390+ self ._manual_tick_data_values = None
390391
391392 if ticklocation == 'auto' :
392393 ticklocation = 'bottom' if orientation == 'horizontal' else 'right'
@@ -574,7 +575,17 @@ def set_ticks(self, ticks, update_ticks=True):
574575
575576 def get_ticks (self , minor = False ):
576577 """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
578589
579590 def set_ticklabels (self , ticklabels , update_ticks = True ):
580591 """
@@ -756,7 +767,7 @@ def _ticker(self, locator, formatter):
756767 else :
757768 eps = (intv [1 ] - intv [0 ]) * 1e-10
758769 b = b [(b <= intv [1 ] + eps ) & (b >= intv [0 ] - eps )]
759- self ._tick_data_values = b
770+ self ._manual_tick_data_values = b
760771 ticks = self ._locate (b )
761772 formatter .set_locs (b )
762773 ticklabels = [formatter (t , i ) for i , t in enumerate (b )]
0 commit comments