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
(10) |
2
(6) |
3
(1) |
4
(4) |
5
(11) |
6
(19) |
7
(18) |
8
(7) |
9
(9) |
10
(4) |
11
(3) |
12
(5) |
13
(19) |
14
(13) |
15
(21) |
16
(4) |
17
|
18
(5) |
19
(9) |
20
(13) |
21
(7) |
22
|
23
(1) |
24
(3) |
25
|
26
(3) |
27
(1) |
28
(2) |
29
(6) |
30
(5) |
31
|
I have experimented with path.simplify and can't see any appreciable improvements. Incidently, I also experimented with other back ends. I found that all the back ends involving Agg behave similarly. However, using the 'GTK' backend it renders the whole 1 million points and does it very fast (about 5x faster than Agg backends). I also found that gnuplot can render the whole million points very fast using the 'x11' terminal. I am guessing that both matplotlib's GTK backend and gnuplot's 'x11' terminal use the hardware accelerated display driver. David
Here is a script that solves the problem, based on Goyo's input: ****************** #!/usr/bin/env python """simple_matplot.py -- Repeatedly plots sinusoids (shifted a bit each time). - control returns to the user after each plot; - the old plot is erased between cycles. """ import numpy as np import matplotlib import matplotlib.pyplot as plt x = np.arange(0.,2.*np.pi,0.02) y = np.sin(x) c = "go" plt.ion() fig = plt.figure() ax = fig.add_subplot(1,1,1) while c.find("go") > -1 : try: del ax.lines[0] except : pass line, = ax.plot(x,y,'-') plt.draw() print "stop or go?" c = raw_input() x = x + 0.5 ********** John Thorstensen wrote: > > I have a sizeable number of python data-inspection scripts that work as > follows: > > - read some data, or do something with it > - plot the data > - query the user on the command line and get a response > - do what the user commands. > > These use the venerable PGPLOT package for the graphics, but this has been > static for years and is getting increasingly vulnerable to obsolescence of > the supporting packages (e.g., numarray). > > I'm having a hard time converting these scripts to matplotlib because when > you do a show(), the mainloop takes over. It's possible to work around by > doing a show() for every plot, and then killing the plot manually, but > after a couple of hundred manual kills this gets tiresome. It would also > be possible to restructure the code so that the various options get > controlled by key press events in the plot, I suppose, but the effort > involved in converting all the scripts would be pretty large. > > So my question: Is there a simple way of getting matplotlib to display a > plot in a window and then surrender control to the main program, without > destroying the plot? Something like a method to kill mainloop would be > ideal. > > Thanks. > > [Apologies if this is general knowledge -- I couldn't find an answer.] > -- View this message in context: http://old.nabble.com/Non-interactive-plotting-to-window--tp32981792p32987821.html Sent from the matplotlib - users mailing list archive at Nabble.com.
How can I change linewidth of this arrow? arrow1=pylab.annotate("", xytext=(-3500,-1e8), xy=(-3500,8e8),fontsize=8,arrowprops=dict(arrowstyle="<->")) Thank you in advance. Petro
On 12/10/2011 01:12 PM, David Smith wrote: > I have been working on a program that uses Matplotlib to plot data > consisting of around one million points. Sometimes the plots succeed but > often I get an exception: OverFlowError: Agg rendering complexity exceeded. Are you sure path simplification is running? (i.e. the rcParam path.simplify is True)? That generally does a good job of removing excess points on the fly. You shouldn't need a development version for this to work. 0.99.x or later should be adequate. You're not going to "see" a million points at typical screen resolutions anyway. > > I can make this message go away by plotting the data in "chunks" as > illustrated in the demo code below. However, the extra code is a chore > which I don't think should be necessary - I hope the developers will > be able to fix this issue sometime soon. I know that the development > version has some modifications to addressing this issue. I wonder if it is > expected to make the problem go away? > > By the way, this plot takes about 30 seconds to render on my I7 2600k. > The main program reaches the show() statement quickly and prints > "Done plotting?". Then I see that the program reaches 100% usage > on one CPU core (4 real, 8 virtual on the 2600k) until the plot is > displayed. I wonder if there is any way to persuade Matplotlib to run > some of the chunks in parallel so as to use more CPU cores? That would be great, but very difficult. The Python parts of the problem are tricky to parallelize due to the GIL. The Agg part of the problem will be difficult to parallelize unless there is a trivial way to chuck the plotted lines into parts before stroking -- each chunk could be rendered to its own buffer and then blended together in a final step. But all that is academic at this point -- there's no code to do such a thing now. > > Plotting something other than random data, the plots run faster and > the maximum chunk size is smaller. The maximum chunk size > also depends on the plot size - it is smaller for larger plots. I am > wondering if I could use this to plot course and fine versions of the > plots. The course plot is zoomed in version of the small-sized raster. > That would be better than decimation as all the points would at least > be there. I think what you're seeing is the effect of the path simplification algorithm. The number of points that it removes depends on the density of the points and the resolution of the output image. It's hard to predict exactly how many points it will remove. Mike > > Thanks in advance, > > David > > --------------------------- start code --------------------------------- > ## Demo program shows how to "chunk" plots to avoid the exception: > ## > ## OverflowError: Agg rendering complexity exceeded. > ## Consider downsampling or decimating your data. > ## > ## David Smith December 2011. > > from pylab import * > import numpy as np > > nPts=600100 > x = np.random.rand(nPts) > y = np.random.rand(nPts) > > ## This seems to always succeed if Npts<= 20000, but fails > ## for Npts> 30000. For points between, it sometimes succeeds > ## and sometimes fails. > figure(1) > plot (x, y) > > ## Chunking the plot alway succeeds. > figure(2) > chunk_size=20000 > iStarts=range(x.size/chunk_size) > for iStart in iStarts: > print "Plotting chunk starting at %d\n" % iStart > plot(x[iStart:iStart+chunk_size], y[iStart:iStart+chunk_size], '-b') > > left_overs = nPts % chunk_size > if left_overs> 0: > print "Leftovers %d points\n" % left_overs > plot(x[-left_overs-1:], y[-left_overs-1:], '-r') > > print "done plotting?" > show() > ---------------------------------- end code ------------------------ > Please don't reply to this post "It is rediculous to plot 1 million points on > screen". I am routinely capturing million-point traces from oscilloscopes and > other test equipment and to I need to be able to spot features in the > data (glitches if you will) that may not show up plotting decimated data. > I can then zoom the plot to inspect these features. > > ------------------------------------------------------------------------------ > Learn Windows Azure Live! Tuesday, Dec 13, 2011 > Microsoft is holding a special Learn Windows Azure training event for > developers. It will provide a great way to learn Windows Azure and what it > provides. You can attend the event by watching it streamed LIVE online. > Learn more at http://p.sf.net/sfu/ms-windowsazure > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users