SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Chuck Pepe-R. <cp...@mi...> - 2009年08月31日 18:05:02
Does anybody have a good method for preserving quality and transparancy of
eps images when going from matplotlib to latex to pdf? I can only preserve
the transparency if I save as png and then convert to eps but then I lose
quality. If I save as eps directly, all my patches are opaque despite the
alpha values.
Thanks,
- Chuck
From: John H. <jd...@gm...> - 2009年08月31日 18:10:21
On Mon, Aug 31, 2009 at 1:04 PM, Chuck Pepe-Ranney<cp...@mi...> wrote:
> Does anybody have a good method for preserving quality and transparancy of
> eps images when going from matplotlib to latex to pdf? I can only preserve
> the transparency if I save as png and then convert to eps but then I lose
> quality. If I save as eps directly, all my patches are opaque despite the
> alpha values.
The postscript format does not support transparency. This is not a
matplotlib limitation but a postscript limitation. The best solution
is to save your matplotlib figures as pdf, which is also a vector
format but which does support transparency, and then use pdflatex
JDH
From: Chuck Pepe-R. <cp...@mi...> - 2009年08月31日 20:26:43
Thanks, I guess my problem is that I am using the latex prosper package to
make presentation slides but I cannot compile prosper documents with
pdflatex (see here <http://www.nefkom.net/georg.drenkhahn/prosper/>).
Sorry, I see that this is not a matplotlib specific question so I will try
to find a solution somewhere else.
On Mon, Aug 31, 2009 at 12:10 PM, John Hunter <jd...@gm...> wrote:
> On Mon, Aug 31, 2009 at 1:04 PM, Chuck Pepe-Ranney<cp...@mi...>
> wrote:
> > Does anybody have a good method for preserving quality and transparancy
> of
> > eps images when going from matplotlib to latex to pdf? I can only
> preserve
> > the transparency if I save as png and then convert to eps but then I lose
> > quality. If I save as eps directly, all my patches are opaque despite
> the
> > alpha values.
>
> The postscript format does not support transparency. This is not a
> matplotlib limitation but a postscript limitation. The best solution
> is to save your matplotlib figures as pdf, which is also a vector
> format but which does support transparency, and then use pdflatex
>
> JDH
>
-- 
Chuck Pepe-Ranney
Spear Lab
Colorado School of Mines
Work: (303)384-2477
Cell: (575)313-0993
From: Jouni K. S. <jk...@ik...> - 2009年08月31日 21:00:40
Chuck Pepe-Ranney <cp...@mi...> writes:
>> The postscript format does not support transparency. This is not a
>> matplotlib limitation but a postscript limitation. The best solution
>> is to save your matplotlib figures as pdf, [...]
>
> Thanks, I guess my problem is that I am using the latex prosper
> package to make presentation slides but I cannot compile prosper
> documents with pdflatex [...]
You could try creating pdf output from matplotlib and converting it to
ps using ps2ps2, which will flatten the transparent objects into one big
bitmap:
http://ghostscript.com/doc/current/Ps2ps2.htm
http://www.ghostscript.com/pipermail/gs-devel/2009-April/008328.html
You may need to tweak the ps2write parameters, especially the output
resolution, to find the best tradeoff between file size and quality.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Jae-Joon L. <lee...@gm...> - 2009年08月31日 22:14:39
If you need to stick to eps, another option is to use rasterization
feature of the matplotlib itself. This way you can keep part of plot
in vector format (e.g., texts, lines, etc ) while rasterizing others.
Of course this solution only works if the "quality" of those being
rasterized is not very important.
http://matplotlib.sourceforge.net/examples/misc/rasterization_demo.html
The rasterization in the ps backend works in a way that all the artist
whose zorder is smaller than the specified value are rasterized while
those with larger zorder are not.
Regards,
-JJ
From: Andreas M. <and...@gm...> - 2009年09月01日 16:05:33
Chuck Pepe-Ranney wrote:
> Thanks, I guess my problem is that I am using the latex prosper package to
> make presentation slides but I cannot compile prosper documents with
> pdflatex (see here <http://www.nefkom.net/georg.drenkhahn/prosper/>).
> Sorry, I see that this is not a matplotlib specific question so I will try
> to find a solution somewhere else.
Have a look at the LaTeX beamer package which produces
PDF directly. Thus it's easy to include your PDF pictures
without the need to convert them.
http://latex-beamer.sourceforge.net/
Ciao
Andreas
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /