File tree Expand file tree Collapse file tree 1 file changed +11
-18
lines changed Expand file tree Collapse file tree 1 file changed Original file line number Diff line number Diff line change @@ -2524,18 +2524,14 @@ def __call__(self):
2524
2524
# TODO: Figure out a way to still be able to display minor
2525
2525
# ticks without two major ticks visible. For now, just display
2526
2526
# no ticks at all.
2527
- majorstep = 0
2527
+ return []
2528
2528
2529
2529
if self .ndivs is None :
2530
- if majorstep == 0 :
2531
- # TODO: Need a better way to figure out ndivs
2532
- ndivs = 1
2530
+ x = int ( np . round ( 10 ** ( np . log10 ( majorstep ) % 1 )))
2531
+ if x in [ 1 , 5 , 10 ]:
2532
+ ndivs = 5
2533
2533
else :
2534
- x = int (np .round (10 ** (np .log10 (majorstep ) % 1 )))
2535
- if x in [1 , 5 , 10 ]:
2536
- ndivs = 5
2537
- else :
2538
- ndivs = 4
2534
+ ndivs = 4
2539
2535
else :
2540
2536
ndivs = self .ndivs
2541
2537
@@ -2545,15 +2541,12 @@ def __call__(self):
2545
2541
if vmin > vmax :
2546
2542
vmin , vmax = vmax , vmin
2547
2543
2548
- if len (majorlocs ) > 0 :
2549
- t0 = majorlocs [0 ]
2550
- tmin = ((vmin - t0 ) // minorstep + 1 ) * minorstep
2551
- tmax = ((vmax - t0 ) // minorstep + 1 ) * minorstep
2552
- locs = np .arange (tmin , tmax , minorstep ) + t0
2553
- cond = np .abs ((locs - t0 ) % majorstep ) > minorstep / 10.0
2554
- locs = locs .compress (cond )
2555
- else :
2556
- locs = []
2544
+ t0 = majorlocs [0 ]
2545
+ tmin = ((vmin - t0 ) // minorstep + 1 ) * minorstep
2546
+ tmax = ((vmax - t0 ) // minorstep + 1 ) * minorstep
2547
+ locs = np .arange (tmin , tmax , minorstep ) + t0
2548
+ cond = np .abs ((locs - t0 ) % majorstep ) > minorstep / 10.0
2549
+ locs = locs .compress (cond )
2557
2550
2558
2551
return self .raise_if_exceeds (np .array (locs ))
2559
2552
You can’t perform that action at this time.
0 commit comments