Hi
I’m trying to use the linthershy option for symlog in matplotlib.axes.Axes.set_yscale()
``for values smaller than 1, but the plot then shows large values (vertical lines) for the points which should have been in the linear range. My code is:
import matplotlib.pyplot as plt
import numpy as np
f1 = np.loadtxt(‘someDataFile.txt’) # file has all y values smaller than 1
fig1 = plt.figure(1)
ax1 = fig1.add_subplot(111)
ax1.plot(f1[:, 0], f1[:, 1])
ax1.set_yscale(‘symlog’, linthreshy = 1e-3)
ax1.set_ylim(1e-4, 1)
ax1.autoscale(enable = True, axis = ‘x’, tight = True)
plt.draw()
plt.show()
···
Another and testable code is
import matplotlib
matplotlib.use(‘Qt4Agg’)
import matplotlib.pyplot as plt
import numpy as np
fig1 = plt.figure(1)
A = 10 + 9.999999999 * np.sin(2 * np.pi * np.arange(0.01, 1, 0.01))
ax1 = fig1.add_subplot(111)
ax1.plot(A)
ax1.set_yscale(‘symlog’, linthreshy = 1e-6)
ax1.set_ylim(0, 20) # change this to ax1.set_ylim(0, 0.7) for strange lines
fig2 = plt.figure(2)
ax2 = fig2.add_subplot(111)
ax2.plot(A)
ax2.set_yscale(‘log’)
ax2.set_ylim(0, 20)
ax2.autoscale(enable = True, axis = ‘both’, tight = True)
plt.draw()
plt.show()
Which does not show correct labels and the linear part is gone (only a straight line).
Does anyone have a solution for these problems?
Regards
Pål