Re: [Matplotlib-users] savefig and StringIO error on Python3

2014-11-03 Thread Pierre Haessig
Le 02/11/2014 09:34, Scott Lasley a écrit : > I wish I could say that it was because of a deep understanding of the inner > workings of matplotlib or a rock solid grasp of python 3's bytes vs strings, > but it wasn't. fig.savefig threw the "TypeError: string argument expected, > got 'bytes'" e

Re: [Matplotlib-users] savefig and StringIO error on Python3

2014-11-02 Thread Scott Lasley
I wish I could say that it was because of a deep understanding of the inner workings of matplotlib or a rock solid grasp of python 3's bytes vs strings, but it wasn't. fig.savefig threw the "TypeError: string argument expected, got 'bytes'" exception, so I figured BytesIO might work better wit

Re: [Matplotlib-users] savefig and StringIO error on Python3

2014-11-02 Thread Julien Hillairet
Well, the methodology is sufficient and efficient, I'm OK with that :) Thanks for these additional information. Regards, Le 2 nov. 2014 09:34, "Scott Lasley" a écrit : > I wish I could say that it was because of a deep understanding of the > inner workings of matplotlib or a rock solid grasp of

Re: [Matplotlib-users] savefig and StringIO error on Python3

2014-11-01 Thread Julien Hillairet
Indeed, it works also for me with Python 3.3.5. Could you explain the changes you made and the reasons behind the byte/string encoding ? Best regards, 2014-11-01 17:21 GMT+01:00 Scott Lasley : > This works for me with python 3.4.2 > > import matplotlib.pyplot as plt > from io import BytesIO > i

Re: [Matplotlib-users] savefig and StringIO error on Python3

2014-11-01 Thread Julien Hillairet
Many Thanks for your support. It is Python 3.3.5 and matplotlib 1.4.0 I've also found that it worked with ByteIO(), but then I was stuck by the encode/decode things. Thanks very much ! The traceback is below: Traceback (most recent call last): File "", line 1, in runfile('/home/hash/exa

Re: [Matplotlib-users] savefig and StringIO error on Python3

2014-11-01 Thread Scott Lasley
This works for me with python 3.4.2 import matplotlib.pyplot as plt from io import BytesIO import base64 fig = plt.figure() ax = fig.add_subplot(111) ax.plot([1,2,3]) sio = BytesIO() fig.savefig(sio, format="png") html = """ """.format(base64.encodebytes(sio.getvalue()).decode()) For python

Re: [Matplotlib-users] savefig and StringIO error on Python3

2014-11-01 Thread Benjamin Root
Please post the entire traceback so that we can know the context of the error message. Also, exactly which versions of matplotlib and python are you using? Ben Root On Sat, Nov 1, 2014 at 7:37 AM, Julien Hillairet wrote: > Dear all, > > I'm trying to write a html page content in which a png fig

[Matplotlib-users] savefig and StringIO error on Python3

2014-11-01 Thread Julien Hillairet
Dear all, I'm trying to write a html page content in which a png figure is generated by matplotlib, with Python3. However, the following piece of code does not work with matplotlib/Python3 (while it should work with Python2). The error is the following on TypeError: string argument expected, got

Re: [Matplotlib-users] savefig - legend only

2014-01-31 Thread Sterling Smith
Is it legend(loc='auto') or legend(loc='best')? I always used the latter. I think that http://matplotlib.org/api/legend_api.html supports me here. -Sterling On Jan 31, 2014, at 8:31AM, Benjamin Root wrote: > I would also like to point out that you can specify "auto" for a location, > and ma

Re: [Matplotlib-users] savefig - legend only

2014-01-31 Thread Benjamin Root
I would also like to point out that you can specify "auto" for a location, and matplotlib will attempt to find a good location for you (within the plot area). It isn't perfect, but it can be useful. Cheers! Ben Root On Fri, Jan 31, 2014 at 7:02 AM, Skip Montanaro wrote: > > 1. PNG file of figu

Re: [Matplotlib-users] savefig - legend only

2014-01-31 Thread Skip Montanaro
> 1. PNG file of figure without legend. > 2. PNG file of legend only. > > The end user would import both images into another tool (e.g. microsoft > power point) and arrange figure and legend interactively for the final > product. As someone pointed out to me not long ago, you can call my_lege

Re: [Matplotlib-users] savefig - legend only

2014-01-31 Thread Francesco Montesano
Hi Peter, just get the legend handlers and labels with handles,labels = ax.get_legend_handles_labels() then create an empty plot with axes `axe` and do axe.legend(handles, labels, loc=loc) If you want to hide the axis: axe.xaxis.set_visible(False) axe.yaxis.set_visible(False)

[Matplotlib-users] savefig - legend only

