You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
1
(16) |
2
(31) |
3
(17) |
4
(18) |
5
(7) |
6
(5) |
7
(16) |
8
(9) |
9
(19) |
10
(18) |
11
(17) |
12
(7) |
13
(6) |
14
(15) |
15
(16) |
16
(15) |
17
(19) |
18
(27) |
19
(10) |
20
(5) |
21
(5) |
22
(19) |
23
(7) |
24
(11) |
25
(19) |
26
(1) |
27
(36) |
28
(37) |
29
(28) |
30
(36) |
|
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-09-07 21:49:51
|
On Mon, Sep 7, 2009 at 1:02 PM, tva<tv...@br...> wrote: > > Problem solved. The backend was set to Qt4Agg. Once set to TkAgg everything > works. > I don't get it but it works.......... > > I think an explicit call of draw() in the interactive mode (e.g. with ipython -pylab) should update the figure canvas immediately. And this is the behavior I currently observe with Gtk and Wx backend. If the Qt4 backend behaves differently, I guess this is a bug. I don't have the qt4 backend installed, and I hope other developers take a look. -JJ |
From: Andreas F. <an...@gm...> - 2009-09-07 20:36:41
|
thanks Sebastian, you are right, your code works here too. But i don't get it work in my multi y-axes plot from the matplotlib examples (http://matplotlib.sourceforge.net/examples/axes_grid/demo_parasite_axes.html). Even with linear plots, i get no gridlines. Any idea, whats wrong here? minimal code example: ####################### import matplotlib.pyplot as plt from mpl_toolkits.axes_grid.parasite_axes import HostAxes, ParasiteAxes fig = plt.figure(1) fig.clf() #plt.grid(True) host = HostAxes(fig, [0.15, 0.1, 0.65, 0.8]) fig.add_axes(host) host.plot([0, 10, 100], [0, 10, 100], label='host') host.grid(True) #? host.yaxis.grid(True) #? host.yaxis.set_scale('log') #? plt.draw() plt.show() ####################### Greets, Andreas Sebastian Busch schrieb: > from matplotlib.pyplot import * > > plot([1,10,100],[1,10,100]) > grid() > > yscale('log') > xscale('log') > > works here. > > best, > sebastian. > |
From: Sebastian B. <web...@th...> - 2009-09-07 18:28:35
|
jihi wrote: > ... can anybody tell me how to get gridlines in a logarithmic plot? ... from matplotlib.pyplot import * plot([1,10,100],[1,10,100]) grid() yscale('log') xscale('log') works here. best, sebastian. |
From: Ewald Z. <ewa...@gm...> - 2009-09-07 18:04:00
|
I'm using 'xpdf' now, I think it must be ghostscript acting up. I only need eps output infrequently so I'll stick with this workaround for the moment. On Mon, Sep 7, 2009 at 4:28 AM, Jae-Joon Lee <lee...@gm...> wrote: > I cannot reproduce this error. > And I'm not sure if this is a bug in matplotlib or ghostscript. > You may try to use different distiller. > > pl.rc('ps', usedistiller="xpdf") > > In my machine, both ghostscript and xpdf option works fine. > But my gs version is different than yours > > GPL Ghostscript 8.61 (2007-11-21) > > If the xpdf option woks, I think it is more likely that this is a bug in > gs. > > Regards, > > -JJ > > > On Wed, Sep 2, 2009 at 9:22 AM, Ewald Zietsman<ewa...@gm...> > wrote: > > Hi All, > > > > I'm trying to make a simple errorbar plot which gets saved to an EPS > file. I > > paste the code below. For some weird reason, the savefig line causes a > > segmentation fault in ghostscript. when I use (in this case, on my > computer) > > 206 points or more. It doesn't happen if I comment the "pl.rc('text', > > usetex=True)" line out nor does it happen if I comment the pl.savefig > line > > out. This happens in matplotlib 0.99 and 0.98.5.2. Any help will be > greatly > > appreciated. > > > > > > Regards, > > > > Ewald Zietsman > > > > #test.py > > > > import matplotlib.pyplot as pl > > import numpy as np > > > > pl.rc('text', usetex=True) > > pl.rc('font', family='serif') > > > > N = 206 > > x1 = np.linspace(-10,10,N) > > e1 = np.random.randn(N) > > > > pl.errorbar(x1, x1, yerr=e1, fmt='k.') > > pl.savefig('test.eps') > > pl.show() > > > > > > The error message: > > > > python test.py > > Segmentation fault > > Traceback (most recent call last): > > File "test.py", line 16, in <module> > > pl.savefig('test.eps') > > File "/usr/lib/python2.5/site-packages/matplotlib/pyplot.py", line 345, > in > > savefig > > return fig.savefig(*args, **kwargs) > > File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line 990, > in > > savefig > > self.canvas.print_figure(*args, **kwargs) > > File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py", > line > > 1419, in print_figure > > **kwargs) > > File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py", > line > > 1308, in print_eps > > return ps.print_eps(*args, **kwargs) > > File > "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_ps.py", > > line 869, in print_eps > > return self._print_ps(outfile, 'eps', *args, **kwargs) > > File > "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_ps.py", > > line 892, in _print_ps > > orientation, isLandscape, papertype) > > File > "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_ps.py", > > line 1148, in _print_figure_tex > > else: gs_distill(tmpfile, isEPSF, ptype=papertype, bbox=bbox) > > File > "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_ps.py", > > line 1268, in gs_distill > > your image.\nHere is the full report generated by ghostscript:\n\n' + > > fh.read()) > > RuntimeError: ghostscript was not able to process your image. > > Here is the full report generated by ghostscript: > > > > GPL Ghostscript 8.63 (2008-08-01) > > Copyright (C) 2008 Artifex Software, Inc. All rights reserved. > > This software comes with NO WARRANTY: see the file PUBLIC for details. > > Loading CenturySchL-Roma font from > > /var/lib/defoma/gs.d/dirs/fonts/c059013l.pfb... 3423696 1832182 6023256 > > 4166010 1 done. > > > > > > > ------------------------------------------------------------------------------ > > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > > trial. Simplify your report design, integration and deployment - and > focus > > on > > what you do best, core application coding. Discover what's new with > > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > |
From: Javier O. <pi...@gm...> - 2009-09-07 17:23:05
|
Oi, I'm having trouble ploting some values vs date with matplotlib. I get the data from an SQL server using the _mssql module after the query I tried populating the list using: [code] xls = [] yls = [] for row in conn: xls.append(row['Ia']) yls.append(row['tiempo']) [/code] The row['tiempo'] is datetime in the SQL table so I get yls filled with datetime objects At first I tried displaying it in an YYYYMMDDhhmm format using [code] temp = row['tiempo'] temp = str(temp.year) + '-' + str(temp.month) + '-' + str(temp.hour) +'-' + str(temp.minute) temp = int(temp) yls.append(temp) [/code] but after seeing that matplotlib by default uses an exponential notation y then realized that the scale would be off. If I use date2num() it displays numbers not dates. Basically I would like to plot the data against dates, with the ability to autoscale from a minutes view to a month view at least. The data set is failry large, at least 1 year of data from 5 minutes apart measurements. Any pointers in the right direction? Can I plot dates without converting them to a number? If not could the numbers be linked to back to the date and the date be displayed in the axis instead of the numbers? Thanks for your time. |
From: jihi <ji...@gm...> - 2009-09-07 17:17:48
|
Hi, can anybody tell me how to get gridlines in a logarithmic plot? i tried eg.: loglog([1,10,100], [1,10,100]) grid(True) but neither the grid is drawn, nor an error occur. When i make a linear plot, grid(True) works fine and draws the grid. (win32, python 2.6, matplotlib 0.99) Thanks |
From: tva <tv...@br...> - 2009-09-07 17:02:47
|
Problem solved. The backend was set to Qt4Agg. Once set to TkAgg everything works. I don't get it but it works.......... tva wrote: > > Hi Michiel > > thanks, but does that explain why the script works smoothly in 0.98.6 and > earlier versions? > Plotting all the curves at the end of the script is certainly possible, > but it is a severe reduction of the functionallity. given the fact that it > works so well in earlier versions of matplotlib, it seems like a bug in > matplotlib...? > > > > > Michiel de Hoon wrote: >> >>> Any idea why there is such a difference between >>> 0.98.5.3 and 0.99 ?? >> >> Drawing the whole figure once, when no further Python input is available, >> is much more efficient than drawing after each plot() command. For some >> figures, matplotlib 0.98.5.3 becomes extremely slow. >> >>> Thanks JJ, but unfortunately this is not the solution. >>> draw() gives the same result. - and I am running this >>> as a script (running it from ipython shell). >> >> The problem in your script is that the event loop never kicks in. >> Unfortunately, Python has no support for event loops in general, which >> makes this hard to solve. One option is to use raw_input() between calls >> to plot(), but then each time you have to hit <enter> to get the script >> to proceed. >> >> --Michiel. >> >> >> --- On Mon, 9/7/09, tva <tv...@br...> wrote: >> >>> From: tva <tv...@br...> >>> Subject: Re: [Matplotlib-users] cannot plot in loops with matplotlib >>> 0.99. 0.98 works fine >>> To: mat...@li... >>> Date: Monday, September 7, 2009, 3:17 AM >>> >>> Thanks JJ, but unfortunately this is not the solution. >>> draw() gives the same >>> result. - and I am running this as a script (running it >>> from ipython shell). >>> >>> Any clue? >>> >>> >>> >>> >>> >>> Jae-Joon Lee wrote: >>> > >>> > I presume you're running that script in interactive >>> shell? >>> > Try draw() instead of show(). >>> > >>> > Regards, >>> > >>> > -JJ >>> > >>> > >>> > On Sun, Sep 6, 2009 at 3:06 PM, tva<tv...@br...> >>> wrote: >>> >> >>> >> Hi all >>> >> >>> >> with matplotlib 0.98.5.3 this script will draw new >>> lines as the scrips is >>> >> running: >>> >> >>> >> from pylab import * >>> >> x = arange(0,2*pi,0.01) >>> >> for i in arange(1,20): >>> >> >>> >> y=sin(x+i) >>> >> plot(x,y) # update the data >>> >> show() >>> >> >>> >> >>> >> with matplotlib 0.99, the exact same script runs >>> to the end without >>> >> plotting >>> >> and then plots all the lines. This is just a >>> trivial example but for some >>> >> applications it is useful to monitor the evolution >>> of curves as the >>> >> script >>> >> is running - allows me to update parameters if >>> something diverges. >>> >> Any idea why there is such a difference between >>> 0.98.5.3 and 0.99 ?? >>> >> -- >>> >> View this message in context: >>> >> >>> http://www.nabble.com/cannot-plot-in-loops-with-matplotlib-0.99.-0.98-works-fine-tp25320454p25320454.html >>> >> Sent from the matplotlib - users mailing list >>> archive at Nabble.com. >>> >> >>> >> >>> >> >>> ------------------------------------------------------------------------------ >>> >> Let Crystal Reports handle the reporting - Free >>> Crystal Reports 2008 >>> >> 30-Day >>> >> trial. Simplify your report design, integration >>> and deployment - and >>> >> focus on >>> >> what you do best, core application coding. >>> Discover what's new with >>> >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >>> >> _______________________________________________ >>> >> Matplotlib-users mailing list >>> >> Mat...@li... >>> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >> >>> > >>> > >>> ------------------------------------------------------------------------------ >>> > Let Crystal Reports handle the reporting - Free >>> Crystal Reports 2008 >>> > 30-Day >>> > trial. Simplify your report design, integration and >>> deployment - and focus >>> > on >>> > what you do best, core application coding. Discover >>> what's new with >>> > Crystal Reports now. http://p.sf.net/sfu/bobj-july >>> > _______________________________________________ >>> > Matplotlib-users mailing list >>> > Mat...@li... >>> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> > >>> > >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/cannot-plot-in-loops-with-matplotlib-0.99.-0.98-works-fine-tp25320454p25326025.html >>> Sent from the matplotlib - users mailing list archive at >>> Nabble.com. >>> >>> >>> ------------------------------------------------------------------------------ >>> Let Crystal Reports handle the reporting - Free Crystal >>> Reports 2008 30-Day >>> trial. Simplify your report design, integration and >>> deployment - and focus on >>> what you do best, core application coding. Discover what's >>> new with >>> Crystal Reports now. http://p.sf.net/sfu/bobj-july >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >> >> >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day >> trial. Simplify your report design, integration and deployment - and >> focus on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > -- View this message in context: http://www.nabble.com/cannot-plot-in-loops-with-matplotlib-0.99.-0.98-works-fine-tp25320454p25333552.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Arthur M. G. <am...@ir...> - 2009-09-07 14:42:42
|
Hi All, The problem is not with fetching the data slice itself, but finding the correct indices to specify, particularly with the time dimension. The below examples refer to a remote dataset that I can open and slice using indices, as in slice = remoteobj.variables['tas'][:120,20:40,30:50]. However, I have problems when trying to use the syntax in plotsst.py or pnganim.py (from the examples) to find time indices: In [107]: from datetime import datetime as dt In [108]: date0 = dt(1951,1,1,0) In [110]: print date0 1951-01-01 00:00:00 In [125]: timedata = remoteobj.variables['time'] In [126]: nt0 = date2index(date0,timedata) --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) /home/amg/work/nhmm/<ipython console> in <module>() /usr/local/cdat/trunk/lib/python2.5/site-packages/mpl_toolkits/basemap/__init__.pyc in date2index(dates, nctime, calendar) 3924 Returns an index or a sequence of indices. 3925 """ -> 3926 return netcdftime.date2index(dates, nctime, calendar=None) 3927 3928 def maskoceans(lonsin,latsin,datain,inlands=False): /usr/local/cdat/trunk/lib/python2.5/site-packages/mpl_toolkits/basemap/netcdftime.pyc in date2index(dates, nctime, calendar) 986 987 # Perform check again. --> 988 _check_index(index, dates, nctime, calendar) 989 990 # convert numpy scalars or single element arrays to python ints. /usr/local/cdat/trunk/lib/python2.5/site-packages/mpl_toolkits/basemap/netcdftime.pyc in _check_index(indices, dates, nctime, calendar) 941 for n,i in enumerate(indices): 942 t[n] = nctime[i] --> 943 assert numpy.all( num2date(t, nctime.units, calendar) == dates) 944 945 AssertionError: --------------------------------------------------------- It turns out that date0 corresponds best to index 1080: In [139]: remoteobj.variables['time'][1080] Out[139]: 32865.5 In [141]: num2date(32865.5,timedata.units,timedata.calendar) Out[141]: 1951-01-16 12:00:00 This isn't the _exact_ date and time I had specified, but In [142]: date0 = dt(1951,01,16,12,00,00) In [143]: print date0 1951-01-16 12:00:00 In [144]: date2index(date0,timedata,timedata.calendar) produces the same AssertionError. Where is the problem? What I would _like_ to do is to issue a simple call using coordinates rather than the indices, of the form: slice = variable[date0:date1,[plev],lat0:lat1,lon0:lon1], or similar, preferably without writing a whole module just to find the correct indices. I need to fetch similar slices from a group of models, having time axes that may each be defined slightly differently -- different calendars, time point set at a different day of the month, etc. (It's monthly data and I'm specifying only monthly bounds, even though the calendar may be defined as "days since 1860...") I need to automate the process so I get back the correct slab regardless. Suggestions appreciated! Thx, Arthur *^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~* Arthur M. Greene, Ph.D. The International Research Institute for Climate and Society (IRI) The Earth Institute, Columbia University, Lamont Campus amg at iri dot columbia dot edu | http://iri.columbia.edu *^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~* |
From: tva <tv...@br...> - 2009-09-07 09:49:27
|
Hi Michiel thanks, but does that explain why the script works smoothly in 0.98.6 and earlier versions? Plotting all the curves at the end of the script is certainly possible, but it is a severe reduction of the functionallity. given the fact that it works so well in earlier versions of matplotlib, it seems like a bug in matplotlib...? Michiel de Hoon wrote: > >> Any idea why there is such a difference between >> 0.98.5.3 and 0.99 ?? > > Drawing the whole figure once, when no further Python input is available, > is much more efficient than drawing after each plot() command. For some > figures, matplotlib 0.98.5.3 becomes extremely slow. > >> Thanks JJ, but unfortunately this is not the solution. >> draw() gives the same result. - and I am running this >> as a script (running it from ipython shell). > > The problem in your script is that the event loop never kicks in. > Unfortunately, Python has no support for event loops in general, which > makes this hard to solve. One option is to use raw_input() between calls > to plot(), but then each time you have to hit <enter> to get the script to > proceed. > > --Michiel. > > > --- On Mon, 9/7/09, tva <tv...@br...> wrote: > >> From: tva <tv...@br...> >> Subject: Re: [Matplotlib-users] cannot plot in loops with matplotlib >> 0.99. 0.98 works fine >> To: mat...@li... >> Date: Monday, September 7, 2009, 3:17 AM >> >> Thanks JJ, but unfortunately this is not the solution. >> draw() gives the same >> result. - and I am running this as a script (running it >> from ipython shell). >> >> Any clue? >> >> >> >> >> >> Jae-Joon Lee wrote: >> > >> > I presume you're running that script in interactive >> shell? >> > Try draw() instead of show(). >> > >> > Regards, >> > >> > -JJ >> > >> > >> > On Sun, Sep 6, 2009 at 3:06 PM, tva<tv...@br...> >> wrote: >> >> >> >> Hi all >> >> >> >> with matplotlib 0.98.5.3 this script will draw new >> lines as the scrips is >> >> running: >> >> >> >> from pylab import * >> >> x = arange(0,2*pi,0.01) >> >> for i in arange(1,20): >> >> >> >> y=sin(x+i) >> >> plot(x,y) # update the data >> >> show() >> >> >> >> >> >> with matplotlib 0.99, the exact same script runs >> to the end without >> >> plotting >> >> and then plots all the lines. This is just a >> trivial example but for some >> >> applications it is useful to monitor the evolution >> of curves as the >> >> script >> >> is running - allows me to update parameters if >> something diverges. >> >> Any idea why there is such a difference between >> 0.98.5.3 and 0.99 ?? >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/cannot-plot-in-loops-with-matplotlib-0.99.-0.98-works-fine-tp25320454p25320454.html >> >> Sent from the matplotlib - users mailing list >> archive at Nabble.com. >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> Let Crystal Reports handle the reporting - Free >> Crystal Reports 2008 >> >> 30-Day >> >> trial. Simplify your report design, integration >> and deployment - and >> >> focus on >> >> what you do best, core application coding. >> Discover what's new with >> >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> >> _______________________________________________ >> >> Matplotlib-users mailing list >> >> Mat...@li... >> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >> > >> > >> ------------------------------------------------------------------------------ >> > Let Crystal Reports handle the reporting - Free >> Crystal Reports 2008 >> > 30-Day >> > trial. Simplify your report design, integration and >> deployment - and focus >> > on >> > what you do best, core application coding. Discover >> what's new with >> > Crystal Reports now. http://p.sf.net/sfu/bobj-july >> > _______________________________________________ >> > Matplotlib-users mailing list >> > Mat...@li... >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/cannot-plot-in-loops-with-matplotlib-0.99.-0.98-works-fine-tp25320454p25326025.html >> Sent from the matplotlib - users mailing list archive at >> Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal >> Reports 2008 30-Day >> trial. Simplify your report design, integration and >> deployment - and focus on >> what you do best, core application coding. Discover what's >> new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/cannot-plot-in-loops-with-matplotlib-0.99.-0.98-works-fine-tp25320454p25327845.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Michiel de H. <mjl...@ya...> - 2009-09-07 09:24:25
|
> Any idea why there is such a difference between > 0.98.5.3 and 0.99 ?? Drawing the whole figure once, when no further Python input is available, is much more efficient than drawing after each plot() command. For some figures, matplotlib 0.98.5.3 becomes extremely slow. > Thanks JJ, but unfortunately this is not the solution. > draw() gives the same result. - and I am running this > as a script (running it from ipython shell). The problem in your script is that the event loop never kicks in. Unfortunately, Python has no support for event loops in general, which makes this hard to solve. One option is to use raw_input() between calls to plot(), but then each time you have to hit <enter> to get the script to proceed. --Michiel. --- On Mon, 9/7/09, tva <tv...@br...> wrote: > From: tva <tv...@br...> > Subject: Re: [Matplotlib-users] cannot plot in loops with matplotlib 0.99. 0.98 works fine > To: mat...@li... > Date: Monday, September 7, 2009, 3:17 AM > > Thanks JJ, but unfortunately this is not the solution. > draw() gives the same > result. - and I am running this as a script (running it > from ipython shell). > > Any clue? > > > > > > Jae-Joon Lee wrote: > > > > I presume you're running that script in interactive > shell? > > Try draw() instead of show(). > > > > Regards, > > > > -JJ > > > > > > On Sun, Sep 6, 2009 at 3:06 PM, tva<tv...@br...> > wrote: > >> > >> Hi all > >> > >> with matplotlib 0.98.5.3 this script will draw new > lines as the scrips is > >> running: > >> > >> from pylab import * > >> x = arange(0,2*pi,0.01) > >> for i in arange(1,20): > >> > >> y=sin(x+i) > >> plot(x,y) # update the data > >> show() > >> > >> > >> with matplotlib 0.99, the exact same script runs > to the end without > >> plotting > >> and then plots all the lines. This is just a > trivial example but for some > >> applications it is useful to monitor the evolution > of curves as the > >> script > >> is running - allows me to update parameters if > something diverges. > >> Any idea why there is such a difference between > 0.98.5.3 and 0.99 ?? > >> -- > >> View this message in context: > >> http://www.nabble.com/cannot-plot-in-loops-with-matplotlib-0.99.-0.98-works-fine-tp25320454p25320454.html > >> Sent from the matplotlib - users mailing list > archive at Nabble.com. > >> > >> > >> > ------------------------------------------------------------------------------ > >> Let Crystal Reports handle the reporting - Free > Crystal Reports 2008 > >> 30-Day > >> trial. Simplify your report design, integration > and deployment - and > >> focus on > >> what you do best, core application coding. > Discover what's new with > >> Crystal Reports now. http://p.sf.net/sfu/bobj-july > >> _______________________________________________ > >> Matplotlib-users mailing list > >> Mat...@li... > >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >> > > > > > ------------------------------------------------------------------------------ > > Let Crystal Reports handle the reporting - Free > Crystal Reports 2008 > > 30-Day > > trial. Simplify your report design, integration and > deployment - and focus > > on > > what you do best, core application coding. Discover > what's new with > > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > -- > View this message in context: http://www.nabble.com/cannot-plot-in-loops-with-matplotlib-0.99.-0.98-works-fine-tp25320454p25326025.html > Sent from the matplotlib - users mailing list archive at > Nabble.com. > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal > Reports 2008 30-Day > trial. Simplify your report design, integration and > deployment - and focus on > what you do best, core application coding. Discover what's > new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Auré G. <aur...@ya...> - 2009-09-07 07:56:29
|
OK, thanks JJ, I just wanted to make sure I was not missing something. I guess I'll have to check how it goes once rebinned. Cheers, Auré ________________________________ De : Jae-Joon Lee <lee...@gm...> À : Auré Gourrier <aur...@ya...> Cc : mat...@li... Envoyé le : Lundi, 7 Septembre 2009, 4h11mn 29s Objet : Re: [Matplotlib-users] slow rendering of 2K images using Animation_blit_tk.py - bis There are a few ways to improve the speed, which, I guess, will give you factor of a few speed up. If you need more than that, I guess matplotlib is not suitable for your purpose. * try a simple interpolation method, eg. imshow(arr, interpolation="nearest") * reduce the image size. Unless you have a monitor this large, you loose the image quality anyhow. In my machine (linux, xeon 2.6 GHz), it takes about ~0.8 s to display 2k x 2k image. 0.3 s for 1k x 1k. Regards, -JJ On Fri, Sep 4, 2009 at 5:18 AM, Auré Gourrier<aur...@ya...> wrote: > Dear all, > > I recently cried for help (see below) but sadly didn't get any answer... > This problem is really a bottleneck for me and if I must find a solution... > Can anyone PLEAAAAAAAAASE point me in the right direction ? > > I recently bumped into a problem while trying to display imshow images > (2048x2048 pix) in a GUI based on TkAgg (matplotib0.91.2, python 2..4.4, > numpy1.0.4).. In brief, building the image with imshow is Ok, but the call to > show() or draw() takes about 1.2 s on my system (XP, 2.8Ghz, 2Go ram). After > reading a lot of posts and trying out a few things, I turned to the > Animation_blit_tk.py example and modified it accordingly (code attached > below). In the end, the display is still not much faster using this method > (still in the order of 1.2 s as indicated by the result below). > Could any one tel me whether I'm doing something wrong ? > > As far as I understand, at least in my Tk GUI, the limiting step using the > ImageTk.FigureCanvasTkAgg is the call to draw() or draw_artist(). I read > some comments from John regarding TkAgg being slow in some cases but > couldn't find a definite answer. > > Any hint would be much appreciated.... > > Cheers, > > Aure > > > -------- > # For detailed comments on animation and the techniqes used here, see > # the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations > > import matplotlib > matplotlib.use('TkAgg') > > import sys > import pylab as p > #import matplotlib.numerix as nx > import time > > from FileUtils10 import fileHandling > > # for profiling > tstart = time.time() > tprevious = time.time() > > fnamelist = ['fname1','fname2','fname3'] > > ax = p.subplot(111) > canvas = ax.figure.canvas > > print 't1 ',time.time()-tprevious > tprevious = time.time() > > # create the initial line > dataarr = fileHandling(fnamelist[0]).readSpecial() > #print dataarr.dtype => numpy dtype uint16 > #dataarr = dataarr..astype('uint8') > print 't2 ',time.time()-tprevious > tprevious = time.time() > > image = p.imshow(dataarr, animated=True) > print 't3 ',time.time()-tprevious > tprevious = time.time() > > def run(*args): > tprevious = time.time() > background = canvas.copy_from_bbox(ax.bbox) > print 't4 ',time.time()-tprevious > tprevious = time.time() > while 1: > #print fnamelist[run.cnt] > # restore the clean slate background > canvas.restore_region(background) > print 't5 ',time.time()-tprevious > tprevious = time.time() > # update the data > dataarr = fileHandling(fnamelist[run.cnt]).readSpecial() > print 't6 ',time.time()-tprevious > tprevious = time.time() > image.set_data(dataarr) > print 't7 ',time.time()-tprevious > tprevious = time.time() > # just draw the animated artist > ax.draw_artist(image) > print 't8 ',time.time()-tprevious > tprevious = time.time() > # just redraw the axes rectangle > canvas.blit(ax.bbox) > print 't9 ',time.time()-tprevious > tprevious = time.time() > > if fnamelist[run.cnt] == fnamelist[-1]: > # print the timing info and quit > print 'total time:' , time.time()-tstart > print 'FPS:' , 1000./(time.time()-tstart) > p.close('all') > sys.exit() > > run.cnt += 1 > run.cnt = 0 > > > p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs > p.grid() # to ensure proper background restore > manager = p.get_current_fig_manager() > manager.window.after(100, run) > > p.show() > > > ==== > Results in: > > t1 0.858999967575 > t2 0.0320000648499 > t3 1.31299996376 > t4 0.0 > t5 0.0 > t6 0.0310001373291 > t7 0.0 > t8 1.18700003624 > t9 0.0160000324249 > t5 0.0 > t6 0.0469999313354 > t7 0..0 > t8 1.17200016975 > t9 0.0149998664856 > t5 0.0 > t6 0.047000169754 > t7 0.0 > t8 1.21899986267 > t9 0.0 > t5 0.0 > t6 0.0460000038147 > t7 0.0 > t8 1.17199993134 > t9 0.0 > t5 0.0 > t6 0.0469999313354 > t7 0.0 > t8 1.18700003624 > t9 0.0160000324249 > total time: 8.75 > FPS: 114.285714286 > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: tva <tv...@br...> - 2009-09-07 07:18:09
|
Thanks JJ, but unfortunately this is not the solution. draw() gives the same result. - and I am running this as a script (running it from ipython shell). Any clue? Jae-Joon Lee wrote: > > I presume you're running that script in interactive shell? > Try draw() instead of show(). > > Regards, > > -JJ > > > On Sun, Sep 6, 2009 at 3:06 PM, tva<tv...@br...> wrote: >> >> Hi all >> >> with matplotlib 0.98.5.3 this script will draw new lines as the scrips is >> running: >> >> from pylab import * >> x = arange(0,2*pi,0.01) >> for i in arange(1,20): >> >> y=sin(x+i) >> plot(x,y) # update the data >> show() >> >> >> with matplotlib 0.99, the exact same script runs to the end without >> plotting >> and then plots all the lines. This is just a trivial example but for some >> applications it is useful to monitor the evolution of curves as the >> script >> is running - allows me to update parameters if something diverges. >> Any idea why there is such a difference between 0.98.5.3 and 0.99 ?? >> -- >> View this message in context: >> http://www.nabble.com/cannot-plot-in-loops-with-matplotlib-0.99.-0.98-works-fine-tp25320454p25320454.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day >> trial. Simplify your report design, integration and deployment - and >> focus on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/cannot-plot-in-loops-with-matplotlib-0.99.-0.98-works-fine-tp25320454p25326025.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Eric F. <ef...@ha...> - 2009-09-07 03:55:47
|
Christian Meesters wrote: > Hi, > > Let me reformulate my question: Is there a way to put ticklabels not > beside, but between ticks (centered between)? There is presently no clean mechanism for this. A workaround is to use minor ticks centered between the major ticks, and label only the minor ticks (which could be set to zero length). There was a thread on the list about this a couple weeks ago; I don't recall whether an example of this method was given then. Eric > > TIA > Christian > > On Fri, 2009-09-04 at 10:53 +0200, Christian Meesters wrote: >> Hi, >> >> I have the following code: >> >> pylab.pcolormesh(data, multialignment='center') >> xlocs, xlabels = pylab.xticks(range(0, data.shape[1]+1), xlabels) >> pylab.setp(xlabels, 'rotation', 70) >> pylab.colorbar() >> pylab.show() >> >> where data is a 2D numpy array containing some masked values and >> 'xlabels' is - originally - a list of strings for the xlabels. >> >> This gives me two problems: >> - The "column" on the right is shown as blank, although this column has >> valid data and >> - the labels aren't placed below the center of a field, but below the >> xticks. I would like to have them centered, below a field, as the ticks >> are merely separators and not associated with any unit. >> >> TIA >> Christian >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >> trial. Simplify your report design, integration and deployment - and focus on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Jae-Joon L. <lee...@gm...> - 2009-09-07 02:29:06
|
I cannot reproduce this error. And I'm not sure if this is a bug in matplotlib or ghostscript. You may try to use different distiller. pl.rc('ps', usedistiller="xpdf") In my machine, both ghostscript and xpdf option works fine. But my gs version is different than yours GPL Ghostscript 8.61 (2007-11-21) If the xpdf option woks, I think it is more likely that this is a bug in gs. Regards, -JJ On Wed, Sep 2, 2009 at 9:22 AM, Ewald Zietsman<ewa...@gm...> wrote: > Hi All, > > I'm trying to make a simple errorbar plot which gets saved to an EPS file. I > paste the code below. For some weird reason, the savefig line causes a > segmentation fault in ghostscript. when I use (in this case, on my computer) > 206 points or more. It doesn't happen if I comment the "pl.rc('text', > usetex=True)" line out nor does it happen if I comment the pl.savefig line > out. This happens in matplotlib 0.99 and 0.98.5.2. Any help will be greatly > appreciated. > > > Regards, > > Ewald Zietsman > > #test.py > > import matplotlib.pyplot as pl > import numpy as np > > pl.rc('text', usetex=True) > pl.rc('font', family='serif') > > N = 206 > x1 = np.linspace(-10,10,N) > e1 = np.random.randn(N) > > pl.errorbar(x1, x1, yerr=e1, fmt='k.') > pl.savefig('test.eps') > pl.show() > > > The error message: > > python test.py > Segmentation fault > Traceback (most recent call last): > File "test.py", line 16, in <module> > pl.savefig('test.eps') > File "/usr/lib/python2.5/site-packages/matplotlib/pyplot.py", line 345, in > savefig > return fig.savefig(*args, **kwargs) > File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line 990, in > savefig > self.canvas.print_figure(*args, **kwargs) > File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py", line > 1419, in print_figure > **kwargs) > File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py", line > 1308, in print_eps > return ps.print_eps(*args, **kwargs) > File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_ps.py", > line 869, in print_eps > return self._print_ps(outfile, 'eps', *args, **kwargs) > File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_ps.py", > line 892, in _print_ps > orientation, isLandscape, papertype) > File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_ps.py", > line 1148, in _print_figure_tex > else: gs_distill(tmpfile, isEPSF, ptype=papertype, bbox=bbox) > File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_ps.py", > line 1268, in gs_distill > your image.\nHere is the full report generated by ghostscript:\n\n' + > fh.read()) > RuntimeError: ghostscript was not able to process your image. > Here is the full report generated by ghostscript: > > GPL Ghostscript 8.63 (2008-08-01) > Copyright (C) 2008 Artifex Software, Inc. All rights reserved. > This software comes with NO WARRANTY: see the file PUBLIC for details. > Loading CenturySchL-Roma font from > /var/lib/defoma/gs.d/dirs/fonts/c059013l.pfb... 3423696 1832182 6023256 > 4166010 1 done. > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Jae-Joon L. <lee...@gm...> - 2009-09-07 02:12:02
|
There are a few ways to improve the speed, which, I guess, will give you factor of a few speed up. If you need more than that, I guess matplotlib is not suitable for your purpose. * try a simple interpolation method, eg. imshow(arr, interpolation="nearest") * reduce the image size. Unless you have a monitor this large, you loose the image quality anyhow. In my machine (linux, xeon 2.6 GHz), it takes about ~0.8 s to display 2k x 2k image. 0.3 s for 1k x 1k. Regards, -JJ On Fri, Sep 4, 2009 at 5:18 AM, Auré Gourrier<aur...@ya...> wrote: > Dear all, > > I recently cried for help (see below) but sadly didn't get any answer... > This problem is really a bottleneck for me and if I must find a solution... > Can anyone PLEAAAAAAAAASE point me in the right direction ? > > I recently bumped into a problem while trying to display imshow images > (2048x2048 pix) in a GUI based on TkAgg (matplotib0.91.2, python 2..4.4, > numpy1.0.4). In brief, building the image with imshow is Ok, but the call to > show() or draw() takes about 1.2 s on my system (XP, 2.8Ghz, 2Go ram). After > reading a lot of posts and trying out a few things, I turned to the > Animation_blit_tk.py example and modified it accordingly (code attached > below). In the end, the display is still not much faster using this method > (still in the order of 1.2 s as indicated by the result below). > Could any one tel me whether I'm doing something wrong ? > > As far as I understand, at least in my Tk GUI, the limiting step using the > ImageTk.FigureCanvasTkAgg is the call to draw() or draw_artist(). I read > some comments from John regarding TkAgg being slow in some cases but > couldn't find a definite answer. > > Any hint would be much appreciated.... > > Cheers, > > Aure > > > -------- > # For detailed comments on animation and the techniqes used here, see > # the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations > > import matplotlib > matplotlib.use('TkAgg') > > import sys > import pylab as p > #import matplotlib.numerix as nx > import time > > from FileUtils10 import fileHandling > > # for profiling > tstart = time.time() > tprevious = time.time() > > fnamelist = ['fname1','fname2','fname3'] > > ax = p.subplot(111) > canvas = ax.figure.canvas > > print 't1 ',time.time()-tprevious > tprevious = time.time() > > # create the initial line > dataarr = fileHandling(fnamelist[0]).readSpecial() > #print dataarr.dtype => numpy dtype uint16 > #dataarr = dataarr.astype('uint8') > print 't2 ',time.time()-tprevious > tprevious = time.time() > > image = p.imshow(dataarr, animated=True) > print 't3 ',time.time()-tprevious > tprevious = time.time() > > def run(*args): > tprevious = time.time() > background = canvas.copy_from_bbox(ax.bbox) > print 't4 ',time.time()-tprevious > tprevious = time.time() > while 1: > #print fnamelist[run.cnt] > # restore the clean slate background > canvas.restore_region(background) > print 't5 ',time.time()-tprevious > tprevious = time.time() > # update the data > dataarr = fileHandling(fnamelist[run.cnt]).readSpecial() > print 't6 ',time.time()-tprevious > tprevious = time.time() > image.set_data(dataarr) > print 't7 ',time.time()-tprevious > tprevious = time.time() > # just draw the animated artist > ax.draw_artist(image) > print 't8 ',time.time()-tprevious > tprevious = time.time() > # just redraw the axes rectangle > canvas.blit(ax.bbox) > print 't9 ',time.time()-tprevious > tprevious = time.time() > > if fnamelist[run.cnt] == fnamelist[-1]: > # print the timing info and quit > print 'total time:' , time.time()-tstart > print 'FPS:' , 1000./(time.time()-tstart) > p.close('all') > sys.exit() > > run.cnt += 1 > run.cnt = 0 > > > p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs > p.grid() # to ensure proper background restore > manager = p.get_current_fig_manager() > manager.window.after(100, run) > > p.show() > > > ==== > Results in: > > t1 0.858999967575 > t2 0.0320000648499 > t3 1.31299996376 > t4 0.0 > t5 0.0 > t6 0.0310001373291 > t7 0.0 > t8 1.18700003624 > t9 0.0160000324249 > t5 0.0 > t6 0.0469999313354 > t7 0..0 > t8 1.17200016975 > t9 0.0149998664856 > t5 0.0 > t6 0.047000169754 > t7 0.0 > t8 1.21899986267 > t9 0.0 > t5 0.0 > t6 0.0460000038147 > t7 0.0 > t8 1.17199993134 > t9 0.0 > t5 0.0 > t6 0.0469999313354 > t7 0.0 > t8 1.18700003624 > t9 0.0160000324249 > total time: 8.75 > FPS: 114.285714286 > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Jae-Joon L. <lee...@gm...> - 2009-09-07 01:29:55
|
I presume you're running that script in interactive shell? Try draw() instead of show(). Regards, -JJ On Sun, Sep 6, 2009 at 3:06 PM, tva<tv...@br...> wrote: > > Hi all > > with matplotlib 0.98.5.3 this script will draw new lines as the scrips is > running: > > from pylab import * > x = arange(0,2*pi,0.01) > for i in arange(1,20): > > y=sin(x+i) > plot(x,y) # update the data > show() > > > with matplotlib 0.99, the exact same script runs to the end without plotting > and then plots all the lines. This is just a trivial example but for some > applications it is useful to monitor the evolution of curves as the script > is running - allows me to update parameters if something diverges. > Any idea why there is such a difference between 0.98.5.3 and 0.99 ?? > -- > View this message in context: http://www.nabble.com/cannot-plot-in-loops-with-matplotlib-0.99.-0.98-works-fine-tp25320454p25320454.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |