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
(19) |
2
(30) |
3
(14) |
4
(1) |
5
(16) |
6
(7) |
7
(12) |
8
(14) |
9
(35) |
10
(16) |
11
(31) |
12
(6) |
13
(14) |
14
(13) |
15
(20) |
16
(15) |
17
(27) |
18
(5) |
19
(10) |
20
(22) |
21
(20) |
22
(30) |
23
(25) |
24
(11) |
25
(2) |
26
(2) |
27
(23) |
28
(20) |
29
(26) |
30
(25) |
31
(7) |
|
Changing the properties of the individual grid line can be tricky. The easier way in my opinion is to draw another line with thinker linewidth. ax=subplot(111) ax.grid() from matplotlib.transforms import blended_transform_factory # for x=0 trans = blended_transform_factory(ax.transData, ax.transAxes) ax.plot([0,0], [0,1], "-", transform=trans, color="red", linewidth=2, zorder=5) # for y=0 trans = blended_transform_factory(ax.transAxes, ax.transData) ax.plot([0,1], [0,0], "-", transform=trans, color="blue", linewidth=2, zorder=5) -JJ On Wed, Jul 1, 2009 at 8:40 AM, Torsten Bronger<br...@ph...> wrote: > Hallöchen! > > I have a grid in my plot, but additionally I'd like to highlight the > "zero" axes, where x=0 or y=0, e.g. by showing them in red, or with > thicker lines. How is this possible? > > Tschö, > Torsten. > > -- > Torsten Bronger, aquisgrana, europa vetus > Jabber ID: tor...@ja... > or http://bronger-jmp.appspot.com > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
On Fri, Jul 3, 2009 at 12:05 PM, guillaume ranquet <gra...@wy...>wrote: > Ryan May wrote: > > > > > > On Fri, Jul 3, 2009 at 8:32 AM, guillaume ranquet <gra...@wy... > > <mailto:gra...@wy...>> wrote: > > > > Hi list, > > > > I'm trying to get a dynamic plot running. > > I'm stuck at feeding the data to the lines. > > > > basically I've a callback that receives a (y,x1,x2) tuple and I would > > like to add the 2 points to the two matplotlib.lines of the figure. > > > > should I handle a copy of xdata/ydata and gives the updated set to > > set_x/ydata() for one point? > > I tried to get_data() and append to it, but It's a MaskedArray and I > > guess it means its a really bad idea to try this way. > > > > probably a new class inheriting figure and overriding > > get_data()//set_data() could do the trick? > > > > > > any advice on a _clean_ design I could use? > > > > > > You can add a value to an array using np.concatenate: > > > > x,y = line.get_data() > > x = np.concatenate((x, [x0])) > > y = np.concatenate((y, [y0])) > > line.set_data([x,y]) > > > > This is rather inefficient however if you're adding lots of points or if > > there are just a lot of point in x any in general. If you know how many > > points you're going to end up with, you could create mostly empty > > MaskedArrays and keep the extra points masked until you get the data. > > > > Ryan > > > > -- > > Ryan May > > Graduate Research Assistant > > School of Meteorology > > University of Oklahoma > > > thanks Ryan, > It does work and I'll use that for now. > the idea is to have a gkrellm-like UI in which you can monitor system > usage 'live' > I guess I could have a 'window of event', just keeping the last 1000 > points and move the xlim as a window: > ax.set_xlim(xmin=currentmin+time,xmax=currentmax+time) > but something sounds plain wrong, It sounds like there's too much > useless calculations and data copied. > > would it be a good idea to have an array of 1000 points and shift it > left every round to add the new point at the end? I think your best bet in this case is to just keep a python list of your 1000 points around: #Remove old point and add new one x_list.pop(0) x_list.append(x0) y_list.pop(0) y_list.append(y0) line.set_xdata(np.array(x_list)) line.set_ydata(np.array(y_list)) Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma
Ryan May wrote: > > > On Fri, Jul 3, 2009 at 8:32 AM, guillaume ranquet <gra...@wy... > <mailto:gra...@wy...>> wrote: > > Hi list, > > I'm trying to get a dynamic plot running. > I'm stuck at feeding the data to the lines. > > basically I've a callback that receives a (y,x1,x2) tuple and I would > like to add the 2 points to the two matplotlib.lines of the figure. > > should I handle a copy of xdata/ydata and gives the updated set to > set_x/ydata() for one point? > I tried to get_data() and append to it, but It's a MaskedArray and I > guess it means its a really bad idea to try this way. > > probably a new class inheriting figure and overriding > get_data()//set_data() could do the trick? > > > any advice on a _clean_ design I could use? > > > You can add a value to an array using np.concatenate: > > x,y = line.get_data() > x = np.concatenate((x, [x0])) > y = np.concatenate((y, [y0])) > line.set_data([x,y]) > > This is rather inefficient however if you're adding lots of points or if > there are just a lot of point in x any in general. If you know how many > points you're going to end up with, you could create mostly empty > MaskedArrays and keep the extra points masked until you get the data. > > Ryan > > -- > Ryan May > Graduate Research Assistant > School of Meteorology > University of Oklahoma thanks Ryan, It does work and I'll use that for now. the idea is to have a gkrellm-like UI in which you can monitor system usage 'live' I guess I could have a 'window of event', just keeping the last 1000 points and move the xlim as a window: ax.set_xlim(xmin=currentmin+time,xmax=currentmax+time) but something sounds plain wrong, It sounds like there's too much useless calculations and data copied. would it be a good idea to have an array of 1000 points and shift it left every round to add the new point at the end? ---- This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you. Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie. ----
On Fri, Jul 3, 2009 at 8:32 AM, guillaume ranquet <gra...@wy...>wrote: > Hi list, > > I'm trying to get a dynamic plot running. > I'm stuck at feeding the data to the lines. > > basically I've a callback that receives a (y,x1,x2) tuple and I would > like to add the 2 points to the two matplotlib.lines of the figure. > > should I handle a copy of xdata/ydata and gives the updated set to > set_x/ydata() for one point? > I tried to get_data() and append to it, but It's a MaskedArray and I > guess it means its a really bad idea to try this way. > > probably a new class inheriting figure and overriding > get_data()//set_data() could do the trick? > > > any advice on a _clean_ design I could use? > You can add a value to an array using np.concatenate: x,y = line.get_data() x = np.concatenate((x, [x0])) y = np.concatenate((y, [y0])) line.set_data([x,y]) This is rather inefficient however if you're adding lots of points or if there are just a lot of point in x any in general. If you know how many points you're going to end up with, you could create mostly empty MaskedArrays and keep the extra points masked until you get the data. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma
Hi list, I'm trying to get a dynamic plot running. I'm stuck at feeding the data to the lines. basically I've a callback that receives a (y,x1,x2) tuple and I would like to add the 2 points to the two matplotlib.lines of the figure. should I handle a copy of xdata/ydata and gives the updated set to set_x/ydata() for one point? I tried to get_data() and append to it, but It's a MaskedArray and I guess it means its a really bad idea to try this way. probably a new class inheriting figure and overriding get_data()//set_data() could do the trick? any advice on a _clean_ design I could use? thanks. ---- This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you. Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie. ----
Michael Droettboom schrieb: > This should now be fixed on the maintenance branch and trunk. A Numpy > array allocation was not being NULL-checked in _path.cpp:affine_transform. > > I know a MemoryError doesn't help the user much more than a segfault, > but it always makes me feel better to get a real Python exception rather > than exploding ;) > > Mike Hi All, thanks for the bugfix. I also got the segfault, but forgot to wrote this. Is there a possibility to limit the maximum points shown ? And sorry that i can not post more of my code. My program is to big. Maybe this is a feature request. :-) It would be nice to set up a maximum limit and compute a average. I doesnt know which way is the fastest. I only execute the plot command three times but every plot command plots round about 15 Mill. points. regards Markus
Hi, Please change plotnew to: def plotnew(self): #self.f.clf() # clear the figure self.t=arange(0.0,5.0,0.05) self.s1=sin(2*pi*self.t) self.s2=self.s1*-1 self.a.plot(self.t,self.s1,self.t,self.s2) self.canvas.show() I added self.canvas.show() This works for me. Gregor Skrt-2 wrote: > > 1. Where can I find a good tutorial or set of examples for > embeding matplotlib in Tkinter ? > 2. Problem: I created a simple test with Tkinter. First I plot my > graph on __init__ (it works ok). Then I want to clear graph and > plot on the same canvas with different parameters. The thing is > that plot shows up only when I resize my window. Any idea what > could I be doing wrong ? I was trying draw method but it doasn't > work... > > > Here is my code: > > Thanks for your help. Gregor Skrt > > > > > #!/usr/bin/env python > > import matplotlib > matplotlib.use('TkAgg') > > from numpy import arange, sin, pi , cos > from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, > NavigationToolbar2TkAgg > from matplotlib.figure import Figure > > from Tkinter import * > import sys > > class App: > def __init__(self,master): > frame = Frame(master) > frame.pack() > > self.button= > Button(frame,text='Quit',fg="black",command=frame.quit) > self.button.pack(side=LEFT) > > self.hi_there=Button(frame,text="Plot Inverse > sin",command=self.plotnew) > self.hi_there.pack(side=LEFT) > > # place a graph somewhere here > self.f = Figure(figsize=(5,4), dpi=100) > self.a = self.f.add_subplot(111) > self.t = arange(0.0,3.0,0.01) > self.s = sin(2*pi*self.t) > self.a.grid(True) > self.a.set_xlabel("cas [s]") > self.a.set_ylabel("amplituda") > self.a.plot(self.t,self.s) > > self.canvas = FigureCanvasTkAgg(self.f, master=root) > self.canvas.show() > self.canvas.get_tk_widget().pack(side=TOP, fill=BOTH, expand=1) > > def plotnew(self): > #get values from controller board, database > #self.f.clf() # clear the figure > self.t=arange(0.0,5.0,0.05) > self.s1=sin(2*pi*self.t) > self.s2=self.s1*-1 > self.a.plot(self.t,self.s1,self.t,self.s2) > > > root=Tk() > app=App(root) > root.mainloop() > > #!/usr/bin/env python > > import matplotlib > matplotlib.use('TkAgg') > > from numpy import arange, sin, pi , cos > from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, > NavigationToolbar2TkAgg > from matplotlib.figure import Figure > > from Tkinter import * > import sys > > class App: > def __init__(self,master): > frame = Frame(master) > frame.pack() > > self.button= Button(frame,text='Quit',fg="black",command=frame.quit) > self.button.pack(side=LEFT) > > self.hi_there=Button(frame,text="Plot Inverse sin",command=self.plotnew) > self.hi_there.pack(side=LEFT) > > # place a graph somewhere here > self.f = Figure(figsize=(5,4), dpi=100) > self.a = self.f.add_subplot(111) > self.t = arange(0.0,3.0,0.01) > self.s = sin(2*pi*self.t) > self.a.grid(True) > self.a.set_xlabel("cas [s]") > self.a.set_ylabel("amplituda") > self.a.plot(self.t,self.s) > > self.canvas = FigureCanvasTkAgg(self.f, master=root) > self.canvas.show() > self.canvas.get_tk_widget().pack(side=TOP, fill=BOTH, expand=1) > > def plotnew(self): > #self.f.clf() # clear the figure > self.t=arange(0.0,5.0,0.05) > self.s1=sin(2*pi*self.t) > self.s2=self.s1*-1 > self.a.plot(self.t,self.s1,self.t,self.s2) > > > root=Tk() > app=App(root) > root.mainloop() > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a 600ドル discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/Tkinter-problems-tp22164234p24318566.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Trying to plot anything with any dashed pattern causes the error: Python 2.6.2 (r262:71600, Jun 20 2009, 12:18:19) Type "copyright", "credits" or "license" for more information. IPython 0.9.1 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: from pylab import * matplotlib data path /Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/site-packages/matplotlib/mpl-data loaded rc file /Users/adam/.matplotlib/matplotlibrc matplotlib version 0.98.5.3 verbose.level helpful interactive is True units is True platform is darwin $HOME=/Users/adam CONFIGDIR=/Users/adam/.matplotlib Using fontManager instance from /Users/adam/.matplotlib/fontList.cache backend MacOSX version unknown In [2]: plot([0,1],'--') Out[2]: [<matplotlib.lines.Line2D object at 0x102a58490>] In [3]: Thu Jul 2 20:46:44 eta.colorado.edu Python-64[33793] <Error>: CGContextSetLineDash: invalid dash array: negative lengths are not allowed. On Thu, Jul 2, 2009 at 8:44 PM, Michiel de Hoon<mjl...@ya...> wrote: > >> I can't draw dashed lines. > > In principle, you should be able to draw dashed lines with the MacOSX backend. Can you post a complete script that triggers this error? > >> Thu Jul 2 14:51:48 Python-64[56094] <Error>: >> CGContextSetLineDash: invalid >> dash array: negative lengths are not allowed. > > --Michiel. > > > --- On Thu, 7/2/09, keflavich <kef...@gm...> wrote: > >> From: keflavich <kef...@gm...> >> Subject: Re: [Matplotlib-users] ipython threading fails with macosx backend >> To: mat...@li... >> Date: Thursday, July 2, 2009, 4:54 PM >> >> OK, thanks. I don't really know why it's failing, but >> I'm going to continue >> trying to get other backends installed to test them. >> >> I also now have independent reasons not to use the MacOSX >> backend: >> >> Thu Jul 2 14:51:48 Python-64[56094] <Error>: >> CGContextSetLineDash: invalid >> dash array: negative lengths are not allowed. >> >> >> >> I can't draw dashed lines. >> >> Adam >> -- >> View this message in context: http://www.nabble.com/ipython-threading-fails-with-macosx-backend-tp24311071p24313852.html >> Sent from the matplotlib - users mailing list archive at >> Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > > >
> I can't draw dashed lines. In principle, you should be able to draw dashed lines with the MacOSX backend. Can you post a complete script that triggers this error? > Thu Jul 2 14:51:48 Python-64[56094] <Error>: > CGContextSetLineDash: invalid > dash array: negative lengths are not allowed. --Michiel. --- On Thu, 7/2/09, keflavich <kef...@gm...> wrote: > From: keflavich <kef...@gm...> > Subject: Re: [Matplotlib-users] ipython threading fails with macosx backend > To: mat...@li... > Date: Thursday, July 2, 2009, 4:54 PM > > OK, thanks. I don't really know why it's failing, but > I'm going to continue > trying to get other backends installed to test them. > > I also now have independent reasons not to use the MacOSX > backend: > > Thu Jul 2 14:51:48 Python-64[56094] <Error>: > CGContextSetLineDash: invalid > dash array: negative lengths are not allowed. > > > > I can't draw dashed lines. > > Adam > -- > View this message in context: http://www.nabble.com/ipython-threading-fails-with-macosx-backend-tp24311071p24313852.html > Sent from the matplotlib - users mailing list archive at > Nabble.com. > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Massimo Di Stefano wrote: > Hi All, > > > i'm starting to learn matplotlib, > for my study i need to parse the nmea sentence from a gps > and plot a "sky graphic" to plot satellite visibility. > > (i tried to write code from scratch ... it works but my teacher > suggest me to not reinvent the well, so, to have a good nema parser, i > installed gpsd ... it has in the source code a nice python code that > allow me to retrieve satellite constallation iformation). > > now i need to learn how to produce a sky plot, > have you any suggestion on how to produce such kind of graphic ? > Massimo: I've no idea what a "sky plot" is. Can you point us to an example? -Jeff > thanks to all for any suggestion! > > Massimo. > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Oh, and I'm using the Agg backend, I think, whatever is the default. On Thu, Jul 2, 2009 at 7:19 PM, Rick Muller <rpm...@gm...> wrote: > JJ > > Thanks for the tips. I had seen one of those posts whilst googling around > for the bug, but discounted it because I'm not using an alpha value. > > Here are links to one of the cookbook examples, and one of the files that I > want to plot: > http://files.getdropbox.com/u/533499/griddata-test.png > http://files.getdropbox.com/u/533499/silicon_donor_10_newplot.png > > I'm using Mac OS 10.5.7, Python 2.6.2, and MPL 0.98.5.3. > > I don't know which bug in the thread you were referring to. I tried the > > >>> for c in CS.collections: c.set_edgecolor("none") > > fix, but it didn't have any effect. > > > On Thu, Jul 2, 2009 at 4:49 PM, Jae-Joon Lee <lee...@gm...> wrote: > >> The dropbox link is broken (you need a public url). >> What version of mpl and what backend are you using? >> >> There was a similar problem which has now been fixed. >> Try the work-around described in the thread below, and see if works. >> >> http://www.nabble.com/problems-with-contourf---alpha-td22553269.html >> >> >> Regards, >> >> -JJ >> >> >> >> On Thu, Jul 2, 2009 at 4:26 PM, Rick Muller<rpm...@gm...> wrote: >> > When I do contourf plots in matplotlib, I get lines connecting the >> contour >> > levels. This doesn't only appear to be an artifact of my plotting >> > algorithms, it appears in this example from the matplotlib cookbook: >> > >> > >> http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data >> > >> > at least on my mac. >> > >> > (I think this is the link to the output I get from that: >> > https://dl-web.getdropbox.com/get/Photos/griddata-test.png?w=007c9af9 >> > ) >> > >> > Is there a way to keep these lines from happening? If not, is there a >> way to >> > turn off all of the black lines separating the contour levels? >> > >> > Thanks in advance, >> > >> > Rick >> > >> > -- >> > Rick Muller >> > rpm...@gm... >> > >> > >> ------------------------------------------------------------------------------ >> > >> > _______________________________________________ >> > Matplotlib-users mailing list >> > Mat...@li... >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > >> > >> > > > > -- > Rick Muller > rpm...@gm... > -- Rick Muller rpm...@gm...
JJ Thanks for the tips. I had seen one of those posts whilst googling around for the bug, but discounted it because I'm not using an alpha value. Here are links to one of the cookbook examples, and one of the files that I want to plot: http://files.getdropbox.com/u/533499/griddata-test.png http://files.getdropbox.com/u/533499/silicon_donor_10_newplot.png I'm using Mac OS 10.5.7, Python 2.6.2, and MPL 0.98.5.3. I don't know which bug in the thread you were referring to. I tried the >>> for c in CS.collections: c.set_edgecolor("none") fix, but it didn't have any effect. On Thu, Jul 2, 2009 at 4:49 PM, Jae-Joon Lee <lee...@gm...> wrote: > The dropbox link is broken (you need a public url). > What version of mpl and what backend are you using? > > There was a similar problem which has now been fixed. > Try the work-around described in the thread below, and see if works. > > http://www.nabble.com/problems-with-contourf---alpha-td22553269.html > > > Regards, > > -JJ > > > > On Thu, Jul 2, 2009 at 4:26 PM, Rick Muller<rpm...@gm...> wrote: > > When I do contourf plots in matplotlib, I get lines connecting the > contour > > levels. This doesn't only appear to be an artifact of my plotting > > algorithms, it appears in this example from the matplotlib cookbook: > > > > > http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data > > > > at least on my mac. > > > > (I think this is the link to the output I get from that: > > https://dl-web.getdropbox.com/get/Photos/griddata-test.png?w=007c9af9 > > ) > > > > Is there a way to keep these lines from happening? If not, is there a way > to > > turn off all of the black lines separating the contour levels? > > > > Thanks in advance, > > > > Rick > > > > -- > > Rick Muller > > rpm...@gm... > > > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > -- Rick Muller rpm...@gm...
Hi All, i'm starting to learn matplotlib, for my study i need to parse the nmea sentence from a gps and plot a "sky graphic" to plot satellite visibility. (i tried to write code from scratch ... it works but my teacher suggest me to not reinvent the well, so, to have a good nema parser, i installed gpsd ... it has in the source code a nice python code that allow me to retrieve satellite constallation iformation). now i need to learn how to produce a sky plot, have you any suggestion on how to produce such kind of graphic ? thanks to all for any suggestion! Massimo.
sorry, i replied to Mike and not to the list. see below. On Thu, Jul 2, 2009 at 2:57 PM, Ralf Gommers <ral...@go...>wrote: > Thanks for looking into this Mike. > > On Thu, Jul 2, 2009 at 10:39 AM, Michael Droettboom <md...@st...>wrote: > >> It is not surprising that memory usage is much lower without printing the >> plot. Very little is actually done by the "plot" command other than setting >> up a tree of objects that is later rendered during the printing process >> (where most of the work happens). >> >> The attached script based on what you provided doesn't leak memory for me >> with matplotlib 0.98.5.2. It would appear that there is something else in >> your application triggering the leak. Perhaps there is something holding a >> reference longer than it should? >> > > Your attached script memleak2.py is indeed fine, it never takes up more > than 60Mb of RAM. But did you try to run the PyQt4 GUI I attached? There > the same save_png() function does increase memory usage for each call. > > I'm not sure how to exactly measure memory usage for a GUI program, but it > is so large I can look at "System Activity" (or Task Manager on XP) and get > the approximate number: > > Loading the GUI: 30.5Mb > 1st call to save_png: 82Mb > 2nd call: 116Mb > 10th call: 380Mb > > I can see the memory usage drop after some calls, so I guess it is a > problem of references being held and sometimes being released as you said. > But memory use does seem to be unbounded. Waiting for minutes, or > interacting with the GUI, never releases any memory. It is strange, the > PyQt4 demo program is fine by itself, save_png() is fine by itself, but > combine them and there's a memory problem. > > Cheers, > Ralf > > > >> You can see from the attached massif plots that memory usage never becomes >> unbounded. It is normal for Python to delay deallocation for efficiency >> reasons. Calling gc.collect (the second graph) does help keep memory usage >> more compact however, if that is a primary concern. >> >> Cheers, >> Mike >> >> Ralf Gommers wrote: >> >>> Hi, >>> >>> I am working on a PyQt4 application with some embedded MPL figures, and >>> am also trying to save some figures as png's without displaying them. I am >>> observing huge memory increases (10s or 100s of Mb) the moment I try to save >>> a png. I reproduced the issue by combining two mpl examples, >>> http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_qt4.htmland >>> http://matplotlib.sourceforge.net/examples/api/agg_oo.html. Full code is >>> attached. When pressing the "save figure" button, memory usage shoots up, >>> multiple clicks keep sending it higher (although not monotonically). >>> >>> I tested on two different platforms >>> - Matplotlib 98.5.2 and Python 2.6.2 on Ubuntu. >>> - latest Enthought Python Distribution on Windows XP. >>> >>> The function that does the png saving is: >>> >>> def save_png(): >>> """Save an image as a png file""" >>> >>> pngpath = 'test_mplsave.png' >>> >>> fig = Figure() >>> canvas = FigureCanvas(fig) >>> ax = fig.add_subplot(111) >>> x = arange(5e3) >>> ax.plot(x, sin(x)) >>> canvas.print_figure(pngpath) >>> >>> ## tried all things commented out below, all makes no difference ## >>> #fig.savefig(pngpath) >>> >>> #del(fig) >>> #del(canvas) >>> #del(ax) >>> >>> #import matplotlib.pyplot as plt >>> #plt.close(fig) >>> >>> #import gc >>> #gc.collect() >>> >>> Commenting out the canvas.print_figure line fixes the issue. >>> >>> Am I doing something obviously wrong, or mixing two incompatible ways of >>> doing things? >>> >>> Cheers, >>> Ralf >>> >>> ------------------------------------------------------------------------ >>> >>> >>> ------------------------------------------------------------------------------ >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >> >> -- >> Michael Droettboom >> Science Software Branch >> Operations and Engineering Division >> Space Telescope Science Institute >> Operated by AURA for NASA >> >> >> from matplotlib.backends.backend_agg import FigureCanvasAgg as >> FigureCanvas >> from matplotlib.figure import Figure >> >> from numpy import arange, sin >> >> import gc >> >> def save_png(): >> """Save an image as a png file""" >> >> pngpath = 'test_mplsave.png' >> >> fig = Figure() >> canvas = FigureCanvas(fig) >> ax = fig.add_subplot(111) >> x = arange(5e3) >> ax.plot(x, sin(x)) >> canvas.print_figure(pngpath) >> >> # The below is not necessary to prevent a leak, but it does make >> # memory usage more compact >> gc.collect() >> >> for i in range(100): >> save_png() >> >> >> >> >
Is this an ideas thread? How about a "copy image to clipboard" button for the toolbar. Gary R. Pierre GM wrote: > Eh, can I play ? > * Something I'd really like to see is a way to access a given patch/ > line/collection/... by a string (a name) instead of having to find the > corresponding element in a list. That would mean converting lists into > dictionaries, or at least provide a way to map the list to a dictionary. > An example of application would be "del lines['first']" to delete the > line named 'first'. By default, if no name is explicitly given to an > object, we could use the order in which it is drawn...
The dropbox link is broken (you need a public url). What version of mpl and what backend are you using? There was a similar problem which has now been fixed. Try the work-around described in the thread below, and see if works. http://www.nabble.com/problems-with-contourf---alpha-td22553269.html Regards, -JJ On Thu, Jul 2, 2009 at 4:26 PM, Rick Muller<rpm...@gm...> wrote: > When I do contourf plots in matplotlib, I get lines connecting the contour > levels. This doesn't only appear to be an artifact of my plotting > algorithms, it appears in this example from the matplotlib cookbook: > > http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data > > at least on my mac. > > (I think this is the link to the output I get from that: > https://dl-web.getdropbox.com/get/Photos/griddata-test.png?w=007c9af9 > ) > > Is there a way to keep these lines from happening? If not, is there a way to > turn off all of the black lines separating the contour levels? > > Thanks in advance, > > Rick > > -- > Rick Muller > rpm...@gm... > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
When I do contourf plots in matplotlib, I get lines connecting the contour levels. This doesn't only appear to be an artifact of my plotting algorithms, it appears in this example from the matplotlib cookbook: http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data at least on my mac. (I think this is the link to the output I get from that: https://dl-web.getdropbox.com/get/Photos/griddata-test.png?w=007c9af9 ) Is there a way to keep these lines from happening? If not, is there a way to turn off all of the black lines separating the contour levels? Thanks in advance, Rick -- Rick Muller rpm...@gm...
OK, thanks. I don't really know why it's failing, but I'm going to continue trying to get other backends installed to test them. I also now have independent reasons not to use the MacOSX backend: Thu Jul 2 14:51:48 Python-64[56094] <Error>: CGContextSetLineDash: invalid dash array: negative lengths are not allowed. I can't draw dashed lines. Adam -- View this message in context: http://www.nabble.com/ipython-threading-fails-with-macosx-backend-tp24311071p24313852.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hi, For a contour plot I use the option 'manual=True' in clabel to set the location of the labels manually. Before the plotting command I set some figure properties using rcParams as explained on this site: http://www.scipy.org/Cookbook/Matplotlib/LaTeX_Examples My Problem is, that the manual-option changes the figure properties and when I use savefig I get a very different result compared to 'manual=False'. Is there some way to prevent this or alternatively set the properties after manually setting the labels? Thanks in advance, Valentin Here is an example. ===================================== from math import pi import numpy as np import pylab as pl ####################### fig_width_pt = 246.0 # Get this from LaTeX using \showthe\columnwidth inches_per_pt = 1.0/72.27 # Convert pt to inch golden_mean = 1 #(sqrt(5)-1.0)/2.0 # Aesthetic ratio fig_width = fig_width_pt*inches_per_pt # width in inches fig_height =fig_width*golden_mean # height in inches fig_width = fig_width fig_size = [fig_width,fig_height] params = {'backend': 'ps', 'axes.labelsize': 10, 'text.fontsize': 10, 'legend.fontsize': 10, 'xtick.labelsize': 8, 'ytick.labelsize': 8, 'figure.figsize': fig_size} pl.rcParams.update(params) ax = pl.axes([0.15, 0.15, 0.8, 0.8]) dummy = np.linspace(0, 2*pi, 101) s, t = np.meshgrid(dummy, dummy) f = np.sin(2*s)**2* np.cos(t) cs = pl.contour(s, t, f) pl.clabel(cs, manual=True) pl.xlim(0, 2*pi) pl.ylim(0, 2*pi) pl.savefig('test.png') =====================================
On Thu, Jul 2, 2009 at 1:00 PM, Pierre GM<pgm...@gm...> wrote: > Eh, can I play ? > * Something I'd really like to see is a way to access a given patch/ > line/collection/... by a string (a name) instead of having to find the > corresponding element in a list. That would mean converting lists into > dictionaries, or at least provide a way to map the list to a dictionary. > An example of application would be "del lines['first']" to delete the > line named 'first'. By default, if no name is explicitly given to an > object, we could use the order in which it is drawn... > Take a look at findobj with an arbitrary match function (eg set the label property on the obj you want to find and then call find obj with a function that checks the label) http://matplotlib.sourceforge.net/examples/pylab_examples/findobj_demo.html
As I understand it the Mac backend uses the PyOS_ImputHook trick, which means that no custom threading code is needed in IPython. Thus it should "just work" without any threading flags in both IPython *and* regular python. Just as an aside, wx is the only GUI toolkit that doesn't support this "new" type of interactive usage. We (ipython devs) are working with the wx devs to change that. Once that is done, we should be able to get rid of all the nasty threading code in ipython. More details will follow. Cheers, Brian On Thu, Jul 2, 2009 at 10:48 AM, Michael Droettboom <md...@st...> wrote: > The Mac OS backend is fairly new, and I don't believe any of the > backend-specific threading code that ipython requires has been > implemented for the OS-X backend. Just wanted to drop a note to say > "it's probably not you". But as a non-Mac user, I may be wrong, and I > hope to be corrected :) > > Michiel: any idea how much effort would be involved here? > > Cheers, > Mike > > keflavich wrote: > > Hi, I'm using ipython 0.9.1 with the svn version of matplotlib on 64 bit > > python on mac os x 10.5.7. > > > > I have only been able to get python-64 running with the MacOSX backend; > all > > of the others (wxpython, gtk, qt, tk) have failed for one reason or > another. > > > > I've tried ipython without any flags and importing pylab on the command > > line: > > from pylab import * > > and ipython -pylab, > > and then plotting from a script. I retain access to the command line > unless > > I type "show()" at the command line, at which point I can't return to the > > command line unless I close all of my graphics windows. > > > > I don't have this problem when running 32 bit python with qt or tk as the > > backends. > > > > Is this an error? Should there be a command-line flag for ipython to > start > > threading for MacOSX specifically? > > > > Thanks, > > Adam > > > > -- > Michael Droettboom > Science Software Branch > Operations and Engineering Division > Space Telescope Science Institute > Operated by AURA for NASA > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
On my system, this example appears to be working just fine. I even bumped the number of data points from 1000 to 10,000. I'm on OS X 10.5.7 with: matplotlib 0.98.5.2 PyQt 4.5.1 (GPL) Qt 4.5 (LGPL) Maybe try updating your PyQt installation? BZ On Thu, Jul 2, 2009 at 6:46 AM, Ole Streicher <ole...@gm...>wrote: > Hello Darren, > > OK, in this context it seems to work. > > I attach a script that shows the problem. > > Run it, move the second diagram below the first, adjust their sizes so > that they take roughly the same size: > > +---------------+-------+ > | Diagram 1 | | > | | | > | | Hello | > +---------------+ World | > | Diagram 2 | | > | | | > | | | > +---------------+-------+ > > (you will see that the Diagram 2 will not alway update properly :-( [*] ) > and then move the slider between the diagrams and the "Hello World" > label. There is a good chance that the program will segfault. If it does > not, increase the number of points in the diagrams. > > BTW,could you reproduce my last example with diagram and scrollbar? It > still remains unsolved (and is reproduced here [*]). > > Versions (all 64 bit): > > openSUSE 11.1: > Qt Open Source Edition 4.4.3 > PyQt 4.4.3 > Matplotlib 0.98.5.2 > > Kubuntu 9.04: > Qt Open Source Edition 4.5.0 > PyQt 4.4.4 > Matplotlib 0.98.5.2 > > Best regards > > Ole >
Eh, can I play ? * Something I'd really like to see is a way to access a given patch/ line/collection/... by a string (a name) instead of having to find the corresponding element in a list. That would mean converting lists into dictionaries, or at least provide a way to map the list to a dictionary. An example of application would be "del lines['first']" to delete the line named 'first'. By default, if no name is explicitly given to an object, we could use the order in which it is drawn...
On Thu, Jul 2, 2009 at 9:46 AM, Ole Streicher <ole...@gm...>wrote: > Hello Darren, > > Darren Dale <dsd...@gm...> writes: > > I can't produce a segfault with the attached script. I have Qt-4.5.2, > > PyQt-4.5.1, and a checkout of the matplotlib trunk. > > OK, in this context it seems to work. > > I attach a script that shows the problem. > > Run it, move the second diagram below the first, adjust their sizes so > that they take roughly the same size: > > +---------------+-------+ > | Diagram 1 | | > | | | > | | Hello | > +---------------+ World | > | Diagram 2 | | > | | | > | | | > +---------------+-------+ > > (you will see that the Diagram 2 will not alway update properly :-( [*] ) > and then move the slider between the diagrams and the "Hello World" > label. There is a good chance that the program will segfault. If it does > not, increase the number of points in the diagrams. > I can't reproduce the problem. The diagrams update properly and I don't see a segfault. Maybe it is an issue that was fixed in Qt-4.5.[1,2] or PyQt-4.5.1. > BTW,could you reproduce my last example with diagram and scrollbar? It > still remains unsolved (and is reproduced here [*]). > Yes, I responded this afternoon and I have asked on the pyqt mailing list. Darren
The Mac OS backend is fairly new, and I don't believe any of the backend-specific threading code that ipython requires has been implemented for the OS-X backend. Just wanted to drop a note to say "it's probably not you". But as a non-Mac user, I may be wrong, and I hope to be corrected :) Michiel: any idea how much effort would be involved here? Cheers, Mike keflavich wrote: > Hi, I'm using ipython 0.9.1 with the svn version of matplotlib on 64 bit > python on mac os x 10.5.7. > > I have only been able to get python-64 running with the MacOSX backend; all > of the others (wxpython, gtk, qt, tk) have failed for one reason or another. > > I've tried ipython without any flags and importing pylab on the command > line: > from pylab import * > and ipython -pylab, > and then plotting from a script. I retain access to the command line unless > I type "show()" at the command line, at which point I can't return to the > command line unless I close all of my graphics windows. > > I don't have this problem when running 32 bit python with qt or tk as the > backends. > > Is this an error? Should there be a command-line flag for ipython to start > threading for MacOSX specifically? > > Thanks, > Adam > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA