You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Present in 1.5.1 and on 2.0.0b3, as well as master I think.
Enabling minor ticks via minorticks_on and having scale set to symlog raises an exception. In minorticks_on, the input passed to SymmetricalLogLocator is base and subs, but SymmetricalLogLocator is expecting transform and subs. Calling self._transform.base, when self._transform is a base (a float) causes exception,
...
File "C:\Python27_numpy\lib\site-packages\matplotlib\axis.py", line 900, in iter_ticks
minorLocs = self.minor.locator()
File "C:\Python27_numpy\lib\site-packages\matplotlib\ticker.py", line 1662, in call
return self.tick_values(vmin, vmax)
File "C:\Python27_numpy\lib\site-packages\matplotlib\ticker.py", line 1665, in tick_values
b = self._transform.base
AttributeError: 'float' object has no attribute 'base'
It seems like the issue has something to do with the way the SymmetricalLogLocator was implemented in the first place. The current implementation seems to explicitly exclude all ticks within the linear regime.
A custom solution described here seems to mostly solve the issue, which could be absorbed into the repository.
I've encountered this bug with 1.5.1 today, it's good to know the issue has been fixed in the newer release. While here is the trick to work around with version 1.5.1:
frommatplotlib.tickerimportAutoMinorLocatorfrommatplotlib.tickerimportNullLocator# turn minor ticks onself.axes.xaxis.set_minor_locator(AutoMinorLocator())
self.axes.yaxis.set_minor_locator(AutoMinorLocator())
# turn minor ticks offself.axes.xaxis.set_minor_locator(NullLocator())
self.axes.yaxis.set_minor_locator(NullLocator())
Activity
tacaswell commentedon Aug 24, 2016
This went in via a6716df from @Tillsten (but without a test). I am not sure this has ever actually worked.
dncnwtts commentedon Sep 23, 2016
It seems like the issue has something to do with the way the
SymmetricalLogLocatorwas implemented in the first place. The current implementation seems to explicitly exclude all ticks within the linear regime.A custom solution described here seems to mostly solve the issue, which could be absorbed into the repository.
tacaswell commentedon May 15, 2017
closed by #8367
zhangt58 commentedon Oct 25, 2018
I've encountered this bug with 1.5.1 today, it's good to know the issue has been fixed in the newer release. While here is the trick to work around with version 1.5.1:
ENH: Update method to toggle minor ticks, symlog + mtick may crash.
guido-granda commentedon Mar 8, 2021
Hi,
I'm using matplotlib 3.3.4 and it looks like this usse is not fixed.