Re: [Matplotlib-users] EPS files with LaTeX are invalid

2010-04-07 Thread Jae-Joon Lee
I tried to take a look but, pstopdf in my linux box works okay (it
converted test_tex_r8216.eps  fine also) and I'm afraid that I may not
be able to track this down.

Just in case, can you check if using a different distiller makes any
difference? I believe you're using a ghostscript (or none where
ghostscript is force for usetex=True). See if using xpdf works.

mpl.rc(ps, usedistiller=xpdf)

Regards,

-JJ


On Fri, Apr 2, 2010 at 11:44 AM, Thomas Robitaille
thomas.robitai...@gmail.com wrote:
 I just tried running epstopdf, and this does work correctly, so maybe now the 
 only issue is that Preview.app on mac always uses pstopdf, even for eps 
 files? (which then is not a matplotlib issue) I also checked that giving the 
 file the extension '.ps' produces a ps file, and that does open correctly in 
 Preview.app.

 Cheers,

 Tom

 On Apr 2, 2010, at 11:20 AM, Michael Droettboom wrote:

 At least on my Linux box with gs 7.07, I have to use epstopdf (not pstopdf) 
 to convert an eps file to a pdf.  ps2pdf does work for both .ps and .eps 
 files however.

 It looks like the 0.99.1.1 file is not in fact an .eps file, but a .ps file, 
 (it certainly hasn't had the ps2eps function run on it) and I think it was 
 probably a bug (now fixed) that 0.99.1.1 was writing out the wrong kind of 
 file.
 It seems the relevant change is in r8102: fix some issues in the bbox after 
 the postscript distiller is run.  This change removed a commented out call 
 to ps2eps.  I'm a bit out of my depth here as to why that change was made, 
 and why .eps files seemingly haven't been true .eps files for a long time 
 prior to that change.  Anyone else?

 Mike

 Thomas Robitaille wrote:
 It seems that removing 'restore' on line 1073 of the test_tex_r8216.eps 
 file fixes the problem, although I don't understand postscript well enough 
 to understand why that is.

 Thomas

 On Apr 2, 2010, at 9:30 AM, Michael Droettboom wrote:


 Can you provide us with the EPS file?  What version of LaTeX is this?

 Mike

 Thomas Robitaille wrote:

 Hello,

 I upgraded to the latest svn version of matplotlib today, and found that 
 eps files produced with the system latex now seem to be invalid. For 
 example, if I run the following script

 import matplotlib
 matplotlib.use('Agg')
 import matplotlib.pyplot as mpl

 mpl.rc('text', usetex=False)

 fig = mpl.figure()
 ax = fig.add_subplot(1,1,1)
 fig.savefig('test_notex.eps')

 mpl.rc('text', usetex=True)

 fig = mpl.figure()
 ax = fig.add_subplot(1,1,1)
 fig.savefig('test_tex.eps')

 and try running pstopdf on them (on MacOS 10.6) I get the following

 air:air tom$ pstopdf test_tex.eps %%[ Warning: Empty job. No PDF file 
 produced. ] %%
 air:air tom$ pstopdf test_notex.eps air:air tom$ So the file with the 
 system LaTeX enabled no longer works. ps2pdf still works, but the error 
 with pstopdf is important, because for example Preview.app on mac relies 
 on pstopdf, not ps2pdf.

 I tried this on two different computers under MacOS 10.6, and tried with 
 ghostscript 8.70 and 8.71 installed, and the problem occurs either way.

 Does anyone know what might be causing this? I submitted a bug report a 
 little while back about this

 https://sourceforge.net/tracker/?func=detailaid=2974953group_id=80706atid=560720

 Thanks in advance for any help,

 Thomas





 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 --
 Michael Droettboom
 Science Software Branch
 Operations and Engineering Division
 Space Telescope Science Institute
 Operated by AURA for NASA





 --
 Michael Droettboom
 Science Software Branch
 Operations and Engineering Division
 Space Telescope Science Institute
 Operated by AURA for NASA



 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks 

Re: [Matplotlib-users] EPS files with LaTeX are invalid

2010-04-05 Thread Jae-Joon Lee
On Fri, Apr 2, 2010 at 11:20 AM, Michael Droettboom md...@stsci.edu wrote:
 It seems the relevant change is in r8102: fix some issues in the bbox
 after the postscript distiller is run.  This change removed a commented
 out call to ps2eps.  I'm a bit out of my depth here as to why that
 change was made, and why .eps files seemingly haven't been true .eps
 files for a long time prior to that change.  Anyone else?


To my best knowledge, the bbox of the eps output before r8102 was
incorrect for some cases. r8102 was my attempt to fix some of the
issues. The ps backend is quite complicated in how final output is
produced (psfrag, distiller, pstoeps), and this often messes up the
initially specified bbox and results in incorrect ones. While I think
I fixed some of the issues, there still could be some left. And I hope
someone who is more knowledgeable than me take a look.

For the reported issue, I haven't take a time to investigate (but I
will soon), but I doubt if it is an issue of pstoeps function (as I
said, it seems to write a matching save-restore pair).

