On Tue, Aug 31, 2010 at 6:08 AM, Jens Nie <j...@roseninspection.net> wrote:

>  Hi everyone.
>
> I face a problem here, which I can’t seem to handle by myself, so any help
> is really appreciated.
>
> I would like to do  a simple line plot of a huge dataset as an overview to
> quickly compare success of different measurement scenarios, and it seems
> that not every datapoint is displayed. I played a little with the lod
> parameter, both for the creation of the axis and the plot command. However
> timing the plot command and the display itself do not show differences. Here
> are a few lines of code that help to reproduce the problem.
>
> import time
>
> import matplotlib
> matplotlib.use("Qt4Agg")
> import matplotlib.pyplot as plt
>
> import numpy as np
>
> xData=np.linspace(0, 10.0, 1e6)
> yData=np.zeros(xData.shape)
>
> xDataDetail=np.linspace(0.0, 2*np.pi, 1000)
> yDataDetail=np.exp(-xDataDetail)*np.sin(10.0*xDataDetail)
>
> yData[100000:100000+len(yDataDetail)]=yDataDetail
>
> fig=plt.figure()
> axes=fig.add_subplot(111)
> tic=time.time()
> axes.plot(xData, yData, "b-")
> toc=time.time()
> axes.grid(True)
> print "Plotting took %g s." % (toc-tic)
> plt.show()
>
> The code shows how I usually use the matplotlib environment and creates a
> simple dataset of 1 million zeros with a short non trivial peak within, that
> is to be plotted as a blue solid line.
>
> You can see what happens, when you vary the width of the displaying window.
> On my system usually the minimum amplitude varies when resizing the window.
>
> Is there any way to enforce plotting each and every point?
>
> I use matplotlib version 1.0.0 on a 32 Bit windows XP system installed via
> the windows installer from sf.
> A quick check on a opensuse 11.3 linux box showed the same issue. Using the
> “standard” TK backend instead of Qt4Agg behaves just the same.
>
> Jens
>
>

Jens,

Which version of matplotlib are you using?  I wonder if this is the
path.simplify bug that was fixed for 1.0.

Essentially, there was a bug in some code that caused some points to be
skipped in the process of displaying images that had datapoints that were
closer together than could be resolved.  I suspect this is what is happening
here, because everything looks fine on my latest build.

Ben Root
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to