Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Bug report
Warning thrown:
"
...\anaconda3\lib\site-packages\ipykernel_launcher.py:157: UserWarning: AutoMinorLocator does not work with logarithmic scale
...\anaconda3\lib\site-packages\IPython\core\pylabtools.py:128: UserWarning: AutoMinorLocator does not work with logarithmic scale
fig.canvas.print_figure(bytes_io, **kw)
"
Bug summary
This warning is thrown on an old(6months) python code transferred to a new computer. Warning was not present in old setup (unfortunately machine is no longer accessible for comparison of settings and environment.)
Code for reproduction
importmatplotlibasmpl,matplotlib.pyplotaspltfrommatplotlib.tickerimportMultipleLocator,LogLocator,NullLocator,AutoMinorLocator,NullFormatterimportnumpyasnpdefPlotHyperTune2(X,Y,histogram):plt.style.use('./GraphStyle.mplstyle')fig=plt.figure(figsize= (12,8))ax=fig.add_subplot()locminX=LogLocator(base=10.0,subs=np.arange(2,10)*.1,numticks=100)plt.xscale("log")ax.xaxis.set_minor_locator(locminX)axH=ax.twinx()# Histogram uses the same x-axisplt.show()x2=np.arange(100)x2=x2+2y2=np.zeros(400).reshape((4,100))y2[0]=x2hist2=np.sin(x2*0.02)PlotHyperTune2(x2,y2,hist2)
Actual outcome
warning message at the top & no log-sub-ticks on the x-axis
Expected outcome
No warnings. and log-sub-ticks on the x-axis
Matplotlib version
- Operating system: Windows 10
- Matplotlib version (
import matplotlib; print(matplotlib.__version__)
): 3.1.0 (also version 3.3.4) - Matplotlib backend (
print(matplotlib.get_backend())
): module://ipykernel.pylab.backend_inline - Python version: 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
- Jupyter version (if applicable): 6.0.0 (notebook) 4.5.0 (core)