2014-01-31 Thread Peter Van Wieren
I would like to ask if there is a way to print only the legend box of a figure.  The motiviation for wanting to do this is a work around to the problem of having the legend box obscuring data without resorting to "outside" placement of the legend.   The idea here is that matplotlib would pr

Re: [Matplotlib-users] savefig

2013-06-15 Thread Sudheer Joseph
*** > > From: Paul Hobson >To: Sudheer Joseph >Cc: "matplotlib-users@lists.sourceforge.net" > >Sent: Friday, 14 June 2013 9:05 PM >Subject: Re: [Matplotlib-users] savefig > > > >On Thu, Jun 13, 2013 at

Re: [Matplotlib-users] savefig

2013-06-14 Thread Paul Hobson
On Thu, Jun 13, 2013 at 11:40 PM, Sudheer Joseph wrote: > Thank you, > I don't see a way other than starting in normal mode as the moment I type > plot command it get displayed and I don't need to do a show command. > In the qtconsole, you can enter multi-line mode with crtl+enter. --

Re: [Matplotlib-users] savefig

2013-06-13 Thread Sudheer Joseph
Thank you, I don't see a way other than starting in normal mode as the moment I type plot command it get displayed and I don't need to do a show command. With best regards sudheer-- This SF.net email is sponsored by Windo

Re: [Matplotlib-users] savefig

2013-06-13 Thread Sudheer Joseph
t;I don't see a way other than starting in normal mode as the moment I type >>plot command it get displayed and I don't need to do a show command. >>With best regards sudheer >> >> >> >>____ >> From:  Paul Hobson ; >&g

Re: [Matplotlib-users] savefig

2013-06-13 Thread Matthias BUSSONNIER
close_figures, not close_all Haven't tried to switch it at run time using %config magic though. $ ipython [qtconsole|notebook|whatever] --help-all to get all option as examples in config files are **not** updated with IPython. InlineBackend options - --InlineBackend.close_

Re: [Matplotlib-users] savefig

2013-06-13 Thread Roban Kramer
ed and I don't need to do a show command. > With best regards sudheer > > -- > * From: * Paul Hobson ; > * To: * Sudheer Joseph ; > * Cc: * matplotlib-users@lists.sourceforge.net < > matplotlib-users@lists.sourceforge.net>; > * Subject:

Re: [Matplotlib-users] savefig

2013-06-13 Thread Sudheer Joseph
Thank you, I don't see a way other than starting in normal mode as the moment I type plot command it get displayed and I don't need to do a show command. With best regards sudheer-- This SF.net email is sponsored by Windo

Re: [Matplotlib-users] savefig

2013-06-13 Thread Paul Hobson
On Wed, Jun 12, 2013 at 10:28 PM, Sudheer Joseph wrote: > Dear experts, > I start ipython in ipython qtconsole --pylab=inline mode and make a plot. > But if I use savefig('fig.png') the figure do not get saved instead I get a > blank page. > > I also tried img.save('fig.png',png) but no use. Is t

[Matplotlib-users] savefig

2013-06-12 Thread Sudheer Joseph
Dear experts, I start ipython in ipython qtconsole --pylab=inline mode and make a plot. But if I use savefig('fig.png') the figure do not get saved instead I get a blank page.  I also tried img.save('fig.png',png) but no use. Is there a way out or I need to do this after quitting and restarting

Re: [Matplotlib-users] savefig problem

2011-07-30 Thread Roy Lowrance
Ben: That's what I did: plt.show() then plt.savefig(). I now know to reverse the order. Thanks! - Roy On Fri, Jul 29, 2011 at 7:32 PM, Benjamin Root wrote: > On Fri, Jul 29, 2011 at 6:19 PM, Roy Lowrance wrote: > >> I'm using matplotlib on ubuntu 11.04. >> >> I create a figure and an axes and th

Re: [Matplotlib-users] savefig problem

2011-07-29 Thread Benjamin Root
On Fri, Jul 29, 2011 at 6:19 PM, Roy Lowrance wrote: > I'm using matplotlib on ubuntu 11.04. > > I create a figure and an axes and then show it via plt.show(). > > From the window that plt.show() opens, I save the file to plot-3.png. This > works as I can open the file with evince. > > However, wh

[Matplotlib-users] savefig problem

2011-07-29 Thread Roy Lowrance
I'm using matplotlib on ubuntu 11.04. I create a figure and an axes and then show it via plt.show(). >From the window that plt.show() opens, I save the file to plot-3.png. This works as I can open the file with evince. However, when my program executes plt.savefig('plot-3.png'), something is sav

Re: [Matplotlib-users] Savefig Question

2011-07-08 Thread Michael Droettboom
It's hard to say from the code snippet, but I would track down whether self.page_graph.figure is the figure that you think it is. It could be a Figure object without any axes on it. Cheers, Mike On 07/08/2011 03:55 AM, Sebastian Rhode wrote: Hi, I use the followng function for my applicatio

