From: <kc1...@ya...> - 2007-05-11 17:54:43
|
Thanks everybody for the explanation of svg in Gimp. That makes sense. Is there any vector based program that does what Gimp does? > Did you try eps rather than ps? > > Eric Yes, I tried eps. Word won't recognize that neither. As to the EMF format, I downloaded the package and attempted to apply the patch. Failed - probably because it's intended for 0.85 only. I am running 0.90 of MPL. Has anybody added EMF support to MPL 0.90 successfully? Regards, -- John Henry |
From: <kc1...@ya...> - 2007-05-11 18:22:24
|
Chris, All I want is to: a) Insert all of the plots I create with MPL onto a Word document. As I said before, my version of Word does not recognize the EPS or PS format created by MPL. I am not blaiming MPL. I am just not willing to send Redmond money to see if their later version does the job properly. The version of Word I have does not import PDF files neither. Besides, the PDF backend of MPL fails when the total number of figures is more then 8. b) Be able to cut and paste part of a MPL figure and insert that to Word. I can do it now via the Gimp path but as I explained previously, the quality is not the greatest. I'll look up the cookbook you cited and try that. Thanks, > -----Original Message----- > From: Christopher Barker [mailto:Chr...@no...] > Sent: Friday, May 11, 2007 11:10 AM > To: kc1...@ya... > Subject: Re: [Matplotlib-users] SVG vs PNG > > > kc1...@ya... wrote: > > Thanks everybody for the explanation of svg in Gimp. That makes > > sense. Is there any vector based program that does what Gimp does? > > By definition, No. GIMP is a raster editor, it is similar to other > raster editors, and fundamentally different than vector > graphics programs. > > There is a little overlap, what do you want to do? > > It sound like what you really need is a way to put MPL plots > in a Word > doc. Ideally, you'd use a vector format like EPS, because > that's exactly > what EPS is for. However, MS has never been good at supporting open > formats like that. > > I'd try PDF. Recent versions of Word may do OK with that. > > Otherwise, you're back to a lowest common denominator. I've ended up > just using PNG. If you set the ppi right, it works just fine. > See this > Wiki page for how to do that: > http://www.scipy.org/Cookbook/Matplotlib/AdjustingImageSize -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... -- John Henry |
From: Alan G I. <ai...@am...> - 2007-05-11 18:30:32
|
On Fri, 11 May 2007, kc1...@ya... apparently wrote: > All I want is to: a) Insert all of the plots I create with > MPL onto a Word document. This part should be achievable with PNG. Just set the figsize. I have not had problems... > b) Be able to cut and paste part of a MPL figure and > insert that to Word You can select part of a PDF for copying to the clipboard in Acrobat. fwiw, Alan Isaac |
From: <kc1...@ya...> - 2007-05-11 18:39:43
|
> > On Fri, 11 May 2007, kc1...@ya... > apparently wrote: > > All I want is to: a) Insert all of the plots I create with > > MPL onto a Word document. > > This part should be achievable with PNG. > Just set the figsize. > I have not had problems... > Correct. I am doing that right now. However, because it's not vector based, if I start chaning the figure size, the quality suffers. > > b) Be able to cut and paste part of a MPL figure and > > insert that to Word > > You can select part of a PDF for copying to the clipboard > in Acrobat. > Been there, done that. Doesn't work. It selects the titles, and anotations. Doesn't select the graphs. > fwiw, > Alan Isaac > > > -- John Henry |
From: <And...@gt...> - 2007-05-11 19:04:00
|
kc1...@ya... wrote >>=20 >> On Fri, 11 May 2007, kc1...@ya... apparently wrote: >> > All I want is to: a) Insert all of the plots I create with MPL onto >> > a Word document. >>=20 >> This part should be achievable with PNG. >> Just set the figsize. >> I have not had problems... >>=20 > >Correct. I am doing that right now. However, because it's not=20 >vector based, if I start chaning the figure size, the quality suffers. > >> > b) Be able to cut and paste part of a MPL figure and insert that to >> > Word >>=20 >> You can select part of a PDF for copying to the clipboard in Acrobat. >>=20 > >Been there, done that. Doesn't work. It selects the titles,=20 >and anotations. Doesn't select the graphs. > Perhaps you could use OpenOffice Draw as described in this url: http://wolfey.sillydog.org/blog/2006/09/20/vector-image-file-conversion- svg-wmf/ It's a shame that it takes such a workaround. =20 |
From: <kc1...@ya...> - 2007-05-11 19:23:33
|
Bingo! My prayer appears to have been answered. inkscape has no trouble reading the .svg files created by MPL, and Word has no trouble reading the .eps files created by inkscape. So, at least I can use it to preserve the vectors. Too bad inkscape doesn't read .eps directly (complaining...complaining....) :=) inkscape treats everything as objects and allows you to ungroup the plots into elements and then you can play with each of the elements individually. When I am done, I can then insert into Word. Too bad it doesn't allow me to paste the objects directly over to Windows but I am not complaining. Thanks, Fernando. > -----Original Message----- > From: Fernando Perez [mailto:fpe...@gm...] > Sent: Friday, May 11, 2007 11:05 AM > To: kc1...@ya... > Cc: mat...@li... > Subject: Re: [Matplotlib-users] SVG vs PNG > > > On 5/11/07, kc1...@ya... > <kc1...@ya...> wrote: > > Thanks everybody for the explanation of svg in Gimp. That makes > > sense. Is there any vector based program that does what Gimp does? > > Try inkscape. I've used it successfully for simple things, > though I've never tried to handle a MPL SVG file with it. > > cheers, > > f > -- John Henry |
From: Christopher B. <Chr...@no...> - 2007-05-11 19:32:57
|
> inkscape has no trouble reading the .svg files created by MPL, and > Word has no trouble reading the .eps files created by inkscape. hmm. I wonder what it is about MPL's .eps files that Word doesn't like. Bug in MPL or Word?? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: Fernando P. <fpe...@gm...> - 2007-05-11 21:02:39
|
On 5/11/07, kc1...@ya... <kc1...@ya...> wrote: > Bingo! My prayer appears to have been answered. > > inkscape has no trouble reading the .svg files created by MPL, and Word has no trouble reading the .eps files created by inkscape. So, at least I can use it to preserve the vectors. Too bad inkscape doesn't read .eps directly (complaining...complaining....) :=) Did you install pstoedit? If you do, you'll see that inkscape will then be able to load .eps/.ps files in a fully editable format. I've used it to fix decade-old plots for which the only thing around was the eps file. > Thanks, Fernando. Glad it helped. Cheers, f |
From: Steve S. <el...@gm...> - 2007-05-12 13:52:37
Attachments:
error.log
|
Fernando Perez wrote: > > Did you install pstoedit? If you do, you'll see that inkscape will > then be able to load .eps/.ps files in a fully editable format. I've > used it to fix decade-old plots for which the only thing around was > the eps file. > I tried to export an .svg from MPL (0.90.0rev3131) with rcParams['text.usetex']=True and got a NotImplementedError (same for the pdf backend with usetex, see attached log). I was wondering: Is it (technically) possible to have .svg export capabilities with usetex-support and if so, has there been no need for this feature so far (not that I need it urgently, just curious..)? Anyway, to work with MPL-images (.ps/.eps) in Inkscape, I installed pstoedit but loading these files doesn't work (seems not to recognize them as images). Sorry if I'm driving the Inkscape-stuff a bit OT here, but: What version of Inkscape & friends are you using? I'm using pstoedit 3.44, Inkscape 0.44.1. The Latex-formula-feature of Inkscape is also not working and the error seems related to pstoedit. Maybe someone had similar experiences ... Thanks for any hint! -- cheers, steve I love deadlines. I like the whooshing sound they make as they fly by. -- Douglas Adams |
From: Fernando P. <fpe...@gm...> - 2007-05-12 16:57:12
|
On 5/12/07, Steve Schmerler <el...@gm...> wrote: > Fernando Perez wrote: > > > > Did you install pstoedit? If you do, you'll see that inkscape will > > then be able to load .eps/.ps files in a fully editable format. I've > > used it to fix decade-old plots for which the only thing around was > > the eps file. > > > > I tried to export an .svg from MPL (0.90.0rev3131) with > rcParams['text.usetex']=True and got a NotImplementedError (same for the pdf backend > with usetex, see attached log). I was wondering: Is it (technically) possible to have > .svg export capabilities with usetex-support and if so, has there been no need for > this feature so far (not that I need it urgently, just curious..)? There's actually a real MPL bug in there (not just the NotImplementedError) but I'll report it separately in a minute. > Anyway, to work with MPL-images (.ps/.eps) in Inkscape, I installed pstoedit but > loading these files doesn't work (seems not to recognize them as images). > Sorry if I'm driving the Inkscape-stuff a bit OT here, but: > What version of Inkscape & friends are you using? I'm using pstoedit 3.44, Inkscape > 0.44.1. The Latex-formula-feature of Inkscape is also not working and the error seems > related to pstoedit. Maybe someone had similar experiences ... > > Thanks for any hint! Well, unfortunately it seems that inkscape is crashing python itself... I made a trivial .eps in mpl with: In [1]: plot(range(10)) Out[1]: [<matplotlib.lines.Line2D instance at 0x8f45a8c>] In [2]: title(r'Some \LaTeX $\int_0^\infty f(\gamma) d\gamma = 1$') Out[2]: <matplotlib.text.Text instance at 0x8f4590c> In [3]: savefig('foo.eps') and when I tried to load it into inkscape, I got this very nasty traceback: *** glibc detected *** /usr/bin/python: free(): invalid pointer: 0x4081e4e0 *** ======= Backtrace: ========= /lib/tls/i686/cmov/libc.so.6[0x400ee7cd] /lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0x400f1e30] /usr/lib/skencil/Sketch/../Lib/streamfilter.so[0x404e7ce5] /usr/lib/skencil/Sketch/../Lib/streamfilter.so[0x404e7cd2] /usr/bin/python[0x8110e6a] /usr/bin/python(PyEval_EvalCodeEx+0x313)[0x80c9903] etc. At this point, this is really becoming OT for the mpl list, so I'll stop. But if anyone has the time, it might be worth sending this example to the inkscape list so they work on it and hopefully fix it. Cheers, f |
From: <jk...@ik...> - 2007-05-12 14:38:04
|
Steve Schmerler <el...@gm...> writes: > I was wondering: Is it (technically) possible to have .svg export > capabilities with usetex-support and if so, has there been no need > for this feature so far The usetex feature is implemented for the Agg backend (i.e., png output) using dvipng, and for the PostScript backend using (I think) dvips with psfrag, and neither of these is easily generalizable to work with svg or pdf. However, some time ago I committed the beginnings of a dvi parser and a little support code in the pdf backend, enough to get a small demo almost working: http://article.gmane.org/gmane.comp.python.matplotlib.devel/2687 I have no idea how difficult it would be to get this working in the svg backend, but in the pdf backend the biggest hurdle is probably in generalizing the current font support so that the TeX fonts can be embedded. -- Jouni K. Seppänen http://www.iki.fi/jks |
From: <jo...@fh...> - 2007-05-12 15:58:47
Attachments:
PGP.sig
|
On 12.05.2007, at 16:37, Jouni K. Sepp=E4nen wrote: > for the PostScript backend using (I think) dvips with psfrag, and =20 > neither of these is easily generalizable to work with svg or pdf. What's the problem of using dvi2pdf, dvipdfm, dvipdfmx, or soemthing =20 like that for PDF? Looks quite similar to the dvips route for Postscript to me? Greetings, Jochen --=20 Einigkeit und Recht und Freiheit http://www.Jochen-=20 Kuepper.de Libert=E9, =C9galit=E9, Fraternit=E9 GnuPG key: = CC1B0B4D Sex, drugs and rock-n-roll |
From: <jk...@ik...> - 2007-05-12 16:22:08
|
Jochen Küpper <jo...@fh...> writes: >> for the PostScript backend using (I think) dvips with psfrag, and >> neither of these is easily generalizable to work with svg or pdf. > > What's the problem of using dvi2pdf, dvipdfm, dvipdfmx, or soemthing > like that for PDF? > Looks quite similar to the dvips route for Postscript to me? The dvips route is not so simple. First matplotlib creates the PostScript file with all text strings replaced by tags, and this is fed to LaTeX using \includegraphics. The psfrag package replaces the tags with LaTeX constructs, and then the dvi file is converted using dvips into the final postscript file. There is no equivalent to psfrag that works with pdf (at least none that I know of). Probably you could create a pdf file without any texts and input that in your LaTeX file, and then -- with sufficient LaTeX-fu -- render the text strings at the correct positions, and run the LaTeX file through pdflatex, because pdftex includes a pdf parser so that you can do \includegraphics{foo.pdf}. So in that sense it may be generalizable, but it won't be a direct port of the ps backend. -- Jouni K. Seppänen http://www.iki.fi/jks |
From: Christopher B. <Chr...@no...> - 2007-05-14 18:13:03
|
Jouni K. Sepp=E4nen wrote: > However, some time ago I committed the > beginnings of a dvi parser and a little support code in the pdf > backend, enough to get a small demo almost working: >=20 > http://article.gmane.org/gmane.comp.python.matplotlib.devel/2687 >=20 > I have no idea how difficult it would be to get this working=20 I have no idea either, but thanks for getting this started -- it is=20 absolutely the way to go -- that's the whole point of DVI (DeVice=20 Independent) -CHB --=20 Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: <kc1...@ya...> - 2007-05-11 19:28:56
|
Yes, that's what I've been forced to do. The problem with that is that it forces you to fix the size of the figures in your paper. When I reformat things around in subsequent revisions, I have to go back and recreate the figures - if the spacing changes. I would much rather retaining the ability to rescale in Word. Yes, I know that it does change the font size. But as I indicated in my other message, I think Inkscape is the solution. I am still playing around with it and see if that really does it but it looks real promising. Regards, -----Original Message----- From: David Huard [mailto:dav...@gm...] Sent: Friday, May 11, 2007 12:06 PM To: kc1...@ya... Subject: Re: [Matplotlib-users] SVG vs PNG My advice would be to define the size you'll want the figure to be on paper once printed, and set the resolution to 300 dpi (for paper) or 100 (for screen): e.g. fig.savefig(figsize=(8,8), dpi=300) Rescaling the figure is generally a bad idea for inclusion in a paper since it changes the font size as well. To get a nice output, you try to keep the same font size for both paper and figures, and the simplest was to do this is by avoiding rescaling. Cheers, David 2007/5/11, kc1...@ya... < kc1...@ya...>: > > On Fri, 11 May 2007, kc1...@ya... > apparently wrote: > > All I want is to: a) Insert all of the plots I create with > > MPL onto a Word document. > > This part should be achievable with PNG. > Just set the figsize. > I have not had problems... > Correct. I am doing that right now. However, because it's not vector based, if I start chaning the figure size, the quality suffers. > > b) Be able to cut and paste part of a MPL figure and > > insert that to Word > > You can select part of a PDF for copying to the clipboard > in Acrobat. > Been there, done that. Doesn't work. It selects the titles, and anotations. Doesn't select the graphs. > fwiw, > Alan Isaac > > > -- John Henry ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- John Henry |
From: <kc1...@ya...> - 2007-05-11 19:41:58
|
> > inkscape has no trouble reading the .svg files created by MPL, and > > Word has no trouble reading the .eps files created by inkscape. > > hmm. I wonder what it is about MPL's .eps files that Word > doesn't like. > > > Bug in MPL or Word?? Most likely Word. It's very picky. I have .eps files created by other programs where Word would simply tell you that it's not a supported format. Doesn't say why. -- John Henry |
From: <kc1...@ya...> - 2007-05-11 19:45:44
|
Actually, Gimp is the problem. It's obvious they don't have a very good rendering engine. The plots looks very good under Inkscape. > The quality of the svg plot depends in large plot on the svg renderer > -- perhaps word doesn't do a good job rendering SVG? The > matplotlib PNG files look good because agg is a good rendering engine. > > JDH > -- John Henry |
From: Matt N. <new...@ca...> - 2007-05-11 21:45:05
|
> All I want is to: a) Insert all of the plots I create with MPL onto a Word document. If you're fortunate enough to be using the wx backend, there is a Copy_to_Clipboard() method which works great: In a wx App, Ctrl-C can easily be bound to copy the figure to the clipboard, then paste it into apps such as Word. I tend to find better results from saving a higher-resolution PNG and inserting that into documents, but this copy-and-paste works great for quick prints (whereas printing directly from a wxApp seems to be very fragile and change with every wxPython release) I think pylab may not give you access to the Copy_to_Clipboard() method. --Matt Newville |
From: <kc1...@ya...> - 2007-05-14 23:08:36
|
Not exactly OT. I would not recommend using .eps format in order to export MPL graphs for Inkscape. I've been playing around with Inkscape for a few days now and I've been using .svg exclusively and don't have any problem. As I said before, I like the fact that once I am inside Inscape, I can do an ungroup of the graph, and work with all of the plotting elements individually. In fact, I just discover a nice way to "cut and paste" a particular subplot over to PowerPoint. This gives me very high quality graphs in Power Point (I can scale all I want). No more fuzzy, ugly-looking Power Point charts. Here's how: a) Create MPL plots in .svg format b) From Inscape, read in .svg c) Select subplot and ungroup d) Copy and paste to a new page e) Shrink the page down to the size of the object f) Save as emf file g) Import into PowerPoint In addition, I am also using Inscape to get around the problem with the PDF backend in MPL. I reported previously that I am unable to save more then 8 PDF files per execuation. Now, I save the files in .svg format, then invoke Inscape in command line mode and export the file in pdf format. Works great. Regards, > -----Original Message----- > From: mat...@li... > [mailto:mat...@li...] On > Behalf Of Fernando Perez > Sent: Saturday, May 12, 2007 9:57 AM > To: Steve Schmerler > Cc: mat...@li... > Subject: Re: [Matplotlib-users] SVG vs PNG > > > On 5/12/07, Steve Schmerler wrote: > > Fernando Perez wrote: > > > > > > Did you install pstoedit? If you do, you'll see that > inkscape will > > > then be able to load .eps/.ps files in a fully editable format. > > > I've used it to fix decade-old plots for which the only > thing around > > > was the eps file. > > > > > > > I tried to export an .svg from MPL (0.90.0rev3131) with > > rcParams['text.usetex']=True and got a NotImplementedError > (same for > > the pdf backend with usetex, see attached log). I was > wondering: Is it > > (technically) possible to have .svg export capabilities with > > usetex-support and if so, has there been no need for this > feature so > > far (not that I need it urgently, just curious..)? > > There's actually a real MPL bug in there (not just the > NotImplementedError) but I'll report it separately in a minute. > > > Anyway, to work with MPL-images (.ps/.eps) in Inkscape, I installed > > pstoedit but loading these files doesn't work (seems not to > recognize > > them as images). Sorry if I'm driving the Inkscape-stuff a bit OT > > here, but: What version of Inkscape & friends are you > using? I'm using > > pstoedit 3.44, Inkscape 0.44.1. The Latex-formula-feature > of Inkscape > > is also not working and the error seems related to pstoedit. Maybe > > someone had similar experiences ... > > > > Thanks for any hint! > > Well, unfortunately it seems that inkscape is crashing python > itself... I made a trivial .eps in mpl with: > > In [1]: plot(range(10)) > Out[1]: [<matplotlib.lines.Line2D instance at 0x8f45a8c>] > > In [2]: title(r'Some \LaTeX $\int_0^\infty f(\gamma) d\gamma = 1$') > Out[2]: <matplotlib.text.Text instance at 0x8f4590c> > > In [3]: savefig('foo.eps') > > > and when I tried to load it into inkscape, I got this very > nasty traceback: > > *** glibc detected *** /usr/bin/python: free(): invalid > pointer: 0x4081e4e0 *** ======= Backtrace: ========= > /lib/tls/i686/cmov/libc.so.6[0x400ee7cd] > /lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0x400f1e30] > /usr/lib/skencil/Sketch/../Lib/streamfilter.so[0x404e7ce5] > /usr/lib/skencil/Sketch/../Lib/streamfilter.so[0x404e7cd2] > /usr/bin/python[0x8110e6a] > /usr/bin/python(PyEval_EvalCodeEx+0x313)[0x80c9903] > > etc. > > At this point, this is really becoming OT for the mpl list, > so I'll stop. But if anyone has the time, it might be worth > sending this example to the inkscape list so they work on it > and hopefully fix it. > > Cheers, > > f -- John Henry |
From: <kc1...@ya...> - 2007-05-15 16:59:40
|
This SVG format gets better everyday. For those of you unfortunate enough not to have the choice of freedom from the M$ Monopoly, I discovered that Visio supports SVG file directly. In fact, the rendering is better then Inscape and get this: you can copy and paste *directly* over to PowerPoint and Word and you can even embed it as a Visio object. The quality is superb! Even the browser can read SVG file (somewhat - the quality isn't very good). > -----Original Message----- > From: Derek Hohls > Sent: Tuesday, May 15, 2007 12:19 AM > Subject: Re: [Matplotlib-users] SVG vs PNG > > > For those of you fortunate enough to have the > choice be free from the M$ Monopoly, you can > use the Open Office Impress package to do > something similar to the steps below. > > However, if you want to work directly with SVG > files, then you should install the SVG "import > filter", available from: http://www.ipd.uka.de/~hauma/svg-import/ > (Installation and use are described very clearly). > > If you have saved an SVG file from MPL, you > can now open it in Open Office Draw, ungroup > it (you will need to repeat this command a > number of times) and edit the elements. > Save the file as an Open Office drawing > (.odg) for use in other Open Office applications. > > One strange thing I encountered was that the > default background for fonts was blue? > This seems to be a problem with the > import filter, and has been reported on the > wiki support page: > http://wiki.services.openoffice.org/wiki/SVG_User_Experiences# > Blue_background_for_all_text_elements > > but not fixed. To change this manually: > left-click to select a text element, then > right-click and choosing Edit Style... and > then select White or None from the Area menu. > > > *** As a footnote, I see that an integrated > SVG filter, designed to be shipped as part of > Open Office, is scheduled to be developed as > part of the Google 2007 Summer of Code - see: > http://wiki.services.openoffice.org/wiki/Summer_of_Code_2007/p > roposals#Draw.2FImpress:_SVG_Import_Filter > > > >>> <kc1...@ya...> 2007/05/15 01:08 AM >>> > > Not exactly OT. > > I would not recommend using .eps format in order to > export MPL graphs for Inkscape. I've been playing > around with Inkscape for a few days now and I've been > using .svg exclusively and don't have any problem. > > As I said before, I like the fact that once I am > inside Inscape, I can do an ungroup of the graph, and > work with all of the plotting elements individually. > In fact, I just discover a nice way to "cut and paste" > a particular subplot over to PowerPoint. This gives > me very high quality graphs in Power Point (I can > scale all I want). No more fuzzy, ugly-looking Power > Point charts. > > Here's how: > > a) Create MPL plots in .svg format > b) From Inscape, read in .svg > c) Select subplot and ungroup > d) Copy and paste to a new page > e) Shrink the page down to the size of the object > f) Save as emf file > g) Import into PowerPoint > > In addition, I am also using Inscape to get around the > problem with the PDF backend in MPL. I reported > previously that I am unable to save more then 8 PDF > files per execuation. Now, I save the files in .svg > format, then invoke Inscape in command line mode and > export the file in pdf format. Works great. > > Regards, > > > > > > -----Original Message----- > > From: mat...@li... > > > > [mailto:mat...@li...] > On > > Behalf Of Fernando Perez > > Sent: Saturday, May 12, 2007 9:57 AM > > To: Steve Schmerler > > Cc: mat...@li... > > Subject: Re: [Matplotlib-users] SVG vs PNG > > > > > > On 5/12/07, Steve Schmerler wrote: > > > Fernando Perez wrote: > > > > > > > > Did you install pstoedit? If you do, you'll see > that > > inkscape will > > > > then be able to load .eps/.ps files in a fully > editable format. > > > > I've used it to fix decade-old plots for which > the only > > thing around > > > > was the eps file. > > > > > > > > > > I tried to export an .svg from MPL (0.90.0rev3131) > with > > > rcParams['text.usetex']=True and got a > NotImplementedError > > (same for > > > the pdf backend with usetex, see attached log). I > was > > wondering: Is it > > > (technically) possible to have .svg export > capabilities with > > > usetex-support and if so, has there been no need > for this > > feature so > > > far (not that I need it urgently, just curious..)? > > > > There's actually a real MPL bug in there (not just > the > > NotImplementedError) but I'll report it separately > in a minute. > > > > > Anyway, to work with MPL-images (.ps/.eps) in > Inkscape, I installed > > > pstoedit but loading these files doesn't work > (seems not to > > recognize > > > them as images). Sorry if I'm driving the > Inkscape-stuff a bit OT > > > here, but: What version of Inkscape & friends are > you > > using? I'm using > > > pstoedit 3.44, Inkscape 0.44.1. The > Latex-formula-feature > > of Inkscape > > > is also not working and the error seems related to > pstoedit. Maybe > > > someone had similar experiences ... > > > > > > Thanks for any hint! > > > > Well, unfortunately it seems that inkscape is > crashing python > > itself... I made a trivial .eps in mpl with: > > > > In [1]: plot(range(10)) > > Out[1]: [<matplotlib.lines.Line2D instance at > 0x8f45a8c>] > > > > In [2]: title(r'Some \LaTeX $\int_0^\infty f(\gamma) > d\gamma = 1$') > > Out[2]: <matplotlib.text.Text instance at 0x8f4590c> > > > > In [3]: savefig('foo.eps') > > > > > > and when I tried to load it into inkscape, I got > this very > > nasty traceback: > > > > *** glibc detected *** /usr/bin/python: free(): > invalid > > pointer: 0x4081e4e0 *** ======= Backtrace: ========= > > > /lib/tls/i686/cmov/libc.so.6[0x400ee7cd] > > /lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0x400f1e30] > > > /usr/lib/skencil/Sketch/../Lib/streamfilter.so[0x404e7ce5] > > > /usr/lib/skencil/Sketch/../Lib/streamfilter.so[0x404e7cd2] > > /usr/bin/python[0x8110e6a] > > /usr/bin/python(PyEval_EvalCodeEx+0x313)[0x80c9903] > > > > etc. > > > > At this point, this is really becoming OT for the > mpl list, > > so I'll stop. But if anyone has the time, it might > be worth > > sending this example to the inkscape list so they > work on it > > and hopefully fix it. > > > > Cheers, > > > > f > > > -- > John Henry > > -------------------------------------------------------------- -- John Henry |
From: Fernando P. <fpe...@gm...> - 2007-05-11 18:05:05
|
On 5/11/07, kc1...@ya... <kc1...@ya...> wrote: > Thanks everybody for the explanation of svg in Gimp. That makes sense. Is there any vector based program that does what Gimp does? Try inkscape. I've used it successfully for simple things, though I've never tried to handle a MPL SVG file with it. cheers, f |