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
(20) |
2
(16) |
3
(9) |
4
(12) |
5
(14) |
6
(22) |
7
(17) |
8
(33) |
9
(26) |
10
(32) |
11
(47) |
12
(26) |
13
(7) |
14
(24) |
15
(44) |
16
(42) |
17
(22) |
18
(31) |
19
(8) |
20
(4) |
21
(15) |
22
(27) |
23
(41) |
24
(33) |
25
(31) |
26
(24) |
27
(10) |
28
(20) |
|
|
|
|
|
|
One more note about Axes3D and mouse rotation. Axes3D disconnects the mouse callbacks when cla() is called. Which means that if you do this: self.axes = Axes3D(self.figure) self.axes.scatter(xs, ys, zs) self.axes.cla() self.axes.scatter(xs, ys, zs) then the plot will have no mouse rotation. To fix this, mouse_init() should be called after cla(). Currently, all of this is undocumented. Is disconnecting mouse callbacks on cla() the preferred matplotlib way to do things? Is it safe to *not* disconnect mouse callbacks on cla()? Maybe there is another type of destructor that is more appropriate for this? Thanks, -Ben -----Original Message----- From: Ben Axelrod [mailto:BAx...@co...] Sent: Saturday, February 06, 2010 5:55 PM To: mat...@li... Subject: Re: [Matplotlib-users] Axes3D rotation not working when embedded in backend I looked into this issue a little bit and found that the FigureCanvas must be set on the Figure before the 3D axes is instantiated. A simple re-ordering of the lines in the code below makes mouse rotation work again. # ... self.figure = Figure() self.canvas = FigureCanvas(self, -1, self.figure) #You must set up the canvas before creating the 3D axes self.axes = Axes3D(self.figure) # ... Perhaps this should be documented somehow? Or maybe a new mplot3d example code should be added. Or maybe Axes3D.mouse_init() should warn the user if self.figure.canvas is None. -Ben -----Original Message----- From: Ben Axelrod [mailto:BAx...@co...] Sent: Monday, February 01, 2010 3:56 PM To: mat...@li... Subject: [Matplotlib-users] Axes3D rotation not working when embedded in backend I would like to use Axes3D embedded in Wx. This works, but there is no mouse rotation. Clicking and dragging the mouse on the plot does not rotate the 3D axes like it does in the "scatter3d_demo.py". I tried: WX, WXAgg, and TkAgg with similar results. Can this be fixed soon, or can someone point me to where I can try to fix it? I tested with the latest SVN tree on Linux and Windows. Thanks, -Ben Below is some sample code adapted from "embedding_in_wx2.py", but with an Axes3D instead of the regular plot: #!/usr/bin/env python # adapted from example code "embedding_in_wx2.py" # Used to guarantee to use at least Wx2.8 import wxversion wxversion.ensureMinimal('2.8') import numpy as np import matplotlib # uncomment the following to use wx rather than wxagg #matplotlib.use('WX') #from matplotlib.backends.backend_wx import FigureCanvasWx as FigureCanvas # comment out the following to use wx rather than wxagg matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure from mpl_toolkits.mplot3d import Axes3D import wx class CanvasFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self,None,-1, 'CanvasFrame',size=(550,350)) self.SetBackgroundColour(wx.NamedColor("WHITE")) self.figure = Figure() self.axes = Axes3D(self.figure) xs = np.random.rand(100) ys = np.random.rand(100) zs = np.random.rand(100) self.axes.scatter(xs, ys, zs) self.canvas = FigureCanvas(self, -1, self.figure) self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW) self.SetSizer(self.sizer) self.Fit() self.add_toolbar() # comment this out for no toolbar def add_toolbar(self): self.toolbar = NavigationToolbar2Wx(self.canvas) self.toolbar.Realize() if wx.Platform == '__WXMAC__': # Mac platform (OSX 10.3, MacPython) does not seem to cope with # having a toolbar in a sizer. This work-around gets the buttons # back, but at the expense of having the toolbar at the top self.SetToolBar(self.toolbar) else: # On Windows platform, default window size is incorrect, so set # toolbar width to figure width. tw, th = self.toolbar.GetSizeTuple() fw, fh = self.canvas.GetSizeTuple() # By adding toolbar in sizer, we are able to put it at the bottom # of the frame - so appearance is closer to GTK version. # As noted above, doesn't work for Mac. self.toolbar.SetSize(wx.Size(fw, th)) self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND) # update the axes menu on the toolbar self.toolbar.update() def OnPaint(self, event): self.canvas.draw() class App(wx.App): def OnInit(self): 'Create the main window and insert the custom frame' frame = CanvasFrame() frame.Show(True) return True app = App(0) app.MainLoop() #end code ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Jeff Whitaker wrote: > > zxc wrote: >> Hi there! >> I need to know how to close a figure/chart in matplot. >> >> Does anyone know how it works and could you please explain on the >> example below? >> The problem is: close(1) doesn't close the figure 1 and when the 2nd >> figure will be plot the program hangs. >> I tried with draw() but the figure doesn't appear. > > Use fig.close() > >>> fig.close() Traceback (most recent call last): - - - AttributeError: 'Figure' object has no attribute 'close' I think you mean plt.close(). This seems to suspend IDLE, and activate the plot and console windows. To get back, I use "exit" in the console window. Try using the draw() command instead of show(). Sometimes you need to issue this command twice. If I ever get this figured out, I'll write a HOWTO note. -- View this message in context: http://old.nabble.com/How-to-close-a-plot--tp27490895p27501480.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Thanks, that worked perfectly. Best, Filipe On Mon, Feb 8, 2010 at 8:39 AM, Stephane Raynaud <ste...@gm... > wrote: > Hi Filipe, > > you can fist use the quiver() function in the classic way for stick plots, > then use gca().xaxis_date(). > > Here is a simple example : > > import pylab as P > # t may be generated using date2num() > t = P.arange(100,110,.1) > u = P.sin(t) > v = P.cos(t) > P.quiver([t],[[0]*len(t)],u,v) > P.gca().xaxis_date() > P.show() > > > On Sun, Feb 7, 2010 at 6:11 PM, Filipe Pires Alvarenga Fernandes < > oc...@gm...> wrote: > >> Hello list, >> >> I'm trying to create a stick-plot figure using the quiver function from >> matplotlib. However, I'm failing miserably to plot dates in the x-axis. Has >> anyone done this before? Also, is there an effort to create a stickplot >> function? >> >> Thanks, Filipe >> >> ***************************************************** >> Filipe Pires Alvarenga Fernandes >> >> University of Massachusetts Dartmouth >> 200 Mill Road - Fairhaven, MA >> Tel: (508) 910-6381 >> Email: fal...@um... >> oc...@ya... >> oc...@gm... >> >> http://ocefpaf.tiddlyspot.com/ >> ***************************************************** >> >> >> ------------------------------------------------------------------------------ >> The Planet: dedicated and managed hosting, cloud storage, colocation >> Stay online with enterprise data centers and the best network in the >> business >> Choose flexible plans and management services without long-term contracts >> Personal 24x7 support from experience hosting pros just a phone call away. >> http://p.sf.net/sfu/theplanet-com >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > > -- > Stephane Raynaud >
On 2/6/2010 2:35 PM, Wayne Watson wrote: > I'm not even sure if we are pro-pylab or pyplot as the preferred-style. It is somewhat personal preference: do you want access to NumPy and pyplot functions in a single name space or not. But the "preferred" style is the most explicit: http://matplotlib.sourceforge.net/faq/usage_faq.html Alan Isaac (just another user...)
<body bgcolor="#ffffff" background="https://img.web.de/v/p.gif" class="bgRepeatYes" style="background-repeat: repeat; ; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-size: 9pt; padding-left: 0px;" ><span style="font-size: 9pt;"><span style="font-family: verdana,geneva;"><span style="background-color: transparent;"><span style="color: #000000;"><span style="color: #000000;"> </span></span></span></span></span>Hello! <br /><br />I'm writing an application that will show different plots on it's GUI. In order to switch between the different plot types I'd like to destroy the first plot and to create a new afterwards. I stumbled into a memory leak since I don't know how to close matplotlib figures the clean way. <br /><br />I wrote a small test programm. Pressing the button 'create' creates a figure and 'delete' should destroy it. <br />Since the graph class is derived from the Tix.Frame class I would expect that destroying the Frame would also remove all matplot stuff. But when I do not implement my own destroy() method in the graph class, destroying the Frame shows absolutely no effect. The plot simply stays on the screen. <br />When I overload the Tix.Frame.destroy() method with my own implementation, as shown below, the plot disappears but not all memory is being released. When creating and deleting figures, the amount of memory python needs is constantly growing and python eventually crashes. <br /><br />I tried to find a solution on the internet but I found nothing really helpful so far. All examples I found just display something and then just exit. <br /><br />I appreciate any help! <br /><br />-------------- <br /><br />import matplotlib <br />matplotlib.use('TkAgg') <br /><br />from numpy import arange, sin, pi <br />from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg <br />from matplotlib.figure import Figure <br /><br /><br />import Tix <br />import sys <br /><br />def destroy(e): sys.exit() <br /><br />root = Tix.Tk() <br /><br /><br />class graph(Tix.Frame): <br /> def __init__(self, master, **kw): <br /> Tix.Frame.__init__(self, master, **kw) <br /><br /> self.f = Figure(figsize=(5,4), dpi=100) <br /> self.a = self.f.add_subplot(111) <br /> t = arange(0.0,3.0,0.01) <br /> s = sin(2*pi*t) <br /> self.a.plot(t,s) <br /><br /> self.canvas = FigureCanvasTkAgg(self.f, master=self.master) <br /> self.canvas.show() <br /> self.canvas.get_tk_widget().pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) <br /><br /> self.toolbar = NavigationToolbar2TkAgg(self.canvas, root ) <br /> self.toolbar.update() <br /> self.canvas._tkcanvas.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) <br /> <br /> def destroy(self): <br /> Tix.Frame.destroy(self) <br /> self.toolbar.destroy() <br /> self.canvas._tkcanvas.destroy() <br /> <br /> <br />class ui(Tix.Frame): <br /> <br /> g = None <br /> <br /> def __init__(self, master, **kw): <br /> Tix.Frame.__init__(self, master, **kw) <br /> <br /> self.b = Tix.Button(self, text='create', command=self.create) <br /> self.b.pack() <br /> <br /> self.b2 = Tix.Button(self, text='delete', command=self.delete) <br /> self.b2.pack() <br /><br /> def delete(self): <br /> try: <br /> self.g.destroy() <br /> except: <br /> pass <br /> <br /> def create(self): <br /> self.delete() <br /> self.g = graph(root) <br /> <br /> <br />ui(root).pack() <br />root.mainloop() <br><br><table cellpadding="0" cellspacing="0" border="0"><tr><td bgcolor="#000000"><img src="https://img.web.de/p.gif" width="1" height="1" border="0" alt="" /></td></tr><tr><td style="font-family:verdana; font-size:12px; line-height:17px;">GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT! <br>Jetzt freischalten unter http://movieflat.web.de</td></tr></table> </body>
axes_grid uses a custome axes class. See http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#axisline For more details, see http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/axislines.html To make ticklabel visible, you may do grid.axes_all[1].axis["bottom"].major_ticklabels.set_visible(True) However, AxesGrid takes an *ngrids* parameter which controls the number of grids. So, in your example, f = plt.figure() grid = axes_grid.AxesGrid(f, 111, nrows_ncols=(2,2), ngrids=3) (no manual adding of grids. also top-right axes will have x-ticklabels by default). Regards, -JJ On Mon, Feb 8, 2010 at 7:09 AM, Ernest Adrogué <ead...@gm...> wrote: > Hi, > > I have an AxesGrid instance of 2x2 subplots. I actually only > want 3 subplots, so I instantiate AxesGrid with the add_all=False > option, and manually add only the first 3 axes to the figure: > > import matplotlib as plt > from mpl_toolkits import axes_grid > > f = plt.figure() > grid = axes_grid.AxesGrid(f, 111, nrows_ncols=(2,2), add_all=False) > f.add_axes(grid.axes_all[0]) > f.add_axes(grid.axes_all[1]) > f.add_axes(grid.axes_all[2]) > > > Now, the problem seems to be that the top right subplot doesn't > have visible labels on the x axis, and I can't figure out how to > add them. Any idea of how it can be done?? > > Thanks. > > Ernest > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hi Filipe, you can fist use the quiver() function in the classic way for stick plots, then use gca().xaxis_date(). Here is a simple example : import pylab as P # t may be generated using date2num() t = P.arange(100,110,.1) u = P.sin(t) v = P.cos(t) P.quiver([t],[[0]*len(t)],u,v) P.gca().xaxis_date() P.show() On Sun, Feb 7, 2010 at 6:11 PM, Filipe Pires Alvarenga Fernandes < oc...@gm...> wrote: > Hello list, > > I'm trying to create a stick-plot figure using the quiver function from > matplotlib. However, I'm failing miserably to plot dates in the x-axis. Has > anyone done this before? Also, is there an effort to create a stickplot > function? > > Thanks, Filipe > > ***************************************************** > Filipe Pires Alvarenga Fernandes > > University of Massachusetts Dartmouth > 200 Mill Road - Fairhaven, MA > Tel: (508) 910-6381 > Email: fal...@um... > oc...@ya... > oc...@gm... > > http://ocefpaf.tiddlyspot.com/ > ***************************************************** > > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the > business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- Stephane Raynaud
Hi, I have an AxesGrid instance of 2x2 subplots. I actually only want 3 subplots, so I instantiate AxesGrid with the add_all=False option, and manually add only the first 3 axes to the figure: import matplotlib as plt from mpl_toolkits import axes_grid f = plt.figure() grid = axes_grid.AxesGrid(f, 111, nrows_ncols=(2,2), add_all=False) f.add_axes(grid.axes_all[0]) f.add_axes(grid.axes_all[1]) f.add_axes(grid.axes_all[2]) Now, the problem seems to be that the top right subplot doesn't have visible labels on the x axis, and I can't figure out how to add them. Any idea of how it can be done?? Thanks. Ernest
Hello, When I save the figure as EPS, no text shows up. The problem occurs with the example "embedding_in_wx2.py" and when I use MSWord to show the eps file. Is it a problem with MSWord ?? Thanks by advance. Cédrick
Hi, I am searching for a solution of the axis aspect in 3d plots, too. On 10/14/2009 14:01, Tinne De Laet wrote: > > axis("scaled") > worked for me. > > Tinne This does not seem to work. At least I am not getting it to work. This command does not seem to be applied to the 3d axis. Do you have an example where this works on 3d axis? Regards Paul.
On 02/04/2010 02:02 AM, Sourav K. Mandal wrote: > On Wed, 2010年02月03日 at 22:04 -0800, Michael Cohen wrote: > >>> One of the most persistent problems I have with matplotlib is finding >>> out which kwargs and args are available for some commands. >>> For instance, I am looking at manipulating axis ticks and labels in >>> mplot3d, so I went to the mplot3d api page, and looked for useful >>> commands and found: >>> >>> set_xlabel(xlabel, fontdict=None, **kwargs)¶ >>> Set xlabel. >>> >>> set_xlim3d(*args, **kwargs)¶ >>> Set 3D x limits. >>> >>> However, there is no information that I can find about "args" and >>> "kwargs" that I can use to figure out how to make my changes. > > Don't these unbound methods just take the same arguments as the bound > methods "xlabels" and "xlim", as given in > > http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.xlabel > > and > > http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.xlim > > ? > Ok, then I guess I am still not seeing how to accomplish what I'm looking to do. I have a yaxis which has ticks every 0.2, and I need it to be every 0.4. which function do I use to change that? Can I use that function to change the font size of the tick labels? It turns out there's an (undocumented) function called set_xticks in the mplot3d api (I deduced its existence from the existence of xticks in pyplot) but I'm not sure how to work it. I thought it would set the values to place the tickmarks at, so I tried: ax.set_xticks([-0.4,0.0,0.4,0.8]) but that just squashed up the plot. I also need to move the labels around on the 3d plot so they can be clearly seen in the figure. How can I tell the axis label where to be in reference to the axis itself? Cheers Michael
I'm pretty sure your problem is not generally related to matplotlib, all the examples you mentioned and the one you sent me by e-mail worked for me. Maybe you try a different version or a different operating system for your scripts.
In the second case, after x, nothing really happened. The program resecuted the def it was in. On 2/7/2010 7:19 PM, Wayne Watson wrote: > Well, that didn't quite work. > > I tried > ... > fig=figure() > ... > fig.close() > show() > > and > show() > fig.close() > > In the first case, I got the error msg: > > On 2/7/2010 7:15 PM, Wayne Watson wrote: Figure has no attribute close > >> Thanks. It seems most example of matplotlib end with show(). In fact, >> all may end that way, at least the short ones. >> >> On 2/7/2010 1:50 PM, Jeff Whitaker wrote: >> >> >>>> I need to know how to close a figure/chart in matplolib. >>>> >>>> >>> >>> >> >> > -- My life in two words. "Interrupted Projects." -- WTW (quote originator)
Well, that didn't quite work. I tried ... fig=figure() ... fig.close() show() and show() fig.close() In the first case, I got the error msg: On 2/7/2010 7:15 PM, Wayne Watson wrote: Figure has no attribute close > Thanks. It seems most example of matplotlib end with show(). In fact, > all may end that way, at least the short ones. > > On 2/7/2010 1:50 PM, Jeff Whitaker wrote: > >>> I need to know how to close a figure/chart in matplolib. >>> >> > -- My life in two words. "Interrupted Projects." -- WTW (quote originator)
Thanks. It seems most example of matplotlib end with show(). In fact, all may end that way, at least the short ones. On 2/7/2010 1:50 PM, Jeff Whitaker wrote: > > I need to know how to close a figure/chart in matplolib. > -- My life in two words. "Interrupted Projects." -- WTW (quote originator)
Yes, that did it. Thanks. Some of that code I copied from an example, the ax1 part. I guess it's related to subplot. The 1 on ax doesn't make much sense to me. Maybe there was an ax2 in the original, so there were two subplots. So it looks like to manipulate the subplot, one uses ax1 with calls to color the end of lines, or changes the line to dashes? Maybe labels and titles? Although that may be the way pyplot works. On 2/7/2010 3:24 PM, Jae-Joon Lee wrote: > try > > ax1.axis(v) > > -JJ > > > On Sun, Feb 7, 2010 at 5:16 PM, Wayne Watson > <sie...@sb...> wrote: > >> The segment below is supposed to plot two columns of (x,y) data and do >> it in an area 640x480. Apparently, I'm missing how to use v to get this >> done. It dies at col.axis(v) with list object has no attribute 'axis'. >> From looking at some MPL examples, it's not clear to me how one uses >> axis here. I might have needed axes, but that doesn't work either. >> Comments? >> >> >> ... >> trk_stats = (amin, amax, mean, std, per_tile25, per_tile50, >> per_tile75) >> fig = figure() >> ax1 = fig.add_subplot(111) >> v = (0, 640, 0, 480) >> print "shapes: ", xy[:,0].shape, xy[:,1].shape >> col = ax1.plot(xy[:,0], xy[:,1]) >> col.axis(v) >> show() >> print "something for wtw plot" >> print >> return trk_stats >> >> >> >> >> ------------------------------------------------------------------------------ >> The Planet: dedicated and managed hosting, cloud storage, colocation >> Stay online with enterprise data centers and the best network in the business >> Choose flexible plans and management services without long-term contracts >> Personal 24x7 support from experience hosting pros just a phone call away. >> http://p.sf.net/sfu/theplanet-com >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > -- My life in two words. "Interrupted Projects." -- WTW (quote originator)
try ax1.axis(v) -JJ On Sun, Feb 7, 2010 at 5:16 PM, Wayne Watson <sie...@sb...> wrote: > The segment below is supposed to plot two columns of (x,y) data and do > it in an area 640x480. Apparently, I'm missing how to use v to get this > done. It dies at col.axis(v) with list object has no attribute 'axis'. > From looking at some MPL examples, it's not clear to me how one uses > axis here. I might have needed axes, but that doesn't work either. > Comments? > > > ... > trk_stats = (amin, amax, mean, std, per_tile25, per_tile50, > per_tile75) > fig = figure() > ax1 = fig.add_subplot(111) > v = (0, 640, 0, 480) > print "shapes: ", xy[:,0].shape, xy[:,1].shape > col = ax1.plot(xy[:,0], xy[:,1]) > col.axis(v) > show() > print "something for wtw plot" > print > return trk_stats > > > > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Thanks. It seems most example of matplotlib end with show(). In fact, all may end that way, at least the short ones. On 2/7/2010 1:50 PM, Jeff Whitaker wrote: > > I need to know how to close a figure/chart in matplot. > -- My life in two words. "Interrupted Projects." -- WTW (quote originator)
The segment below is supposed to plot two columns of (x,y) data and do it in an area 640x480. Apparently, I'm missing how to use v to get this done. It dies at col.axis(v) with list object has no attribute 'axis'. From looking at some MPL examples, it's not clear to me how one uses axis here. I might have needed axes, but that doesn't work either. Comments? ... trk_stats = (amin, amax, mean, std, per_tile25, per_tile50, per_tile75) fig = figure() ax1 = fig.add_subplot(111) v = (0, 640, 0, 480) print "shapes: ", xy[:,0].shape, xy[:,1].shape col = ax1.plot(xy[:,0], xy[:,1]) col.axis(v) show() print "something for wtw plot" print return trk_stats
zxc wrote: > Hi there! > I need to know how to close a figure/chart in matplot. > > Does anyone know how it works and could you please explain on the > example below? > The problem is: close(1) doesn't close the figure 1 and when the 2nd > figure will be plot the program hangs. > I tried with draw() but the figure doesn't appear. Use fig.close() -Jeff
Note the show() on the last line below. If I run this program from IDLE, it displays the graph, and sits there. I would like to finish, by getting to an active shell script. If I close the figure using x in the upper right, it disappears. Now two windows are seen. The code and script window. The script window is not active. I can't enter anything into it. The cursor is below the >>>. Ctrl-C doesn't work. If I use the x in the upper corner, eventually the script window disappears. How do I just return to the script? There ought to be a smooth way to do this by putting something after show(). import matplotlib matplotlib.use('Agg') from pylab import figure, show import numpy as np # make an agg figure fig = figure() ax = fig.add_subplot(111) ax.plot([1,2,3]) ax.set_title('a simple figure') fig.canvas.draw() show() -- My life in two words. "Interrupted Projects." -- WTW (quote originator)
It's is simple as pie. Put three points on a sheet of paper. Draw a line with an arrow on it from any point to another. Draw a line from the last point to the third the same way. The method I described will work fine. I can do this. No need for you to attach arrows to what you've done. I think this is really wrapped up. On 2/7/2010 9:54 AM, Alan G Isaac wrote: > Wayne Watson wrote: > >> The cumsum (summation) buffaloes me. >> > That is just to create some artificial data, > to illustrate. If you have the coordinates > in a 2 by N array named `locs`, just use the > last 2 lines. If you already have the > coordinates separated into arrays x and y, > just use the last line, i.e., plt.plot(x,y). > Is that what you want? > > hth, > Alan > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- My life in two words. "Interrupted Projects." -- WTW (quote originator)
Filipe Pires Alvarenga Fernandes wrote: > Hello list, > > I'm trying to create a stick-plot figure using the quiver function from > matplotlib. However, I'm failing miserably to plot dates in the x-axis. > Has anyone done this before? Also, is there an effort to create a > stickplot function? I need to add units support to quiver so that it will recognize dates. I will do that shortly. Please give an example showing what you want as a "stickplot". What should be the capabilities of such a function? Does it differ from quiver only in plotting line segments rather than arrows? Eric > > Thanks, Filipe > > ***************************************************** > Filipe Pires Alvarenga Fernandes > > University of Massachusetts Dartmouth > 200 Mill Road - Fairhaven, MA > Tel: (508) 910-6381 > Email: fal...@um... > <mailto:fal...@um...> > oc...@ya... <mailto:oc...@ya...> > oc...@gm... <mailto:oc...@gm...> > > http://ocefpaf.tiddlyspot.com/ > ***************************************************** > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Hi there! I need to know how to close a figure/chart in matplot. Does anyone know how it works and could you please explain on the example below? The problem is: close(1) doesn't close the figure 1 and when the 2nd figure will be plot the program hangs. I tried with draw() but the figure doesn't appear. Thanks! John import matplotlib.pyplot as plt import time fig = plt.figure(1) ax = fig.add_subplot(111) ax.plot((1, 3, 1)) plt.show() time.sleep(10) plt.close(1) fig = plt.figure(2) ax = fig.add_subplot(111) ax.plot((4, 1, 0)) plt.show()
Wayne Watson wrote: > The cumsum (summation) buffaloes me. That is just to create some artificial data, to illustrate. If you have the coordinates in a 2 by N array named `locs`, just use the last 2 lines. If you already have the coordinates separated into arrays x and y, just use the last line, i.e., plt.plot(x,y). Is that what you want? hth, Alan