File tree 1 file changed +10
-6
lines changed 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -2634,18 +2634,22 @@ def __init__(self, n=None):
2634
2634
2635
2635
If *n* is omitted or None, it will be set to 5 or 4.
2636
2636
"""
2637
+ #print(self.ndivs)
2637
2638
if n == None :
2638
- if Locator .axis .__name__ == 'xaxis' :
2639
- self .ndivs = rcParams ['xtick.minor.ndivs' ]
2640
- elif Locator .axis .__name__ == 'yaxis' :
2641
- self .ndivs = rcParams ['ytick.minor.ndivs' ]
2642
- elif n == 'auto' :
2643
2639
self .ndivs = None
2640
+ elif n == 'auto' :
2641
+ self .ndivs = 'auto'
2644
2642
else :
2645
2643
self .ndivs = n
2646
2644
2647
2645
def __call__ (self ):
2648
2646
'Return the locations of the ticks'
2647
+ if self .ndivs is None :
2648
+ if self .axis .__name__ == 'xaxis' :
2649
+ self .ndivs = rcParams ['xtick.minor.ndivs' ]
2650
+ elif self .axis .__name__ == 'yaxis' :
2651
+ self .ndivs = rcParams ['ytick.minor.ndivs' ]
2652
+
2649
2653
if self .axis .get_scale () == 'log' :
2650
2654
cbook ._warn_external ('AutoMinorLocator does not work with '
2651
2655
'logarithmic scale' )
@@ -2661,7 +2665,7 @@ def __call__(self):
2661
2665
# no ticks at all.
2662
2666
return []
2663
2667
2664
- if self .ndivs is None :
2668
+ if self .ndivs == 'auto' :
2665
2669
2666
2670
majorstep_no_exponent = 10 ** (np .log10 (majorstep ) % 1 )
2667
2671
You can’t perform that action at this time.
0 commit comments