[Matplotlib-users] Savefig Question

2011-07-08 Thread Sebastian Rhode
Hi, I use the followng function for my application: def OnSaveAs(self, event): dlg = wx.FileDialog(self, 'Choose a Filename', os.getcwd(), '', '*.png*', wx.SAVE | wx.OVERWRITE_PROMPT) if dlg.ShowModal() == wx.ID_OK: savename = dlg.GetPath() self.page_graph.figure.s

Re: [Matplotlib-users] savefig very slow

2011-06-15 Thread Michael Droettboom
Can you provide a standalone script that reproduces the problem? How many points are you plotting? Cheers, Mike On 06/15/2011 06:09 AM, Francesco Benincasa wrote: > Hi all, > I've noticed that savefig is very slow when I draw wind (using "quiver" and > "quiverkey" commands). > > If I don't draw

[Matplotlib-users] savefig very slow

2011-06-15 Thread Francesco Benincasa
Hi all, I've noticed that savefig is very slow when I draw wind (using "quiver" and "quiverkey" commands). If I don't draw winds is very fast (2 seconds against 13 seconds). Is possible to make the program faster? Any idea? I use the 'Agg' backend and the latest version of matplotlib. Thank you

Re: [Matplotlib-users] savefig not deducing file format

2011-03-25 Thread Giovanni Luca Ciampaglia
Ah, sorry for the duplicate message! Cheers, G On 15/03/2011 11:30, Giovanni Luca Ciampaglia wrote: > Hi all, > I call savefig by passing to it a file-like object but it appears to not > get the graphics format right: > > f = open('not_a_pdf.pdf', 'w') > plot([1,2,3]) > savefig(f) > > but it pro

Re: [Matplotlib-users] savefig not deducing file format

2011-03-25 Thread Fabrice Silva
Le mardi 15 mars 2011 à 11:30 +0100, Giovanni Luca Ciampaglia a écrit : > Hi all, > I call savefig by passing to it a file-like object but it appears to not > get the graphics format right: > > f = open('not_a_pdf.pdf', 'w') > plot([1,2,3]) > savefig(f) > > but it produces a PNG image. Can anybo

[Matplotlib-users] savefig not deducing file format

2011-03-25 Thread Giovanni Luca Ciampaglia
Hi all, I call savefig by passing to it a file-like object but it appears to not get the graphics format right: f = open('not_a_pdf.pdf', 'w') plot([1,2,3]) savefig(f) but it produces a PNG image. Can anybody confirm this? I am on matplotlib 0.99.3 Cheers, -- Giovanni L. Ciampaglia PhD Studen

Re: [Matplotlib-users] savefig not deducing file format

2011-03-15 Thread Alan G Isaac
On 3/15/2011 8:51 AM, Michael Droettboom wrote: > It has no way of deducing the file format from the file object. Inspect f.name? Alan Isaac -- Colocation vs. Managed Hosting A question and answer guide to determining t

Re: [Matplotlib-users] savefig not deducing file format

2011-03-15 Thread Giovanni Luca Ciampaglia
My fault, I didn't read the docstring properly. Thanks for both replies. Best, G On 15/03/2011 13:51, Michael Droettboom wrote: > It has no way of deducing the file format from the file object. > > You need to explicitly pass the format keyword to savefig, e.g.: > > savefig(f, format='pdf')

Re: [Matplotlib-users] savefig not deducing file format

2011-03-15 Thread Michael Droettboom
It has no way of deducing the file format from the file object. You need to explicitly pass the format keyword to savefig, e.g.: savefig(f, format='pdf') Mike On 03/15/2011 07:11 AM, Giovanni Luca Ciampaglia wrote: > Hi all, > I call savefig by passing to it a file-like object but it appears

[Matplotlib-users] savefig not deducing file format

