I have some code that worked very well a year or so ago using pyplot; I made a plot using plt.plot(x,y)
using a logarithmic y-axis and replaced the y-axis ticks and tick labels with a custom set as follows:
# set the axis limits
Tmin = -100 # min temperature to plot
Tmax = 40 # max temperature
Pmin = 100 # min pressure
Pmax = 1000 # max pressure
plt.axis([Tmin, Tmax, Pmax, Pmin])
# make the vertical axis a log-axis
plt.semilogy()
# make a custom list of tick values and labels
plist = range(Pmin,Pmax,100)
plabels = []
for p in plist:
plabels.append(str(p))
plt.yticks(plist,plabels)
After recently updating my python installation to the current version of miniconda, I now find that while the new labels still appear, they are partly overwritten by matplotlib's default labels in scientific notation. So it appears that whereas the above code used to replace the default ticks and labels, it now merely adds to them.
What do I have to do regain the desired behavior? And why did it change in the first place?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…