SourceForge logo
SourceForge logo
Menu

Re: [matplotlib-devel] eps with usetex=False broken icw Ghostscript 9.07?

From: Damon M. <dam...@gm...> - 2013年03月04日 21:33:07
On Mon, Mar 4, 2013 at 6:44 AM, David Verelst <dav...@gm...> wrote:
>
> sorry...forgot to tag the subject as [matplotlib-devel]
The server does it for you.
>
> On 4 March 2013 13:35, David Verelst <dav...@gm...> wrote:
>>
>> Hi,
>>
>> I am running Arch Linux, Matplotlib 1.2, Python 2.7, and today I realized
>> that generating *.eps figures when matplotlib is using the latex output
>> rc('text', usetex=True) results in a corrupted eps figure in combination
>> with Ghostscript 9.07. The png variant of the same figure works fine, eps
>> works fine if usetex=False. Everything works fine when I downgrade back to
>> Ghostscript 9.06.
>>
>> Is this related to this?
>> https://github.com/matplotlib/matplotlib/issues/1693
>> https://github.com/matplotlib/matplotlib/pull/1694
>> If it is, I guess the problem is already solved. Haven't tested that yet
>> (need to build matplitlib from git first...)
>>
>> I have no idea if this is Arch Linux packaging, Ghostscript or Matplotlib
>> issue...hence this email.
>>
>> Regards,
>> David
>>
>>
>> An example, from: http://matplotlib.org/users/usetex.html
>>
>> #!/usr/bin/env python
>> """
>> You can use TeX to render all of your matplotlib text if the rc
>> parameter text.usetex is set. This works currently on the agg and ps
>> backends, and requires that you have tex and the other dependencies
>> described at http://matplotlib.sf.net/matplotlib.texmanager.html
>> properly installed on your system. The first time you run a script
>> you will see a lot of output from tex and associated tools. The next
>> time, the run may be silent, as a lot of the information is cached in
>> ~/.tex.cache
>>
>> """
>> from matplotlib import rc
>> from numpy import arange, cos, pi
>> from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \
>> grid, savefig, show
>>
>>
>> rc('text', usetex=True)
>> rc('font', family='serif')
>> figure(1, figsize=(6,4))
>> ax = axes([0.1, 0.1, 0.8, 0.7])
>> t = arange(0.0, 1.0+0.01, 0.01)
>> s = cos(2*2*pi*t)+2
>> plot(t, s)
>>
>> xlabel(r'\textbf{time (s)}')
>> ylabel(r'\textit{voltage (mV)}',fontsize=16)
>> title(r"\TeX\ is Number
>> $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!",
>> fontsize=16, color='r')
>> grid(True)
>> savefig('tex_demo.eps')
>> savefig('tex_demo.png')
>>
>> show()
>>
>>
>> When converting the eps figure with imagemagick (just to check the file),
>> the following error is given:
>> $ convert Desktop/tex_demo.eps ddd.eps
>> Error: /dictstackunderflow in --end--
>> Operand stack:
>>
>> Execution stack:
>> %interp_exit .runexec2 --nostringval-- --nostringval--
>> --nostringval-- 2 %stopped_push --nostringval-- --nostringval--
>> --nostringval-- false 1 %stopped_push 1900 1 3 %oparray_pop
>> 1899 1 3 %oparray_pop --nostringval-- 1883 1 3 %oparray_pop
>> 1771 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2
>> --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push
>> --nostringval--
>> Dictionary stack:
>> --dict:1169/1684(ro)(G)-- --dict:0/20(G)-- --dict:82/200(L)--
>> Current allocation mode is local
>> Last OS error: No such file or directory
>> Current file position is 102614
>> GPL Ghostscript 9.07: Unrecoverable error, exit code 1
>> Error: /dictstackunderflow in --end--
>> Operand stack:
>>
>> Execution stack:
>> %interp_exit .runexec2 --nostringval-- --nostringval--
>> --nostringval-- 2 %stopped_push --nostringval-- --nostringval--
>> --nostringval-- false 1 %stopped_push 1900 1 3 %oparray_pop
>> 1899 1 3 %oparray_pop --nostringval-- 1883 1 3 %oparray_pop
>> 1771 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2
>> --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push
>> --nostringval--
>> Dictionary stack:
>> --dict:1169/1684(ro)(G)-- --dict:0/20(G)-- --dict:82/200(L)--
>> Current allocation mode is local
>> Last OS error: No such file or directory
>> Current file position is 102614
>> GPL Ghostscript 9.07: Unrecoverable error, exit code 1
>> convert: Postscript delegate failed `Desktop/tex_demo.eps': No such file
>> or directory @ error/ps.c/ReadPSImage/836.
>> convert: no images defined `ddd.eps' @
>> error/convert.c/ConvertImageCommand/3068.
>>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
-- 
Damon McDougall
http://www.damon-is-a-geek.com
Institute for Computational Engineering Sciences
201 E. 24th St.
Stop C0200
The University of Texas at Austin
Austin, TX 78712-1229

View entire thread

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 によって変換されたページ (->オリジナル) /