2011-03-15 Thread Giovanni Luca Ciampaglia
Hi all, I call savefig by passing to it a file-like object but it appears to not get the graphics format right: f = open('not_a_pdf.pdf', 'w') plot([1,2,3]) savefig(f) but it produces a PNG image. Can anybody confirm this? I am on matplotlib 0.99.3 Cheers, Giovanni --

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-11 Thread Yuri D'Elia
On Sun, 6 Mar 2011 21:47:04 +0900 Jae-Joon Lee wrote: > > Ok, I can understand that, but shouldn't all artists used to construct the > > picture, as suptitle, be considered? > > I think considering all the artists is not very practical (as some of > them could have spline paths), but what we

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-08 Thread Yuri D'Elia
On Mon, 7 Mar 2011 13:41:49 -0600 Benjamin Root wrote: > > I've > > been using matplotlib a lot the last few months and was totally > > unaware that pyplot was "required". Good thing I read this message! :-) I'm glad I'm not the only one :) > > > The interface should create the figure objects

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-07 Thread Benjamin Root
On Mon, Mar 7, 2011 at 12:42 PM, Brendan Barnwell wrote: > On 2011-03-07 08:59, Benjamin Root wrote: > > On Mon, Mar 7, 2011 at 10:33 AM, Yuri D'Elia wrote: > >> I was reading this at the time: > >> > >> http://matplotlib.sourceforge.net/faq/usage_faq.html > >> > >> I inferred pyplot was just

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-07 Thread Brendan Barnwell
On 2011-03-07 08:59, Benjamin Root wrote: > On Mon, Mar 7, 2011 at 10:33 AM, Yuri D'Elia wrote: >> I was reading this at the time: >> >> http://matplotlib.sourceforge.net/faq/usage_faq.html >> >> I inferred pyplot was just a matlab-like interface on top of matplotlib, >> and figured using dire

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-07 Thread Jae-Joon Lee
On Tue, Mar 8, 2011 at 2:20 AM, Benjamin Root wrote: > And this appears to be a bug.  Looks like the call signature for the legend > object's get_window_extent() doesn't match the call signature for all other > artists. > Yes. It is a bug. Meanwhile, you may use bbox_extra_artists=[leg.legendPa

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-07 Thread Benjamin Root
On Mon, Mar 7, 2011 at 11:09 AM, Yuri D'Elia wrote: > On Tue, 8 Mar 2011 02:03:54 +0900 > Jae-Joon Lee wrote: > > > On Mon, Mar 7, 2011 at 7:36 PM, Yuri D'Elia wrote: > > In fact, supporting the "bbox_inches" is a real hack. > > As I mentioned in my previous email, matplotlib artists can have >

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-07 Thread Yuri D'Elia
On Tue, 8 Mar 2011 02:03:54 +0900 Jae-Joon Lee wrote: > On Mon, Mar 7, 2011 at 7:36 PM, Yuri D'Elia wrote: > In fact, supporting the "bbox_inches" is a real hack. > As I mentioned in my previous email, matplotlib artists can have > spline paths. And artists can also be clipped by an arbitrary sp

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-07 Thread Jae-Joon Lee
On Mon, Mar 7, 2011 at 7:36 PM, Yuri D'Elia wrote: > I consider bbox_extra_artists some kind of a hack (IMHO, all artists should > be considered with a 'tight' box), but coming from gnuplot/asymptote maybe my > point of view is biased. > What would be the point of a 'tight' box that excludes par

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-07 Thread Benjamin Root
On Mon, Mar 7, 2011 at 10:33 AM, Yuri D'Elia wrote: > On Mon, 7 Mar 2011 09:25:23 -0600 > Benjamin Root wrote: > > > The problem is that you are creating your figure wrong. Try this: > > > > import matplotlib as mpl > > mpl.use("Agg") > > import matplotlib.pyplot as plt > > > > fig = plt.figure

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-07 Thread Yuri D'Elia
On Mon, 7 Mar 2011 09:25:23 -0600 Benjamin Root wrote: > The problem is that you are creating your figure wrong. Try this: > > import matplotlib as mpl > mpl.use("Agg") > import matplotlib.pyplot as plt > > fig = plt.figure(figsize=(20, 20)) > ax = fig.add_subplot(111) > ax.set_title("Subtitle

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-07 Thread Benjamin Root
On Mon, Mar 7, 2011 at 4:36 AM, Yuri D'Elia wrote: > On Fri, 4 Mar 2011 14:57:34 -0600 > Benjamin Root wrote: > > > Which version of matplotlib are you using? This example works for me > using > > the latest matplotlib from source. Also, why the awkward usage and > > Yes, with matplotlib 1.0 b

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-07 Thread Yuri D'Elia
On Mon, 7 Mar 2011 11:36:45 +0100 Yuri D'Elia wrote: > On Fri, 4 Mar 2011 14:57:34 -0600 > Benjamin Root wrote: > > > Which version of matplotlib are you using? This example works for me using > > the latest matplotlib from source. Also, why the awkward usage and > > Yes, with matplotlib 1.0

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-07 Thread Yuri D'Elia
On Fri, 4 Mar 2011 14:57:34 -0600 Benjamin Root wrote: > Which version of matplotlib are you using? This example works for me using > the latest matplotlib from source. Also, why the awkward usage and Yes, with matplotlib 1.0 bbox_extra_artists now works. I consider bbox_extra_artists some ki

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-04 Thread Benjamin Root
On Wed, Mar 2, 2011 at 8:46 AM, Yuri D'Elia wrote: > > > > On Wed, 2 Mar 2011 22:01:02 +0900 > Jae-Joon Lee wrote: > > > >> > Is this a bug? > > >> > > >> Unfortunately, bbox_inches option is never meant to be complete in > > >> figuring out the exact size of the figure area. > > > > > > Why no

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-04 Thread Yuri D'Elia
On Wed, 2 Mar 2011 22:01:02 +0900 Jae-Joon Lee wrote: > >> > Is this a bug? > >> > >> Unfortunately, bbox_inches option is never meant to be complete in > >> figuring out the exact  size of the figure area. > > > > Why not? What's the purpose of bbox_inches='tight' otherwise? > > Figuring out

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-03-02 Thread Yuri D'Elia
On Tue, 1 Mar 2011 12:44:20 +0900 Jae-Joon Lee wrote: > > Is this a bug? > > Unfortunately, bbox_inches option is never meant to be complete in > figuring out the exact size of the figure area. Why not? What's the purpose of bbox_inches='tight' otherwise? > However, you can use "bbox_extra_a

Re: [Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-02-28 Thread Jae-Joon Lee
On Fri, Feb 25, 2011 at 9:15 PM, Yuri D'Elia wrote: > In the following: > > <<< > import matplotlib as mpl > import matplotlib.figure > import matplotlib.backends.backend_agg > > fig = mpl.figure.Figure() > cvs = mpl.backends.backend_agg.FigureCanvasAgg(fig) > fig.set_size_inches((20,20))

[Matplotlib-users] savefig bbox_inches='tight' does not consider suptitle

2011-02-25 Thread Yuri D'Elia
In the following: <<< import matplotlib as mpl import matplotlib.figure import matplotlib.backends.backend_agg fig = mpl.figure.Figure() cvs = mpl.backends.backend_agg.FigureCanvasAgg(fig) fig.set_size_inches((20,20)) fig.suptitle("Horray!", fontsize=20) plot = fig.add_subplot(111) plot.s

Re: [Matplotlib-users] savefig eps error

2010-05-29 Thread Jouni K . Seppänen
alex arsenovic writes: > the main error is > > Error: /nocurrentpoint in --lineto-- Sounds like this bug: http://sourceforge.net/tracker/index.php?func=detail&aid=2879910&group_id=80706&atid=560720 It's fixed in svn, but I don't think there has been a release after the fix. One way to test if

[Matplotlib-users] savefig eps error

2010-05-26 Thread alex arsenovic
today i produced an image that failed to save to eps. i can save the file in pdf, but i get the same error if i try to use pdf2ps. png works too, but its not vector. not sure if its important, but the image has 401 lines, with 500 points each. the image is produced from a bunch of data files a

Re: [Matplotlib-users] savefig Memory Leak

2010-04-19 Thread Keegan Callin
Hello Michael, I have not tried using plt.figure() and plt.close(fig) but you are right; I should investigate it as well for completeness. I had, actually, purposefully avoided doing this because I read that the pyplot API is stateful. It keeps references to figures in the same way that MatL

Re: [Matplotlib-users] savefig Memory Leak

2010-04-19 Thread K . -Michael Aye
On 2010-04-16 19:18:56 +0200, Keegan Callin said: > Hello, > > I have written a small script that, I think, demonstrates a memory leak > in savefig. A search of the mailing list shows a thread started by Ralf > Gommers about > 2009-07-01 that seems to > cover a very similar issue. I have appe

[Matplotlib-users] savefig Memory Leak

2010-04-16 Thread Keegan Callin
Hello, I have written a small script that, I think, demonstrates a memory leak in savefig. A search of the mailing list shows a thread started by Ralf Gommers about 2009-07-01 that seems to cover a very similar issue. I have appended the demonstration script at the end of this e-mail text.

Re: [Matplotlib-users] savefig 0.91

2010-03-16 Thread Christopher Barker
Samuel Teixeira Santos wrote: > I fix it. > > It was a dumb error > > I using '\' on windows > and on ubuntu-linux I must use '/'... note that '\' works in Windows for the most part. Or, better yet, use os.path.join() and friends. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency

Re: [Matplotlib-users] savefig 0.91

2010-03-16 Thread Samuel Teixeira Santos
I fix it. It was a dumb error I using '\' on windows and on ubuntu-linux I must use '/'... sorry... and thanks 2010/3/16 Michael Droettboom > Can you please post the entire traceback? > > Mike > > Samuel Teixeira Santos wrote: > >> Hi folks >> >> I'm using ubuntu 8.04 lts and matplotlib 0.91

Re: [Matplotlib-users] savefig 0.91

2010-03-16 Thread Michael Droettboom
Can you please post the entire traceback? Mike Samuel Teixeira Santos wrote: > Hi folks > > I'm using ubuntu 8.04 lts and matplotlib 0.91 > > I cannot upgrade in this moment. > > On my app (for web) I fix several errors (because I did her in 0.99) > > My last error (I think it is) is on savefig >

[Matplotlib-users] savefig 0.91

2010-03-16 Thread Samuel Teixeira Santos
Hi folks I'm using ubuntu 8.04 lts and matplotlib 0.91 I cannot upgrade in this moment. On my app (for web) I fix several errors (because I did her in 0.99) My last error (I think it is) is on savefig It tells me that cannot open file on log error, appears on write_png method. Is this permis

[Matplotlib-users] savefig does not save text

2009-12-27 Thread Dr. Phillip M. Feldman
When I try to save a figure to a file using `savefig`, text in the figure (x-axis label, y-axis label, etc.) is not saved. Have other people encountered this problem? I'm using the Enthought Python Distribution 5.1.1 on a 32-bit Windows XP machine. -- View this message in context: http://old.n

[Matplotlib-users] savefig with pdf export in snow leopard causes a 'Bus error'

2009-09-06 Thread Yael Maguire
tmp user$ python pdftest.py Bus error code: import pylab as pl from numpy import linspace pl.plot(linspace(0,10,10)) pl.savefig('test.pdf') eps, png, jpg export works fine. Another issue is that you must change the default snow leopard python to 32-bit to get matplotlib to work properly.

[Matplotlib-users] Savefig bug with Patches

2009-08-24 Thread Peter-Jan Randewijk
Dear All, I came across this peculiar bug when using patches together with savefig. I first want to display the contour plot of the vector potentials in a electrical machine, and the the contour plot of the flux density. If I first define the patches (for the yoke and the magnets) and then the f

Re: [Matplotlib-users] savefig as pdf not generating vector graphics?

2009-06-28 Thread Michiel de Hoon
--- On Sun, 6/28/09, Jouni K. Seppänen wrote: > The file you sent was not generated by the pdf backend but > by "Mac OS X 10.5.6 Quartz PDFContext", which probably means > that the OS X backend saves pdf files using the OS X machinery > and not the pdf backend. Indeed the formulas look like bitma

Re: [Matplotlib-users] savefig as pdf not generating vector graphics?

2009-06-28 Thread Jouni K . Seppänen
per freem writes: > you're right, i don't need to use "usetex" -- i removed it, but the problem > still persists. here is the pdf that it generates (code below). any idea > what is happening here? thanks very much for your help. The file you sent was not generated by the pdf backend but by "Mac

Re: [Matplotlib-users] savefig as pdf not generating vector graphics?

2009-06-28 Thread Jouni K . Seppänen
per freem writes: > i am using matplotlib 0.98.5.2 on Mac OS X. i am plotting a histogram > and then saving it as .pdf. The x and y labels use some symbols from > latex, and i have useTex set to true in my rcParams. Do you really need usetex? Matplotlib's usual mathtext engine is pretty good and

[Matplotlib-users] savefig as pdf not generating vector graphics?

2009-06-27 Thread per freem
hi all, i am using matplotlib 0.98.5.2 on Mac OS X. i am plotting a histogram and then saving it as .pdf. The x and y labels use some symbols from latex, and i have useTex set to true in my rcParams. The code is: import matplotlib.pyplot as plt my_fig = plt.figure(figsize=(5,5)), dpi=100) plt.his

Re: [Matplotlib-users] savefig behaviour with transparent patches

2009-06-01 Thread John Hunter
On Mon, Jun 1, 2009 at 4:37 PM, Kurt Forrester wrote: > > I am searched the mailing list and web without success with this problem. I > am getting unexpected behaviour when using savefig in the eps format. PS/EPS do not support alpha transparency. This is not a limitation of mpl, but of the for

[Matplotlib-users] savefig behaviour with transparent patches

2009-06-01 Thread Kurt Forrester
I am searched the mailing list and web without success with this problem. I am getting unexpected behaviour when using savefig in the eps format. The pdf renders the figure as it appears in the plot figure however the alpha for the patches is lost when saving as eps (see code below). Any help

Re: [Matplotlib-users] savefig bug

2009-04-23 Thread Thomas Robitaille
It works great now - thanks for fixing this! Thomas On Apr 23, 2009, at 10:29 AM, Michael Droettboom wrote: > I think Jae-Joon's assesment is correct, since the logical dpi in PS > is hardcoded to 72.0. I have made this change in the SVN repository. > > Mike > > Thomas Robitaille wrote: >> Th

Re: [Matplotlib-users] savefig bug

2009-04-23 Thread Michael Droettboom
I think Jae-Joon's assesment is correct, since the logical dpi in PS is hardcoded to 72.0. I have made this change in the SVN repository. Mike Thomas Robitaille wrote: > Thanks for your quick reply! > > I'll be patient and wait for the fix to be made in the SVN repository, > rather than tryin

Re: [Matplotlib-users] savefig bug

2009-04-21 Thread Thomas Robitaille
Thanks for your quick reply! I'll be patient and wait for the fix to be made in the SVN repository, rather than trying to patch it myself. Do I need to add any information to the bug report? Best, Thomas On Apr 21, 2009, at 1:06 PM, Jae-Joon Lee wrote: > I can reproduce this bug with the c

Re: [Matplotlib-users] savefig bug

2009-04-21 Thread Jae-Joon Lee
I can reproduce this bug with the current svn. It works correctly If you set dpi=72, but it seems that it would not be an option in your case. It seems to me that this is related with the change in r6847 that Michael made. http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/

[Matplotlib-users] savefig bug

2009-04-21 Thread Thomas Robitaille
Hi, I've come across a bug with the savefig method when using the dpi= argument and saving an EPS file. If you try the following code, you will see that the frame is incomplete. Is there a way to solve this from a user point of view? --- import matplotlib matplotlib.use('Agg') from matplot

Re: [Matplotlib-users] Savefig('file.pdf') error with latex custom font

2008-12-29 Thread Jouni K . Seppänen
I finally got around to addressing this issue from October: "David Krapohl" writes: >> I am getting an error with savefig and pdf when I try to used >> matplotlib with latex font rendering (attached below). In >> etc/matplotlibrc, I set text.latex.preamble : >> \usepackage{MinionPro}, Jouni K. S

[Matplotlib-users] savefig doesn't clear canvas

2008-10-30 Thread Thomas Pfaff
Hello, I started off with the Polygon plotting example of the basemap toolkit as I want to visualize Radar data with GoogleEarth. I have a polygon shapefile and another data file in which I have one value for each of the polygons. I do the basemap.read_shapefile and the axes.add_patch stuff once i

Re: [Matplotlib-users] Savefig('file.pdf') error with latex custom font

2008-10-23 Thread Jouni K . Seppänen
"David Krapohl" <[EMAIL PROTECTED]> writes: >> >From your backtrace, it looks like dviread fails to parse a tfm file: >> >> > File "/usr/lib/python2.5/site-packages/matplotlib/dviread.py", line >> 398, >> > in __init__ >> > for char in range(0, max(tfm.width)) ] >> > ValueError: max() arg is

Re: [Matplotlib-users] savefig to StringIO and import into PIL

2008-10-23 Thread Jesper Larsen
Hi Michael, 2008/10/22 Michael Droettboom <[EMAIL PROTECTED]>: > You need to "rewind" the StringIO cursor before opening with PIL: > > imgdata = StringIO.StringIO() > fig.savefig(imgdata, format='png') > imgdata.seek(0) > im = Image.open(imgdata) Thanks. It works fine now. Best regards, Jesper

Re: [Matplotlib-users] Savefig('file.pdf') error with latex custom font

2008-10-23 Thread David Krapohl
On Thu, Oct 23, 2008 at 7:04 AM, Jouni K. Seppänen <[EMAIL PROTECTED]> wrote: > "David Krapohl" <[EMAIL PROTECTED]> > writes: > > > I am getting an error with savefig and pdf when I try to used matplotlib > > with latex font rendering (attached below). In etc/matplotlibrc, I set > > text.latex.pre

Re: [Matplotlib-users] Savefig('file.pdf') error with latex custom font

2008-10-22 Thread Jouni K . Seppänen
"David Krapohl" <[EMAIL PROTECTED]> writes: > I am getting an error with savefig and pdf when I try to used matplotlib > with latex font rendering (attached below). In etc/matplotlibrc, I set > text.latex.preamble : \usepackage{MinionPro}, > \renewcommand{\sfdefault}{Myriad-LF} > It seems that the

[Matplotlib-users] Savefig('file.pdf') error with latex custom font

2008-10-22 Thread David Krapohl
Hello, I am getting an error with savefig and pdf when I try to used matplotlib with latex font rendering (attached below). In etc/matplotlibrc, I set text.latex.preamble : \usepackage{MinionPro}, \renewcommand{\sfdefault}{Myriad-LF} It seems that the dviread backend does not find a specific *.vf,

Re: [Matplotlib-users] savefig to StringIO and import into PIL

2008-10-22 Thread Michael Droettboom
Jesper Larsen wrote: > Hi mpl users, > > I am trying to save a figure to a file like object (a StringIO object) > and load this object into PIL (Python Imaging Library). The code for > this is really simple (fig is my figure object): > > # This works > fig.savefig('test.png', format='png') > im = I

[Matplotlib-users] savefig to StringIO and import into PIL

2008-10-22 Thread Jesper Larsen
Hi mpl users, I am trying to save a figure to a file like object (a StringIO object) and load this object into PIL (Python Imaging Library). The code for this is really simple (fig is my figure object): # This works fig.savefig('test.png', format='png') im = Image.open('test.png') # This fails i

[Matplotlib-users] savefig, too many open files

2008-08-15 Thread Evan Mason
Hi I have a script to plot and save a sequence of png images which I am using to prepare animations. This works fine, but I got the following error when preparing a particularly large number of files: --- record: 1015 --- record: 1016 /usr/lib/python2.5/site-packages/matplotlib/backends/backend

[Matplotlib-users] savefig and animated elements

2008-07-29 Thread Chee Sing Lee
Hi, I am trying to save figures where all the artists have animated = True. The result I get (I have tried svg and png formats) is a set of axes with labels, ticks, and grid, but no data points! I am using the WxAgg backend. Is this something to be expected, and if so, can anyone suggest a workar

[Matplotlib-users] savefig and animated elements

2008-07-29 Thread Chee Sing Lee
Hi, I am trying to save figures where all the artists have animated = True. The result I get (I have tried svg and png formats) is a set of axes with labels, ticks, and grid, but no data points! I am using the WxAgg backend. Is this something to be expected, and if so, can anyone suggest a workar

[Matplotlib-users] savefig fails under apache on solaris

2008-06-17 Thread John Bovey
Hi, I am trying to use matplotlib to generate png image plots to display in web pages using apache on solaris. The problem is that savefig(sys.stdout) fails to generate any output or any error messages. The scripts run ok when run by hand, either by me or by the apache user. They also work when

[Matplotlib-users] savefig fails under apache on solaris

2008-06-17 Thread John Bovey
Hi, I am trying to use matplotlib to generate png image plots to display in web pages using apache on solaris. The problem is that savefig(sys.stdout) fails to generate any output or any error messages. The scripts run ok when run by hand, either by me or by the apache user. They also work when

Re: [Matplotlib-users] savefig memory useage

2007-12-04 Thread Jordan Atlas
Mike, Updating to 0.91.1 fixed it. Python's memory usage was climbing in excess of 1 GB when running this script before (eventually crashing) -- now it hovers nicely around 60MB and completes with no problems. Excellent! Thanks, --Jordan Michael Droettboom wrote: > You can try running

Re: [Matplotlib-users] savefig memory useage

2007-12-04 Thread Michael Droettboom
You can try running the garbage collector after each savefig. ("import gc" and then call "gc.collect()"). If you are using a GUI backend, you may want to try using the "raw" Agg backend instead -- there are fewer moving parts that way. There have been a number of memory leaks that have been f

[Matplotlib-users] savefig memory useage

2007-12-04 Thread Jordan Atlas
Hi all, I've noticed that when I save my figures using savefig the memory is not immediately released. For example, in pseudocode, times = get_times() for var_id in var_list: Plotting.figure() var_values = get_values(var_id) pylab.plot(times, values) Plotting.savefig(var+'.p

[Matplotlib-users] savefig

2007-08-30 Thread Martin Bures
Hi - I am writing a script that will generate many figures. Currently this script lives in matlab and outputs these figures to a single .ps file: if( first ) print( nfig, '-dpsc2', '-r300', '-loose', filename ); else print( nfig, '-dpsc2', '-r300', '-loose', '-append', filename ); end

Re: [Matplotlib-users] savefig pdf doesn't work anymore

2007-07-18 Thread Jouni K . Seppänen
Lionel Roubeyrie <[EMAIL PROTECTED]> writes: > I've got a problem with saving plots in pdf format like you can see in the > following output. It seems encodings.cp1252 doesn't have a decoding_map > method (but a decoding_table one). > Is it a bug or a problem in my encodings file? It's a bug, f

[Matplotlib-users] savefig pdf doesn't work anymore

2007-07-18 Thread Lionel Roubeyrie
Hi all, I've got a problem with saving plots in pdf format like you can see in the following output. It seems encodings.cp1252 doesn't have a decoding_map method (but a decoding_table one). Is it a bug or a problem in my encodings file? thanks |Diagrammes|[68]>matplo

Re: [Matplotlib-users] savefig problems

2007-04-06 Thread Jouni K . Seppänen
Dominik Szczerba <[EMAIL PROTECTED]> writes: > I want bright information (fonts,lines) on dark background (figure > bg, axes bg) and I can fully achieve this goal while DISPLAYING > plots. However, SAVING damages their colors The following works for me (svn revision 3159): figure(facecolor='k'

[Matplotlib-users] savefig problems

2007-03-29 Thread Dominik Szczerba
Hi, After a few trials and errors I could finally set up plots the way I wanted by modifying the matplotlibrc resource. In an essence, I want bright information (fonts,lines) on dark background (figure bg, axes bg) and I can fully achieve this goal while DISPLAYING plots. However, SAVING damages