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