Plotting line with sharp peaks

stefan <warmbau@...273...> writes:

I want to plot a line with very sharp features and many data points.
[...] Is the '-' style doing some averaging before plotting or is it a
rendering problem?

What version of matplotlib do you have? There have been some path
simplification bugs fixed recently. Try setting path.simplify to False
in the matplotlibrc file.

···

--
Jouni K. Seppänen
http://www.iki.fi/jks

Thank you.

O.k. a little bit more:
I just installed 0.99.1.1.

Without path.simplify to False the problem is still there. So the "bug" might
be still there.

Thanks a lot again.

Stefan

P.S.: just in case someone wants to confirm an example:

from scipy.special import sph_jn,sph_yn
import numpy as np
import pylab as py
a_s = 2.5e-6
nsph = 1.59
mrel = 1.59
l = 30.0
m = 30.0

k=l
jnx= lambda t: (sph_jn(k,t)[0][-1])
xjnx= lambda t: (t*sph_jn(k,t)[1][-1]+sph_jn(k,t)[0][-1])
hnx= lambda t: (sph_jn(k,t)[0][-1]+1j*sph_yn(k,t)[0][-1])
xhnx= lambda t: (t*sph_jn(k,t)[1][-1]+sph_jn(k,t)[0][-1]+1j*(t*sph_yn(k,t)[1]
[-1]+sph_yn(k,t)[0][-1]))

F= lambda rho:
(((1*mrel**2*jnx(mrel*rho)*xjnx(rho)-1*jnx(rho)*xjnx(mrel*rho))/(1*mrel**2*jnx(mrel*rho)*xhnx(rho)-
1*hnx(rho)*xjnx(mrel*rho))))
datax=[(x0)for x0 in np.arange(22,22.8,.0001)]
datay=[(F(x0))for x0 in datax]
py.figure()
py.plot(datax,datay,'-',lw=1)
py.show()

···

On Tuesday 15 December 2009 04:43:03 pm Jouni K. Seppänen wrote:

stefan <warmbau@...273...> writes:
> I want to plot a line with very sharp features and many data points.
> [...] Is the '-' style doing some averaging before plotting or is it a
> rendering problem?

What version of matplotlib do you have? There have been some path
simplification bugs fixed recently. Try setting path.simplify to False
in the matplotlibrc file.