Regards,

-JJ

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] EPS files with LaTeX are invalid

2010-04-02 Thread Thomas Robitaille
It seems that removing 'restore' on line 1073 of the test_tex_r8216.eps file 
fixes the problem, although I don't understand postscript well enough to 
understand why that is.

Thomas

On Apr 2, 2010, at 9:30 AM, Michael Droettboom wrote:

 Can you provide us with the EPS file?  What version of LaTeX is this?
 
 Mike
 
 Thomas Robitaille wrote:
 Hello,
 
 I upgraded to the latest svn version of matplotlib today, and found that eps 
 files produced with the system latex now seem to be invalid. For example, if 
 I run the following script
 
 import matplotlib
 matplotlib.use('Agg')
 import matplotlib.pyplot as mpl
 
 mpl.rc('text', usetex=False)
 
 fig = mpl.figure()
 ax = fig.add_subplot(1,1,1)
 fig.savefig('test_notex.eps')
 
 mpl.rc('text', usetex=True)
 
 fig = mpl.figure()
 ax = fig.add_subplot(1,1,1)
 fig.savefig('test_tex.eps')
 
 and try running pstopdf on them (on MacOS 10.6) I get the following
 
 air:air tom$ pstopdf test_tex.eps %%[ Warning: Empty job. No PDF file 
 produced. ] %%
 air:air tom$ pstopdf test_notex.eps air:air tom$ 
 So the file with the system LaTeX enabled no longer works. ps2pdf still 
 works, but the error with pstopdf is important, because for example 
 Preview.app on mac relies on pstopdf, not ps2pdf.
 
 I tried this on two different computers under MacOS 10.6, and tried with 
 ghostscript 8.70 and 8.71 installed, and the problem occurs either way.
 
 Does anyone know what might be causing this? I submitted a bug report a 
 little while back about this
 
 https://sourceforge.net/tracker/?func=detailaid=2974953group_id=80706atid=560720
 
 Thanks in advance for any help,
 
 Thomas
 
 
 
 
 
 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
 
 -- 
 Michael Droettboom
 Science Software Branch
 Operations and Engineering Division
 Space Telescope Science Institute
 Operated by AURA for NASA
 


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] EPS files with LaTeX are invalid

2010-04-02 Thread Jae-Joon Lee
I just had a quick look, but while extra restore could be a problem,
the erroneous one may not be the one at line 1073, but the one at line
1066.

I believe that the restore at 1073 is written by pstoeps function
in backend_ps.py, and this function did write a matching save at
line 11.

Regards,

-JJ




On Fri, Apr 2, 2010 at 10:35 AM, Thomas Robitaille
thomas.robitai...@gmail.com wrote:
 It seems that removing 'restore' on line 1073 of the test_tex_r8216.eps file 
 fixes the problem, although I don't understand postscript well enough to 
 understand why that is.

 Thomas

 On Apr 2, 2010, at 9:30 AM, Michael Droettboom wrote:

 Can you provide us with the EPS file?  What version of LaTeX is this?

 Mike

 Thomas Robitaille wrote:
 Hello,

 I upgraded to the latest svn version of matplotlib today, and found that 
 eps files produced with the system latex now seem to be invalid. For 
 example, if I run the following script

 import matplotlib
 matplotlib.use('Agg')
 import matplotlib.pyplot as mpl

 mpl.rc('text', usetex=False)

 fig = mpl.figure()
 ax = fig.add_subplot(1,1,1)
 fig.savefig('test_notex.eps')

 mpl.rc('text', usetex=True)

 fig = mpl.figure()
 ax = fig.add_subplot(1,1,1)
 fig.savefig('test_tex.eps')

 and try running pstopdf on them (on MacOS 10.6) I get the following

 air:air tom$ pstopdf test_tex.eps %%[ Warning: Empty job. No PDF file 
 produced. ] %%
 air:air tom$ pstopdf test_notex.eps air:air tom$
 So the file with the system LaTeX enabled no longer works. ps2pdf still 
 works, but the error with pstopdf is important, because for example 
 Preview.app on mac relies on pstopdf, not ps2pdf.

 I tried this on two different computers under MacOS 10.6, and tried with 
 ghostscript 8.70 and 8.71 installed, and the problem occurs either way.

 Does anyone know what might be causing this? I submitted a bug report a 
 little while back about this

 https://sourceforge.net/tracker/?func=detailaid=2974953group_id=80706atid=560720

 Thanks in advance for any help,

 Thomas





 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 --
 Michael Droettboom
 Science Software Branch
 Operations and Engineering Division
 Space Telescope Science Institute
 Operated by AURA for NASA



 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] EPS files with LaTeX are invalid

