On Tue, Nov 2, 2010 at 8:20 AM, Pål Gunnar Ellingsen <paa...@gmail.com>wrote:

> Hi
>
> I'm trying to use the linthershy option for symlog  in
> matplotlib.axes.Axes.set_yscale() 
> <http://matplotlib.sourceforge.net/api/axes_api.html#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
>
>
This was a bug found fairly recently.  In the case where the linthresh was
less than 1.0:

http://sourceforge.net/tracker/index.php?func=detail&aid=3081451&group_id=80706&atid=560720

I don't know if the patch was backported to the maintenance branch, but I am
fairly sure it would have been.

I hope this was helpful,
Ben Root
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to