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
|
From: Stephen W. <ste...@cs...> - 2005-04-15 17:01:53
|
Jochen Voss wrote: >Last I checked the PostScript backend used only PostScript level 2. > > What I really meant was that the PostScript file produced by MPL starts with '%!PS-Adobe-3.0', which I thought meant Postscript level 3. Changing the 3.0 to 2.0 by hand still doesn't allow it to print. dvips output files print fine on this printer, and they start with '%!PS-Adobe-2.0'. >You could try to produce a standalone .ps file instead of an >.eps file. Maybe this works better? > > Thanks for the suggestion, but I'm afraid this didn't help. The workaround I found was to do a dvipdf on the LaTeX file which included the MPL doc, read it with Acrobat Reader, and tell acroread to print it at Postscript level 1. Normally acroread can print at level 2 to this printer, but asking acroread to print at level 3 gets an error page from the printer telling you to use level 2. Best, Steve |
From: Wendell C. <wcr...@uf...> - 2005-04-15 16:21:17
|
'''Hi, I use the following program in a simulation class to demonstrate the niftyness of matplotlib. The combination of Python, Numeric, and matplotlib really makes a great set of tools for biologists who are largely non-programmers these days. Thanks. I just did a big upgrade from 0.6-before pylab to 0.80. This is the only tested program that didn't produce the same results before and after: Attached are matlab and pylab png files. Is there another way of doing this that gets back to the original output? Also, is it just my imagination, or does 0.8 take longer to display graphs than previous versions. I haven't done any formal timing, but the delay seems longer. Thanks, Wendell Cropper ''' from pylab import * r = 0.1 g = 0.002 h = 0.0002 m = 0.2 def derivs(x, t): d1dt = r* x[0] - g * x[0] * x[1] # host d2dt = h * x[0] * x[1] - m * x[1] #parasite return (d1dt, d2dt) dt = 0.01 #delta t tim = arange(0.0, 125.0, dt) x0 = (1500.0, 50.0) #initial numbers of host, parasite xint = rk4(derivs, x0, tim) #Runge-Kutta 4th order numerical integration #print xint[0] #print xint[1] host, parasite = [[x[0] for x in xint], [x[1] for x in xint]] #extract variables figure(1, [11.0, 11.0]) #size of window ax1 = subplot(211) title('Host-Parasite using MatPlotLib') L1 = plot(tim, host, 'b', linewidth=2) plot ([0.0, 0.1], [500.0, 510.0], 'w') ax1.yaxis.tick_left() ylabel('Host Numbers') ax2 = subplot(211, frameon = False) ax2.yaxis.tick_right() text (145.0, 47.0, 'Parasite Numbers', rotation = 'vertical') xlabel('time') L2 = plot(tim, parasite, 'r--', linewidth=2) plot ([0.0, 0.1], [90.0, 100.0], 'w') legend((L1, L2), ('H', 'P')) subplot(212) plot(parasite, host, 'g') axis([20.0, 100.0, 500.0, 1600.0]) #min x, max x, min y, max y xlabel('Parasite Numbers') ylabel('Host Numbers') text (45.0, 1200.0, 'Phase Plane Plot', fontsize = 16) show() |
From: Matt N. <new...@ca...> - 2005-04-15 15:44:03
|
Hi Werner, I think what you may want is something like this: def OnButton1Button(self, event): print 'done it' ### self.figure.clear() ### self.axes = self.figure.add_subplot(111) self.axes.cla() # <-- clear the axes t = arange(0.0,4.0,0.01) s = sin(2*pi*t) self.axes.plot(t,s) self.axes.set_xlabel('Time 2 (s)') self.axes.set_ylabel('Price 2 ($)') self.canvas.draw() # <-- force a redraw Is that OK? It works for me on Windows and Linux. I do the same thing for 'make a fresh plot' in my own codes that I know work OK on Mac OS X as well. Cheers, --Matt |
From: Werner F. B. <wer...@fr...> - 2005-04-15 14:47:17
|
#!/usr/bin/env python """ Show how to have wx draw a cursor over an axes that moves with the mouse and reports the data coords """ from matplotlib.numerix import arange, sin, pi import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure 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(frameon=False) self.axes = self.figure.add_subplot(111) t = arange(0.0,3.0,0.01) s = sin(2*pi*t) self.axes.plot(t,s) self.axes.set_xlabel('Time (s)') self.axes.set_ylabel('Price ($)') self.canvas = FigureCanvas(self, -1, self.figure) self.canvas.mpl_connect('motion_notify_event', self.mouse_move) self.sizer =wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW) buttonId = wx.NewId() self.button1 = wx.Button(id=buttonId, label='Clear and do figure again', parent=self) self.button1.Bind(wx.EVT_BUTTON, self.OnButton1Button, id=buttonId) self.sizer.Add(self.button1, 0, wx.LEFT | wx.TOP) self.SetSizer(self.sizer) self.Fit() self.statusBar =wx.StatusBar(self, -1) self.statusBar.SetFieldsCount(1) self.SetStatusBar(self.statusBar) self.add_toolbar() # comment this out for no toolbar if wx.VERSION_STRING >= '2.5': self.Bind(wx.EVT_PAINT, self.OnPaint) else: wx.EVT_PAINT(self, self.OnPaint) self.cnt = 0 def OnButton1Button(self, event): if self.cnt == 0: self.figure.clear() self.axes = self.figure.add_subplot(111) t = arange(0.0,4.0,0.01) s = sin(2*pi*t*(self.cnt+1)) self.axes.plot(t,s) self.axes.set_xlabel('Time 2 (s)') self.axes.set_ylabel('Price 2 ($)') if self.cnt == 2: self.figure.clear() self.axes = self.figure.add_subplot(111) t = arange(0.0,3.0,0.01) s = sin(2*pi*t*(self.cnt+1)) self.axes.plot(t,s) self.axes.set_xlabel('Time 3 (s)') self.axes.set_ylabel('Price 3 ($)') if self.cnt > 2: self.figure.clear() self.axes = self.figure.add_subplot(111) t = arange(0.0,2.0,0.01) s = sin(2*pi*t*(self.cnt+1)) self.axes.plot(t,s) self.axes.set_xlabel('Time 4 (s)') self.axes.set_ylabel('Price 4 ($)') self.cnt+=1 self.canvas.Refresh() def mouse_move(self, event): self.draw_cursor(event) def add_toolbar(self): self.toolbar = NavigationToolbar2Wx(self.canvas) self.toolbar.Realize() tw, th = self.toolbar.GetSizeTuple() fw, fh = self.canvas.GetSizeTuple() 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.erase_cursor() try: del self.lastInfo except AttributeError: pass self.canvas.draw() event.Skip() def draw_cursor(self, event): 'event is a MplEvent. Draw a cursor over the axes' if event.inaxes is None: self.erase_cursor() try: del self.lastInfo except AttributeError: pass return canvas = self.canvas figheight = canvas.figure.bbox.height() ax = event.inaxes left,bottom,width,height = ax.bbox.get_bounds() bottom = figheight-bottom top = bottom - height right = left + width x, y = event.x, event.y y = figheight-y dc =wx.ClientDC(canvas) dc.SetLogicalFunction(wx.XOR) wbrush =wx.Brush(wx.Colour(255,255,255), wx.TRANSPARENT) wpen =wx.Pen(wx.Colour(200, 200, 200), 1, wx.SOLID) dc.SetBrush(wbrush) dc.SetPen(wpen) dc.ResetBoundingBox() dc.BeginDrawing() x, y, left, right, bottom, top = [int(val) for val in x, y, left, right, bottom, top] self.erase_cursor() line1 = (x, bottom, x, top) line2 = (left, y, right, y) self.lastInfo = line1, line2, ax, dc dc.DrawLine(*line1) # draw new dc.DrawLine(*line2) # draw new dc.EndDrawing() time, price = event.xdata, event.ydata self.statusBar.SetStatusText("Time=%f Price=%f"% (time, price), 0) def erase_cursor(self): try: lastline1, lastline2, lastax, lastdc = self.lastInfo except AttributeError: pass else: lastdc.DrawLine(*lastline1) # erase old lastdc.DrawLine(*lastline2) # erase old 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() |
From: John H. <jdh...@ac...> - 2005-04-15 14:27:32
|
>>>>> "John" == John Hunter <jdh...@ac...> writes: John> matplotlib does cache some information, mainly text and font John> stuff) between draws which can cause memory to grow, but John> usually this is a small amount. I'll explore further. I wrote a little GUI neutral script to expose the same functionality. This helps test whether the problem is backend specific or not. If you click anywhere in the axes, the sine wave updates. I see the same effect: changing the sine wave frequency causes memory usage to increase with each draw, but only for the first 50 or so draws. This appears to be an agg thing, since I see it on GTKAgg, TkAgg, WXAgg but not GTK or WX. However, I don't believe it is a memory leak. Agg may be caching some path or stroke information, because as I say the memory only seems to increase when the path is changed. However, after 50 or so draws, the increase stops, so it does not appear to be a memory leak. I often see these kinds of effects when debugging memory leaks, and typically discard the first 30-50 draws before assessing whether there is a leak or not. Here's the backend neutral script I am using, you can run it with -dWXAgg, -dWX, -dGTKAgg etc to test various backends. Note that I also explicitly clear the text cache with Text.cached = {} JDH #!/usr/bin/env python import os, sys, time, gc from matplotlib.text import Text from pylab import * def report_memory(i): pid = os.getpid() a2 = os.popen('ps -p %d -o rss,sz' % pid).readlines() print i, ' ', a2[1], return int(a2[1].split()[1]) fig = figure() ax = fig.add_subplot(111) t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) ax.plot(t,s) def click(event): fig.clear() s = sin(2*pi*t*(click.cnt+1)) ax = fig.add_subplot(111) ax.plot(t,s) gc.collect() Text.cached = {} report_memory(click.cnt) fig.canvas.draw() click.cnt += 1 click.cnt = 1 #connect('motion_notify_event', report) connect('button_press_event', click) show() |
From: John H. <jdh...@ac...> - 2005-04-15 13:50:50
|
>>>>> "Werner" == Werner F Bruhin <wer...@fr...> writes: Werner> Hi All, I put a small test case together based on Werner> wxcursor_demo. When clicking the button1 it should show a Werner> new plot, but it does not. It does for me... Do you mean a new plot window, or just redraw in the current figure? You may not see that it has redrawn the figure unless you somehow change the plot (ed pan/zoom). I modified your example so that each time you redraw the frequency of the sine wave changes to make it more apparent. Werner> I think my memory issue has to do with this as I created a Werner> new self.canvas each time, instead of doing a clear, but Werner> the big question is what do I need to call to show the new Werner> plot. For one thing, add a gc.collect after you call clear to trigger the garbage collector. I added a memory report function and noticed something surprising. If I just plotted the same sine wave over and over, memory usage was flat. If I changed the sine wave frequency (still creating arrays of the same size though) memory usage increased with each plot. matplotlib does cache some information, mainly text and font stuff) between draws which can cause memory to grow, but usually this is a small amount. I'll explore further. Here is my lightly modified version of your test script. The report_memory function only works on unix like systems. JDH #!/usr/bin/env python """ Show how to have wx draw a cursor over an axes that moves with the mouse and reports the data coords """ from matplotlib.numerix import arange, sin, pi import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure import wx import os, sys, time, gc def report_memory(i): pid = os.getpid() a2 = os.popen('ps -p %d -o rss,sz' % pid).readlines() print i, ' ', a2[1], return int(a2[1].split()[1]) 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 = self.figure.add_subplot(111) t = arange(0.0,3.0,0.01) s = sin(2*pi*t) self.axes.plot(t,s) self.axes.set_xlabel('Time (s)') self.axes.set_ylabel('Price ($)') self.canvas = FigureCanvas(self, -1, self.figure) self.canvas.mpl_connect('motion_notify_event', self.mouse_move) self.sizer =wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW) buttonId = wx.NewId() self.button1 = wx.Button(id=buttonId, label='Clear and do figure again', parent=self) self.button1.Bind(wx.EVT_BUTTON, self.OnButton1Button, id=buttonId) self.sizer.Add(self.button1, 0, wx.LEFT | wx.TOP) self.SetSizer(self.sizer) self.Fit() self.statusBar =wx.StatusBar(self, -1) self.statusBar.SetFieldsCount(1) self.SetStatusBar(self.statusBar) self.add_toolbar() # comment this out for no toolbar if wx.VERSION_STRING >= '2.5': self.Bind(wx.EVT_PAINT, self.OnPaint) else: wx.EVT_PAINT(self, self.OnPaint) self.cnt = 0 def OnButton1Button(self, event): print 'done it' self.figure.clear() self.axes = self.figure.add_subplot(111) t = arange(0.0,4.0,0.01) s = sin(2*pi*t*(self.cnt+1)) #s = sin(2*pi*t) self.axes.plot(t,s) self.axes.set_xlabel('Time 2 (s)') self.axes.set_ylabel('Price 2 ($)') report_memory(self.cnt) self.cnt+=1 gc.collect() def mouse_move(self, event): self.draw_cursor(event) def add_toolbar(self): self.toolbar = NavigationToolbar2Wx(self.canvas) self.toolbar.Realize() tw, th = self.toolbar.GetSizeTuple() fw, fh = self.canvas.GetSizeTuple() 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.erase_cursor() try: del self.lastInfo except AttributeError: pass self.canvas.draw() event.Skip() def draw_cursor(self, event): 'event is a MplEvent. Draw a cursor over the axes' if event.inaxes is None: self.erase_cursor() try: del self.lastInfo except AttributeError: pass return canvas = self.canvas figheight = canvas.figure.bbox.height() ax = event.inaxes left,bottom,width,height = ax.bbox.get_bounds() bottom = figheight-bottom top = bottom - height right = left + width x, y = event.x, event.y y = figheight-y dc =wx.ClientDC(canvas) dc.SetLogicalFunction(wx.XOR) wbrush =wx.Brush(wx.Colour(255,255,255), wx.TRANSPARENT) wpen =wx.Pen(wx.Colour(200, 200, 200), 1, wx.SOLID) dc.SetBrush(wbrush) dc.SetPen(wpen) dc.ResetBoundingBox() dc.BeginDrawing() x, y, left, right, bottom, top = [int(val) for val in x, y, left, right, bottom, top] self.erase_cursor() line1 = (x, bottom, x, top) line2 = (left, y, right, y) self.lastInfo = line1, line2, ax, dc dc.DrawLine(*line1) # draw new dc.DrawLine(*line2) # draw new dc.EndDrawing() time, price = event.xdata, event.ydata self.statusBar.SetStatusText("Time=%f Price=%f"% (time, price), 0) def erase_cursor(self): try: lastline1, lastline2, lastax, lastdc = self.lastInfo except AttributeError: pass else: lastdc.DrawLine(*lastline1) # erase old lastdc.DrawLine(*lastline2) # erase old 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() |
From: Werner F. B. <wer...@fr...> - 2005-04-15 13:35:10
|
O.k., so I have to decode all the texts, so that they get passed as "u'text' to matplotlib, i.e. something along these lines: textp = (_('Purchase - %s') % y).decode('iso-8859-1') Note that in this example the word 'Purchase' gets translated using gettext and would return "Einkäufe". See you Werner Werner F. Bruhin wrote: > Hi All, > > The legend lables etc I pass to matplotlib contain things like "äü" > (i.e. European character set) but they don't get displayed in the plots. > > Is there something special one needs to do to support this? > > Using wxPython 2.5.5.1 ANSI build (can't switch to Unicode just yet) on > Windows (XP, 2000). > > See you > Werner > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > |
From: Werner F. B. <wer...@fr...> - 2005-04-15 13:31:19
|
Hi All, I put a small test case together based on wxcursor_demo. When clicking the button1 it should show a new plot, but it does not. I think my memory issue has to do with this as I created a new self.canvas each time, instead of doing a clear, but the big question is what do I need to call to show the new plot. So, I am obviously missing something. Any hints are appreciated. See you Werner Werner F. Bruhin wrote: > Hi All, > > Doing multiple plots I see that memory usage grows and grows. > > Before doing a new plot I do "self.figure.clear()", or > "self.figure.clf()", is there some other call I should use? > > See you > Werner > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click |
From: Jochen V. <vo...@se...> - 2005-04-15 10:26:41
|
Hello Stephen, On Thu, Apr 14, 2005 at 04:16:49PM -0700, Stephen Walton wrote: > I can't seem to print EPS files generated from matplotlib on my printer,= =20 > a Minolta Magicolor 2200. I think this is very specific to my setup but= =20 > would be happy for suggestions. My initial guess is that MPL is=20 > generating Postscript Level 3 and my printer only supports Level 2, but= =20 > I'm open to other ideas. Last I checked the PostScript backend used only PostScript level 2. You could try to produce a standalone .ps file instead of an =2Eeps file. Maybe this works better? All the best, Jochen --=20 http://seehuhn.de/ |
From: Darren D. <dd...@co...> - 2005-04-15 10:00:58
|
Hi Sascha, I can't think of anything that has changed that would cause this. But if you could be a little more specific about the conditions causing the behavior, I'll look into it. Posting a short script that reproduces the problem would be helpful. Thanks, Darren On Friday 15 April 2005 5:32 am, Sascha Schnepp wrote: > Hi, > > I realized a change in the behavior of the eps export with the release 0.8. > Sometimes (not always!) the bounding box on the left side is very close to > the ylabel. When converting this to a pdf and printing it, this results in > a (partially or even totally) cutted ylabel on your printout... > > Greetings, > Sascha > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_ide95&alloc_id396&op=Click > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Darren S. Dale Bard Hall Department of Materials Science and Engineering Cornell University Ithaca, NY. 14850 dd...@co... |
From: Sascha S. <sc...@te...> - 2005-04-15 09:32:28
|
Hi, I realized a change in the behavior of the eps export with the release 0.= 8. Sometimes (not always!) the bounding box on the left side is very clos= e to the ylabel. When converting this to a pdf and printing it, this resu= lts in a (partially or even totally) cutted ylabel on your printout... Greetings, Sascha |
From: Olivier B. <Oli...@id...> - 2005-04-15 07:57:41
|
Hello all, > Yes, this is Numeric/numarray slicing, not list slicing. When you get > some time, you should read the pdf Numeric or numarray documentation. > It's comprehensive and very good. Thanks for all the answers. I'm now looking at the numarray/numeric documentation as suggested. Good day, and thanks again. Olivier --=20 . __ . ___ __. | Olivier Bornet Oli...@id... / / ` / / / / / | IDIAP http://www.idiap.ch/~bornet/ / / / / /--/ /--' | CP 592 http://www.idiap.ch/~bornet/pgp/ / /__.' / / / / | CH-1920 Martigny PGP-key: 0xC53D9218 |
From: John H. <jdh...@ac...> - 2005-04-15 05:34:22
|
>>>>> "Olive" == Olive <enc...@ya...> writes: Olive> Hello, I've juste downloaded the last version (0.8) of Olive> matplotlib and successfully built it on SunOS 5.8 with GTK Olive> backend (gcc 3.2.2). "import matplolib" is OK but typing Olive> "from matplotlib.pylab import *" result in a core dumped ! Olive> without any error message or exception... "import gtk", Olive> "import pygtk", and "import wx" works OK. Olive> I've tried with version 0.72, same error : I don't have a lot of good advice for you, but here is how I would go about debugging the problem. You can recompile mpl in verbose mode. rm -rf "site-packages/matplotlib" and your "build" subdir and edit setup.py and set VERBOSE=True and recompile/reinstall. This can sometimes provide information about which extension code function is failing. You also want to create a test script that replicates the problem (in your case it's a one-liner that simply imports matplotlib.pylab) and run it with the --verbose-debug flag > python myscript.py --verbose-debug This prints maximal debug info which can provide helpful information to narrow down the possible culprits. Olive> Python 2.4.1 (#3, Apr 14 2005, 10:58:02) [GCC 3.2.2] on Olive> sunos5 Type "help", "copyright", "credits" or "license" for Olive> more information. >>>> from matplotlib.pylab import * Olive> Bus Error (core dumped) The old-fashioned but effective way to triangulate this kind of segfault is to put a lot of print statements into the module that is segfaulting (in this case site-packages/matplotlib/pylab.py). Space these print statements every 50 lines or so print 'debug 1' ...50 lines of pylab... print 'debug 2' ...50 lines of pylab... print 'debug 3' When you have narrowed the segfault to be between two numbers, say 2 and 3, add more statements between them, maybe with a delimiter such as TAB '\t' print '\t debug 2a' ...5 lines of pylab... print '\t debug 2b' ...5 lines of pylab... print '\t debug 2c' ...5 lines of pylab... and repeat as necessary with a finer grain until you find the actual line causing the segfault. Posting this info will go a long way to actually discovering the bug. I call this "poor man's debugging" or "manual binary search" and it's primitive, ugly, and highly effective. Olive> One more thing is that after importing matplotlib, I got an Olive> error when using help : Don't know if this is related or not... JDH |
From: John H. <jdh...@ac...> - 2005-04-15 03:25:49
|
>>>>> "Joe" == Joe Wu <jw...@sd...> writes: Joe> Sorry if this question has been asked before: Has anyone Joe> written a locator class which acts like the AutoLocator but Joe> picks the best DateLocator based on current time span? Joe> For date plots, zooming in/out can yield no tick marks or too Joe> many tick marks, and I think using such a class can solve Joe> this problem. Any suggestion for other approach? Take a look at Axes.plot_date. It inspects the date range and tries to pick a good locator and formatter. You could wrap this functionality into an AutoDateLocator, following the model of AutoLocator. There is a slight wrinkle here in that you want an AutoDateFormatter as well, but this shouldn't be any harder. Again you can reuse the logic of plot_date to pick the right format string dynamically. If you succeed, please send it my way and I'll use it in plot_date. JDH |
From: Olive <enc...@ya...> - 2005-04-14 23:47:16
|
Hello, I've juste downloaded the last version (0.8) of matplotlib and successfully built it on SunOS 5.8 with GTK backend (gcc 3.2.2). "import matplolib" is OK but typing "from matplotlib.pylab import *" result in a core dumped ! without any error message or exception... "import gtk", "import pygtk", and "import wx" works OK. I've tried with version 0.72, same error : Python 2.4.1 (#3, Apr 14 2005, 10:58:02) [GCC 3.2.2] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> from matplotlib.pylab import * Bus Error (core dumped) One more thing is that after importing matplotlib, I got an error when using help : python Python 2.4.1 (#3, Apr 14 2005, 10:58:02) [GCC 3.2.2] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib >>> help(matplotlib) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/opt/SunOS/5.8/lib/python2.4/site.py", line 328, in__call__ return pydoc.help(*args, **kwds) File "/opt/SunOS/5.8/lib/python2.4/pydoc.py", line 1647, in __call__ self.help(request) File "/opt/SunOS/5.8/lib/python2.4/pydoc.py", line 1691, in help else: doc(request, 'Help on %s:') File "/opt/SunOS/5.8/lib/python2.4/pydoc.py", line 1475, in doc pager(title % desc + '\n\n' + text.document(object, name)) File "/opt/SunOS/5.8/lib/python2.4/pydoc.py", line 295, in document if inspect.ismodule(object): return self.docmodule(*args) File "/opt/SunOS/5.8/lib/python2.4/pydoc.py", line 1069, in docmodule contents.append(self.document(value, key, name)) File "/opt/SunOS/5.8/lib/python2.4/pydoc.py", line 296, in document if inspect.isclass(object): return self.docclass(*args) File "/opt/SunOS/5.8/lib/python2.4/pydoc.py", line 1193, in docclass lambda t: t[1] == 'method') File "/opt/SunOS/5.8/lib/python2.4/pydoc.py", line 1143, in spill name, mod, object)) File "/opt/SunOS/5.8/lib/python2.4/pydoc.py", line 297, in document if inspect.isroutine(object): return self.docroutine(*args) File "/opt/SunOS/5.8/lib/python2.4/pydoc.py", line 1254, in docroutine doc = getdoc(object) or '' File "/opt/SunOS/5.8/lib/python2.4/pydoc.py", line 75, in getdoc result = inspect.getdoc(object) or inspect.getcomments(object) File "/opt/SunOS/5.8/lib/python2.4/inspect.py", line 448, in getcomments lines, lnum = findsource(object) File "/opt/SunOS/5.8/lib/python2.4/inspect.py", line 437, in findsource if pat.match(lines[lnum]): break IndexError: list index out of range I really don't know where to begin to isolate the problem. Do I missed an option in the build process to have some kind of debug ? What can I do to help you better understand the problem ? Thank you in advance for your help, |
From: Joe W. <jw...@sd...> - 2005-04-14 23:46:04
|
Sorry if this question has been asked before: Has anyone written a locator class which acts like the AutoLocator but picks the best DateLocator based on current time span? For date plots, zooming in/out can yield no tick marks or too many tick marks, and I think using such a class can solve this problem. Any suggestion for other approach? Thanks, - Joe Wu |
From: Stephen W. <ste...@cs...> - 2005-04-14 23:17:19
|
Hi, all, I can't seem to print EPS files generated from matplotlib on my printer, a Minolta Magicolor 2200. I think this is very specific to my setup but would be happy for suggestions. My initial guess is that MPL is generating Postscript Level 3 and my printer only supports Level 2, but I'm open to other ideas. Steve Walton |
From: Michael B. <mb...@jp...> - 2005-04-14 18:05:44
|
On Wed, 13 Apr 2005, John Hunter wrote: > One possible solution is to move the axis > drawing commands to the end of the Axes.draw function. Off the top of > my head, I don't see any problem with this approach. Typically, you > want the ticks visible. I agree. I was thinking that the ticks would have to be dumped into the 'artists' list and drawn in zorder, but it's much easier to just move the x/yaxis draw() calls after the 'artists' draw() calls. Attached is a patch that does that. I ran the examples/backend_driver.py with it in place and didn't see any problems. --Michael ======================================================================== Michael Brady Phone: 818-354-4957 Jet Propulsion Laboratory (M/S 301-140L) Fax: 818-393-6388 4800 Oak Grove Drive Pasadena, CA 91109 E-mail: Mic...@jp... ======================================================================== |
From: Sean G. <sgi...@fr...> - 2005-04-14 16:37:55
|
Hi all, I'm the author of a cartographic library for Python and have been exploring the use of matplotlib and Agg instead of MapServer/GD for rendering map features. It was matplotlib's Basemap module that first caught my eye, and I promised its author that I would keep him up to date with my experiments. For the curious, results are here: http://zcologia.com/news/25 I'm really quite keen on Agg now. Blows GD away for stylishness and seems like it will be fast enough to use in high performance web maps. While I am primarily interested in programming web map services, it occurs to me that some of the same functionality could be useful to users in a pylab environment. Plotting features from GIS datasets, consuming web map and feature services, etc. If anyone is considering this kind of effort, please let me know, I'd be happy to pitch in. cheers, Sean -- Sean Gillies sgillies at frii dot com http://users.frii.com/sgillies |
From: Chris B. <Chr...@no...> - 2005-04-14 16:17:33
|
Olivier Bornet wrote: > This is exactly what I'm searching for. But this is not really a Python > syntax... The coma in the square brackets is not standard for lists. > Maybe this come from the array type ? Yes, it does. I you are doing anything MATLAB-y with Python, you really want to know about either numarray or Numeric. numarray is a little bot more like MATLAB (it allows array indexing), and Numeric has better performance with small arrays, but either will do for most uses. It looks like we're on the way to a grand unification of the two anyway. Make sure you go find the docs f0or the package you choose, and read through them, I think you'll like them a lot! By the way: aside from the looping, when you do: x = A[i][j] rather than: x = A[i,j] there is a performance hit because the first version is creating a new array out of A[i], then indexing into that, rather than just indexing directly into the 2-d (or more d) array. This is particularly pronounced with numarray, as the array creation overhead is larger than with Numeric. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: John H. <jdh...@ac...> - 2005-04-14 15:16:07
|
>>>>> "Olivier" == Olivier Bornet <Oli...@id...> writes: Olivier> Cool. :-D This is exactly what I'm searching for. But Olivier> this is not really a Python syntax... The coma in the Olivier> square brackets is not standard for lists. Maybe this Olivier> come from the array type ? Yes, this is Numeric/numarray slicing, not list slicing. When you get some time, you should read the pdf Numeric or numarray documentation. It's comprehensive and very good. Numarray also offers enhanced indexing ( Numeric does not yet) which is a convenience you probably expect coming from matlab. Eg, you can index an array with a sequence of integers (you must be careful that the sequence is not a tuple however; lists or arrays of ints are ok) >>> import numarray as na >>> a = na.arange(0.0, 2.0, 0.1) >>> ind = [2,5,7] >>> a[ind] array([ 0.2, 0.5, 0.7]) JDH |
From: John H. <jdh...@ac...> - 2005-04-14 15:07:28
|
>>>>> "Sascha" == Sascha Schnepp <sc...@te...> writes: Sascha> I often don't know which attributes can be used as Sascha> kwargs... Any Artist method that starts with 'set_' can be set with a kwarg. Eg, if set_markeredgecolor is a method, you can do markeredgecolor=something as a kwarg. Read through the classdocs at http://matplotlib.sourceforge.net/classdocs.html for the object of interest, eg for lines (Line2D), see http://matplotlib.sourceforge.net/matplotlib.lines.html Also, you can call set(object) on any object and it will return the current properties and their values (see also example/set_and_get.py) BTW, the set and get introspection functionality was recently moved out of the pylab interface and now resides in matplotlib.artist so API developers can use it as well In [1]: lines = plot([1,2,3]) In [2]: set(lines) alpha: float antialiased or aa: [True | False] clip_box: a matplotlib.transform.Bbox instance clip_on: [True | False] color or c: any matplotlib color - see help(colors) dashes: sequence of on/off ink in points data: (array xdata, array ydata) data_clipping: [True | False] figure: a matplotlib.figure.Figure instance label: any string linestyle or ls: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' ] linewidth or lw: float value in points lod: [True | False] marker: [ '+' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' ] markeredgecolor or mec: any matplotlib color - see help(colors) markeredgewidth or mew: float value in points markerfacecolor or mfc: any matplotlib color - see help(colors) markersize or ms: float transform: a matplotlib.transform transformation instance visible: [True | False] xclip: (xmin, xmax) xdata: array yclip: (ymin, ymax) ydata: array zorder: any number In [3]: |
From: John G. <jn...@eu...> - 2005-04-14 14:59:02
|
Lists are 1-dimensional, so the comma doesn't really make sense. You can, however, slice lists in python eg >>> x = range(100) >>> x[10:100:5] [10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95] You're right, that the commas come into play when you are dealing with the numarray (or numeric) arrays, where you may well have more than one dimension. It is a natural extension of the python slice syntax to multiple dimensions. John Olivier Bornet wrote: >Hi, > >On Fri, Apr 15, 2005 at 12:32:45AM +1000, Tim Leslie wrote: > > >>You'll be pleased to know that the slicing works in almost exactly the >>same in way python. Try: >> >>x2 = x[1:4,0:4] >> >> > >Cool. :-D >This is exactly what I'm searching for. But this is not really a Python >syntax... The coma in the square brackets is not standard for lists. >Maybe this come from the array type ? > > > >>The indexing is slightly different, but I'm sure you can work it out. >> >> > >Yes, no problem. > >Thanks for your help. > > Olivier > > |
From: Olivier B. <Oli...@id...> - 2005-04-14 14:44:28
|
Hi, On Fri, Apr 15, 2005 at 12:32:45AM +1000, Tim Leslie wrote: > You'll be pleased to know that the slicing works in almost exactly the > same in way python. Try: >=20 > x2 =3D x[1:4,0:4] Cool. :-D This is exactly what I'm searching for. But this is not really a Python syntax... The coma in the square brackets is not standard for lists. Maybe this come from the array type ? > The indexing is slightly different, but I'm sure you can work it out. Yes, no problem. Thanks for your help. Olivier --=20 . __ . ___ __. | Olivier Bornet Oli...@id... / / ` / / / / / | IDIAP http://www.idiap.ch/~bornet/ / / / / /--/ /--' | CP 592 http://www.idiap.ch/~bornet/pgp/ / /__.' / / / / | CH-1920 Martigny PGP-key: 0xC53D9218 |
From: Tim L. <ti...@cs...> - 2005-04-14 14:32:57
|
On Thu, 14 Apr 2005, Olivier Bornet <Oli...@id...> wrote... > Hello all, > > I'm converting some matlab scripts to matlibplot, and I don't know how > to make some "slicing" efficently with matlibplot. What I want to do is > to translate a matlab code like: You'll be pleased to know that the slicing works in almost exactly the same in way python. Try: x2 = x[1:4,0:4] The indexing is slightly different, but I'm sure you can work it out. Tim > > x = [[01, 02, 03, 04, 05, 06]; > [11, 12, 13, 14, 15, 16]; > [21, 22, 23, 24, 25, 26]; > [31, 32, 33, 34, 35, 36]; > [41, 42, 43, 44, 45, 46]; > [51, 52, 53, 54, 55, 56] > ]; > x(2:4,1:4) > > ans = > > 11 12 13 14 > 21 22 23 24 > 31 32 33 34 > > What I have done now in matplotlib is like: > > x = array ([[01, 02, 03, 04, 05, 06], > [11, 12, 13, 14, 15, 16], > [21, 22, 23, 24, 25, 26], > [31, 32, 33, 34, 35, 36], > [41, 42, 43, 44, 45, 46], > [51, 52, 53, 54, 55, 56], > ]) > for i in range (3): > for j in range (4): > x2 [i][j] = x [i+1][j+0] > > so, x2 is now what I want: > [[11,12,13,14,] > [21,22,23,24,] > [31,32,33,34,]] > > I will be very happy to make the "slicing" without the loop... > I'm pretty new to matlibplot, so sorry if this is a too simple question. > > Thanks in advance for your help. > > Olivier > -- > . __ . ___ __. | Olivier Bornet Oli...@id... > / / ` / / / / / | IDIAP http://www.idiap.ch/~bornet/ > / / / / /--/ /--' | CP 592 http://www.idiap.ch/~bornet/pgp/ > / /__.' / / / / | CH-1920 Martigny PGP-key: 0xC53D9218 `- |