2010-04-02 Thread Michael Droettboom
At least on my Linux box with gs 7.07, I have to use epstopdf (not 
pstopdf) to convert an eps file to a pdf.  ps2pdf does work for both .ps 
and .eps files however.

It looks like the 0.99.1.1 file is not in fact an .eps file, but a .ps 
file, (it certainly hasn't had the ps2eps function run on it) and I 
think it was probably a bug (now fixed) that 0.99.1.1 was writing out 
the wrong kind of file. 

It seems the relevant change is in r8102: fix some issues in the bbox 
after the postscript distiller is run.  This change removed a commented 
out call to ps2eps.  I'm a bit out of my depth here as to why that 
change was made, and why .eps files seemingly haven't been true .eps 
files for a long time prior to that change.  Anyone else?

Mike

Thomas Robitaille wrote:
 It seems that removing 'restore' on line 1073 of the test_tex_r8216.eps file 
 fixes the problem, although I don't understand postscript well enough to 
 understand why that is.

 Thomas

 On Apr 2, 2010, at 9:30 AM, Michael Droettboom wrote:

   
 Can you provide us with the EPS file?  What version of LaTeX is this?

 Mike

 Thomas Robitaille wrote:
 
 Hello,

 I upgraded to the latest svn version of matplotlib today, and found that 
 eps files produced with the system latex now seem to be invalid. For 
 example, if I run the following script

 import matplotlib
 matplotlib.use('Agg')
 import matplotlib.pyplot as mpl

 mpl.rc('text', usetex=False)

 fig = mpl.figure()
 ax = fig.add_subplot(1,1,1)
 fig.savefig('test_notex.eps')

 mpl.rc('text', usetex=True)

 fig = mpl.figure()
 ax = fig.add_subplot(1,1,1)
 fig.savefig('test_tex.eps')

 and try running pstopdf on them (on MacOS 10.6) I get the following

 air:air tom$ pstopdf test_tex.eps %%[ Warning: Empty job. No PDF file 
 produced. ] %%
 air:air tom$ pstopdf test_notex.eps air:air tom$ 
 So the file with the system LaTeX enabled no longer works. ps2pdf still 
 works, but the error with pstopdf is important, because for example 
 Preview.app on mac relies on pstopdf, not ps2pdf.

 I tried this on two different computers under MacOS 10.6, and tried with 
 ghostscript 8.70 and 8.71 installed, and the problem occurs either way.

 Does anyone know what might be causing this? I submitted a bug report a 
 little while back about this

 https://sourceforge.net/tracker/?func=detailaid=2974953group_id=80706atid=560720

 Thanks in advance for any help,

 Thomas





 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
   
 -- 
 Michael Droettboom
 Science Software Branch
 Operations and Engineering Division
 Space Telescope Science Institute
 Operated by AURA for NASA

 

   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] EPS files with LaTeX are invalid

2010-04-02 Thread Thomas Robitaille
I just tried running epstopdf, and this does work correctly, so maybe now the 
only issue is that Preview.app on mac always uses pstopdf, even for eps files? 
(which then is not a matplotlib issue) I also checked that giving the file the 
extension '.ps' produces a ps file, and that does open correctly in Preview.app.

Cheers,

Tom

