Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## matplotlib-users

 [Matplotlib-users] How to get all data points plotted/displayed in a line plot From: Jens Nie - 2010-08-31 11:29:13 Attachments: Message as HTML ```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 ```
 Re: [Matplotlib-users] How to get all data points plotted/displayed in a line plot From: Benjamin Root - 2010-09-01 02:43:48 Attachments: Message as HTML ```On Tue, Aug 31, 2010 at 6:08 AM, Jens Nie 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 ```
 Re: [Matplotlib-users] How to get all data points plotted/displayed in a line plot From: Jens Nie - 2010-09-01 08:03:45 Attachments: Message as HTML ```Hi Ben. It is the version 1.0.0 that i am using, both on Linux and windows. Is there any newer (development) version that I should try? Jens [...] 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 ```
 Re: [Matplotlib-users] How to get all data points plotted/displayed in a line plot From: Jens Nie - 2010-09-02 07:22:01 Attachments: Message as HTML ```Hi. I tested the svn snapshot from yesterday to see if the problem is there for me in the most recent version. I had to do the check on a linux box, as that one is the only one I am able to compile on. The svn version states itself as 1.0.0 also in matplotlib.__version__ which I hope is ok. The "strange" behavior is still there. Besides: Where would the correct place be to switch the level of detail parameter. Once for the axes in add_subplot or for every plot command, or both? Jens From: Jens Nie [mailto:JNie@...] Sent: Wednesday, September 01, 2010 10:03 AM To: matplotlib-users@... Subject: Re: [Matplotlib-users] How to get all data points plotted/displayed in a line plot Hi Ben. It is the version 1.0.0 that i am using, both on Linux and windows. Is there any newer (development) version that I should try? Jens [...] 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 ```
 Re: [Matplotlib-users] How to get all data points plotted/displayed in a line plot From: Eric Firing - 2010-09-02 08:04:02 ```Mike, Using svn trunk, I see exactly the problem Jens is talking about. Maybe there is still a bug in the path simplification? If I try to plot after turning simplification off, I don't get any image at all, so I can't immediately say whether the problem is in the simplification. To reproduce the bug, run the example Jens supplied, and try changing the window width a few times. Eric On 08/31/2010 01:08 AM, Jens Nie 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 > > > > ------------------------------------------------------------------------------ > 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@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ```
 Re: [Matplotlib-users] How to get all data points plotted/displayed in a line plot From: Hans Aschauer - 2010-09-02 09:30:25 ```Benjamin Root writes: > > 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 Hello Ben, I have the same problem here (mpl on windows, with the tk-agg backend). After reading your comment above, I upgraded to 1.0.0, which improved the situation: In Jens' example code, the old version (I think it was 0.99.1?) had problems with both the high and the low peak (which could be seen when horizontally resizing the window); in version 1.0 the high peak is shown correctly (y=0.86), while the low peak shows "random" values instead of the real minimum (y=-0.63). In my environment, path.simplify is True. When I set it to False, the problem disappears, however plotting gets (too) slow for my large data sets. And it should work correctly with path.simplify, right? Thanks in advance for your assistance, Hans ```
 Re: [Matplotlib-users] How to get all data points plotted/displayed in a line plot From: Eric Firing - 2010-09-03 18:52:06 ```On 08/31/2010 01:08 AM, Jens Nie 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. Jens, I'm confident this is the same bug as was reported more recently on the list and the tracker: https://sourceforge.net/tracker/index.php?func=detail&aid=3058804&group_id=80706&atid=560720 That report will make it easier to debug because it illustrates the problem with a relatively few points. Eric > 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 > > > > ------------------------------------------------------------------------------ > 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@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ```
 Re: [Matplotlib-users] How to get all data points plotted/displayed in a line plot From: Michael Droettboom - 2010-09-08 15:53:14 ```I believe this is now fixed in r8691 (branch and trunk). Mike On 09/03/2010 02:51 PM, Eric Firing wrote: > On 08/31/2010 01:08 AM, Jens Nie 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. >> > Jens, > > I'm confident this is the same bug as was reported more recently on the > list and the tracker: > > https://sourceforge.net/tracker/index.php?func=detail&aid=3058804&group_id=80706&atid=560720 > > That report will make it easier to debug because it illustrates the > problem with a relatively few points. > > > Eric > > >> 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 >> >> >> >> ------------------------------------------------------------------------------ >> 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@... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > > ------------------------------------------------------------------------------ > 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@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michael Droettboom Science Software Branch Space Telescope Science Institute Baltimore, Maryland, USA ```