Plot command

Hi all, I am a new user of this library and scipy but I

    > see something strange when I run the following script:

This looks like a bug in the AutoLocator, possibly in resulting from
the new MaxNLocator introduced recently. Thanks for the report.

Eric: below is a script which exposes the bug more clearly (with gplt
commented out -- I don't have it on my system). If you uncomment the
ylim command, you will see the correct plot. It looks like the auto
locator is choosing a ylim range that does not encompass the data. If
I had to guess, this bug is caused by floating point approximation
error -- all the ydata in this example are very close to 1.0 and the
recent MaxNLocator changes made some changes to how we handled
floating point approximations.

Charlie: let's hold on 0.87.2 until we get this sorted out.

JDH

from scipy import *
import pylab

b = [0.0,1.0,0.0]
a = 1
w,h = signal.freqz(b,a)
Magnitude = []
phase = []
for i in h:
     magnitude.append(sqrt(i.real**2. +i.imag**2.))
     phase.append(arctan(i.imag/i.real))

print len(w)
print len(h)
print len(magnitude)
print len(phase)

i = range(len(magnitude))
#gplt.plot(i,magnitude)
print magnitude
pylab.plot(i,magnitude, 'o')
#pylab.ylim(0,2) # uncomment this to see correct plot
pylab.show()

John,

John Hunter wrote:

"Daigos" == <daigos@...1043...> writes:

    > Hi all, I am a new user of this library and scipy but I
    > see something strange when I run the following script:

This looks like a bug in the AutoLocator, possibly in resulting from
the new MaxNLocator introduced recently. Thanks for the report.

Eric: below is a script which exposes the bug more clearly (with gplt
commented out -- I don't have it on my system). If you uncomment the
ylim command, you will see the correct plot. It looks like the auto
locator is choosing a ylim range that does not encompass the data. If
I had to guess, this bug is caused by floating point approximation
error -- all the ydata in this example are very close to 1.0 and the
recent MaxNLocator changes made some changes to how we handled
floating point approximations.

OK, I will look into it. I agree with your guess.

Eric

John,

I think this one is fixed now in SVN. Additional torture testing is welcome.

Eric

John Hunter wrote:

···

"Daigos" == <daigos@...1043...> writes:

    > Hi all, I am a new user of this library and scipy but I
    > see something strange when I run the following script:

This looks like a bug in the AutoLocator, possibly in resulting from
the new MaxNLocator introduced recently. Thanks for the report.

Eric: below is a script which exposes the bug more clearly (with gplt
commented out -- I don't have it on my system). If you uncomment the
ylim command, you will see the correct plot. It looks like the auto
locator is choosing a ylim range that does not encompass the data. If
I had to guess, this bug is caused by floating point approximation
error -- all the ydata in this example are very close to 1.0 and the
recent MaxNLocator changes made some changes to how we handled
floating point approximations.

Charlie: let's hold on 0.87.2 until we get this sorted out.

JDH

from scipy import *
import pylab

b = [0.0,1.0,0.0]
a = 1
w,h = signal.freqz(b,a)
Magnitude = []
phase = []
for i in h:
     magnitude.append(sqrt(i.real**2. +i.imag**2.))
     phase.append(arctan(i.imag/i.real))

print len(w)
print len(h)
print len(magnitude)
print len(phase)

i = range(len(magnitude))
#gplt.plot(i,magnitude)
print magnitude
pylab.plot(i,magnitude, 'o')
#pylab.ylim(0,2) # uncomment this to see correct plot
pylab.show()