File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
Original file line number Diff line number Diff line change @@ -1629,22 +1629,18 @@ def show_tick_label(self, ticklocs):
1629
1629
numdec = abs (vmax - vmin )
1630
1630
1631
1631
if numdec > 3 :
1632
+ # Label only bases
1632
1633
sublabel = set ((1 ,))
1633
- elif numdec > 2 :
1634
- sublabel = set ((1 , 3 ))
1635
- elif numdec > 1 :
1636
- sublabel = set ((1 , 2 , 5 ))
1637
1634
else :
1638
- sublabel = set ((1 , 2 , 4 , 7 ))
1635
+ # Add labels between bases at log-spaced coefficients
1636
+ c = np .logspace (0 , 1 , (4 - int (numdec )) + 1 , base = b )
1637
+ sublabel = set (np .round (c ))
1639
1638
1640
- label = np .ones (ticklocs .size , dtype = np .bool )
1641
- for i , loc in enumerate (ticklocs ):
1642
- exponent = math .floor (math .log (abs (loc )) / math .log (b ))
1643
- coeff = loc / b ** nearest_long (exponent )
1644
- if nearest_long (coeff ) not in sublabel :
1645
- label [i ] = False
1639
+ show_label = np .ones (ticklocs .size , dtype = np .bool )
1640
+ exponents = np .floor (np .log (abs (ticklocs )) / np .log (b ))
1641
+ coeffs = np .round (ticklocs / b ** exponents )
1646
1642
1647
- return label
1643
+ return [ c in sublabel for c in coeffs ]
1648
1644
1649
1645
def view_limits (self , vmin , vmax ):
1650
1646
'Try to choose the view limits intelligently'
You can’t perform that action at this time.
0 commit comments