On Apr 2, 2010, at 11:20 AM, Michael Droettboom wrote:

 At least on my Linux box with gs 7.07, I have to use epstopdf (not pstopdf) 
 to convert an eps file to a pdf.  ps2pdf does work for both .ps and .eps 
 files however.
 
 It looks like the 0.99.1.1 file is not in fact an .eps file, but a .ps file, 
 (it certainly hasn't had the ps2eps function run on it) and I think it was 
 probably a bug (now fixed) that 0.99.1.1 was writing out the wrong kind of 
 file. 
 It seems the relevant change is in r8102: fix some issues in the bbox after 
 the postscript distiller is run.  This change removed a commented out call 
 to ps2eps.  I'm a bit out of my depth here as to why that change was made, 
 and why .eps files seemingly haven't been true .eps files for a long time 
 prior to that change.  Anyone else?
 
 Mike
 
 Thomas Robitaille wrote:
 It seems that removing 'restore' on line 1073 of the test_tex_r8216.eps file 
 fixes the problem, although I don't understand postscript well enough to 
 understand why that is.
 
 Thomas
 
 On Apr 2, 2010, at 9:30 AM, Michael Droettboom wrote:
 
  
 Can you provide us with the EPS file?  What version of LaTeX is this?
 
 Mike
 
 Thomas Robitaille wrote:

 Hello,
 
 I upgraded to the latest svn version of matplotlib today, and found that 
 eps files produced with the system latex now seem to be invalid. For 
 example, if I run the following script
 
 import matplotlib
 matplotlib.use('Agg')
 import matplotlib.pyplot as mpl
 
 mpl.rc('text', usetex=False)
 
 fig = mpl.figure()
 ax = fig.add_subplot(1,1,1)
 fig.savefig('test_notex.eps')
 
 mpl.rc('text', usetex=True)
 
 fig = mpl.figure()
 ax = fig.add_subplot(1,1,1)
 fig.savefig('test_tex.eps')
 
 and try running pstopdf on them (on MacOS 10.6) I get the following
 
 air:air tom$ pstopdf test_tex.eps %%[ Warning: Empty job. No PDF file 
 produced. ] %%
 air:air tom$ pstopdf test_notex.eps air:air tom$ So the file with the 
 system LaTeX enabled no longer works. ps2pdf still works, but the error 
 with pstopdf is important, because for example Preview.app on mac relies 
 on pstopdf, not ps2pdf.
 
 I tried this on two different computers under MacOS 10.6, and tried with 
 ghostscript 8.70 and 8.71 installed, and the problem occurs either way.
 
 Does anyone know what might be causing this? I submitted a bug report a 
 little while back about this
 
 https://sourceforge.net/tracker/?func=detailaid=2974953group_id=80706atid=560720
 
 Thanks in advance for any help,
 
 Thomas
 
 
 
 
 
 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   
 -- 
 Michael Droettboom
 Science Software Branch
 Operations and Engineering Division
 Space Telescope Science Institute
 Operated by AURA for NASA
 

 
  
 
 -- 
 Michael Droettboom
 Science Software Branch
 Operations and Engineering Division
 Space Telescope Science Institute
 Operated by AURA for NASA
 


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] EPS files with LaTeX are invalid

2010-04-01 Thread Thomas Robitaille
Hello,

I upgraded to the latest svn version of matplotlib today, and found that eps 
files produced with the system latex now seem to be invalid. For example, if I 
run the following script

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as mpl

mpl.rc('text', usetex=False)

fig = mpl.figure()
ax = fig.add_subplot(1,1,1)
fig.savefig('test_notex.eps')

mpl.rc('text', usetex=True)

fig = mpl.figure()
ax = fig.add_subplot(1,1,1)
fig.savefig('test_tex.eps')

and try running pstopdf on them (on MacOS 10.6) I get the following

air:air tom$ pstopdf test_tex.eps 
%%[ Warning: Empty job. No PDF file produced. ] %%
air:air tom$ pstopdf test_notex.eps 
air:air tom$ 

So the file with the system LaTeX enabled no longer works. ps2pdf still works, 
but the error with pstopdf is important, because for example Preview.app on mac 
relies on pstopdf, not ps2pdf.

I tried this on two different computers under MacOS 10.6, and tried with 
ghostscript 8.70 and 8.71 installed, and the problem occurs either way.

Does anyone know what might be causing this? I submitted a bug report a little 
while back about this

https://sourceforge.net/tracker/?func=detailaid=2974953group_id=80706atid=560720

Thanks in advance for any help,

Thomas





--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users