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
{{ message }}
Repository navigation
ticklabels on log axes sometimes adds overwritten labels on top of existing ones #8622
For log axes setting the tick labels sometimes just adds new labels on top of the existing ones.
Code for reproduction
# Paste your code here#Demonstration using the Agg backend, but this also happened for me with others.importmatplotlibmatplotlib.use('agg')
frommatplotlibimportpyplotasplt# Some data I found that triggered this bugx= [100,200,300,400,500,600,700,800,900,1000]
y= [ 1.7, 1.2, 0.98, 0.87, 0.76, 0.69, 0.62, 0.59, 0.56, 0.51]
#Only seems to happen for a log axis. Same error if you do semilogyplt.loglog(x, y)
#This does not seem to replace the old tick labels, just add new onesplt.yticks([0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 2.0], ["0.5", "0.6", "0.7", "0.8", "0.9", "1.0", "2.0"])
plt.savefig("test.png")
Actual outcome
Expected outcome
Removal of the old tick labels as well as adding the new ones.
Matplotlib version
Operating System: MacOS Sierra 10.12.4
Matplotlib Version: 2.0.2
Python Version: 2.7.13
Jupyter Version (if applicable): N/A
Other Libraries: N/a
I used pip to install matplotlib and it downloaded matplotlib-2.0.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
The coupling and special casing required to disable the minor ticks when the major ticks are non-default is a bit worrying (I do not see a clean way to do it), but am open to a PR to see what it would look like.
Activity
joezuntz commentedon May 15, 2017
It looks like this can be solved by minorticks_off(), but I still think this should be considered a bug.
tacaswell commentedon May 15, 2017
This change is documented at http://matplotlib.org/users/dflt_style_changes.html#tick-label-formatting .
The coupling and special casing required to disable the minor ticks when the major ticks are non-default is a bit worrying (I do not see a clean way to do it), but am open to a PR to see what it would look like.
timhoffm commentedon Jul 14, 2020
Does not happen anymore as of master. Possibly closed by #13126.