dvipdfm problem with the matplotlib eps files

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

dvipdfm problem with the matplotlib eps files

Alan G Isaac
My lovely matplotlib EPS graphics are missing in my PDF
files if I use dvipdfm.  It looks (?) like they are included  
but then are blanked out afterwards.  Any idea why?  I have never had
trouble with other EPS files.

I tried cutting out all the page size stuff in the EPS file
(what is that about?) but it did not help.

Using dvips and ps2pdf gives a fine result.
The EPS files appear to be valid, but must be doing
something that upsets dvipdfm.

Thanks,
Alan Isaac

PS Here is a "stripped down" example file.

%%%%%%%%%%%  temp.tex %%%%%%%%%%%%%%%%%%%
\documentclass[10pt]{book}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htp]
\centering
\includegraphics[width=\textwidth]{temp.eps}
\end{figure}
\end{document}


%%%%%%%%%%%  temp.eps %%%%%%%%%%%%%%%%%%%
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 188 781 765 1214
%%LanguageLevel: 2
%%EndComments
%%BeginProlog
% This copyright applies to everything between here and the %%EndProlog:
% Copyright (C) 2005 artofcode LLC, Benicia, CA.  All rights reserved.
%%BeginResource: procset GS_epswrite_2_0_1001
/GS_epswrite_2_0_1001 80 dict dup begin
/!{bind def}bind def/#{load def}!/N/counttomark #
/rG{3{3 -1 roll 255 div}repeat setrgbcolor}!/G{255 div setgray}!/K{0 G}!
/r6{dup 3 -1 roll rG}!/r5{dup 3 1 roll rG}!/r3{dup rG}!
/w/setlinewidth #/J/setlinecap #
/j/setlinejoin #/M/setmiterlimit #/d/setdash #/i/setflat #
/m/moveto #/l/lineto #/c/rcurveto #
/p{N 2 idiv{N -2 roll rlineto}repeat}!
/P{N 0 gt{N -2 roll moveto p}if}!
/h{p closepath}!/H{P closepath}!
/lx{0 rlineto}!/ly{0 exch rlineto}!/v{0 0 6 2 roll c}!/y{2 copy c}!
/re{4 -2 roll m exch dup lx exch ly neg lx h}!
/f{P fill}!/f*{P eofill}!/s{H stroke}!/S{P stroke}!
end def
%%EndResource
/pagesave null def
%%EndProlog
%%Page: 1 1
%%BeginPageSetup
GS_epswrite_2_0_1001 begin
/pagesave save store
0.012 0.012 scale
%%EndPageSetup
mark
15690 65160 48000 36000 re
255 G
15690 65160 48000 36000 re
f
83.3333 w
2 J
15690 65160 48000 36000 re
S
21690 68760 37200 28800 re
f
K
21690 68760 37200 28800 re
S
cleartomark end pagesave restore
 showpage
%%PageTrailer
%%Trailer
%%Pages: 1





-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: dvipdfm problem with the matplotlib eps files

John Hunter-8
>>>>> "Alan" == Alan G Isaac <[hidden email]> writes:

    Alan> My lovely matplotlib EPS graphics are missing in my PDF
    Alan> files if I use dvipdfm.  It looks (?) like they are included
    Alan> but then are blanked out afterwards.  Any idea why?  I have
    Alan> never had trouble with other EPS files.

We've seen a number of reports of problems in converting matplotlib
eps files -> pdf.  To help us narrow the potential causes of the
problem, could you provide the results of --verbose-helpful with an
example script and rc file, as well as platform and version info for
latex, gs, and otherwise.  Just give us as much information as you
can, what sequence of commands you are issuing and what versions of
each you are using.  Nonstandard rc settings (usetex?) and so on.

matplotlib can be used in a lot of ways.  If you submit a script and
an rc file (if it is different in any way than the default) and the
commands you are typing and some extra version info, then it helps
pare down the list of potential explanations for the problems you are
seeing.

Thanks,
JDH


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: dvipdfm problem with the matplotlib eps files

Darren Dale-4
On Friday 02 September 2005 10:00 pm, John Hunter wrote:

> >>>>> "Alan" == Alan G Isaac <[hidden email]> writes:
>
>     Alan> My lovely matplotlib EPS graphics are missing in my PDF
>     Alan> files if I use dvipdfm.  It looks (?) like they are included
>     Alan> but then are blanked out afterwards.  Any idea why?  I have
>     Alan> never had trouble with other EPS files.
>
> We've seen a number of reports of problems in converting matplotlib
> eps files -> pdf.  To help us narrow the potential causes of the
> problem, could you provide the results of --verbose-helpful with an
> example script and rc file, as well as platform and version info for
> latex, gs, and otherwise.  Just give us as much information as you
> can, what sequence of commands you are issuing and what versions of
> each you are using.  Nonstandard rc settings (usetex?) and so on.
>
> matplotlib can be used in a lot of ways.  If you submit a script and
> an rc file (if it is different in any way than the default) and the
> commands you are typing and some extra version info, then it helps
> pare down the list of potential explanations for the problems you are
> seeing.

Alan, are you using a mac? If so, I wonder if this is related to embedding the
native mac fonts. One user a while back reported having to change his font
settings in matplotlibrc to load the bitstream fonts instead of the apple
fonts.

--
Darren S. Dale

Bard Hall
Department of Materials Science and Engineering
Cornell University
Ithaca, NY. 14850

[hidden email]
http://people.ccmr.cornell.edu/~dd55/


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re[2]: dvipdfm problem with the matplotlib eps files

Alan G Isaac
On Fri, 2 Sep 2005, Darren Dale apparently wrote:
> are you using a mac?

No. I'm on a PC.  And although I in general understand
John's request for a script, I think the EPS file I provided
will be more helpful in pinning this down.  It took me
a while to see it, but finally I got it.

If you look at the bounding box, it is outside all standard
paper sizes.  Now it turns out that pdfwrite assumes a paper
size and clips outside that size.  Thus my figure did not
show because it was clipped.  This does not happen when one
uses dvips because the EPS file is handled *as* an EPS
*before* creation of the PDF file.

Lesson (I think): matplotlib should create its EPS files so
that they have bounding boxes inside a4 width and letter
paper height boundaries, or people will have trouble with
their standard configurations of some standard tools.

Alan Isaac

PS I belive the matplotlib EPS files are written with
a superfluous gsave (just search for 'gsave' and you'll find
it in the file where it should not be), but this is not the
source of my problem.




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: dvipdfm problem with the matplotlib eps files

Darren Dale-4
On Saturday 03 September 2005 1:14 am, Alan G Isaac wrote:

> On Fri, 2 Sep 2005, Darren Dale apparently wrote:
> > are you using a mac?
>
> No. I'm on a PC.  And although I in general understand
> John's request for a script, I think the EPS file I provided
> will be more helpful in pinning this down.  It took me
> a while to see it, but finally I got it.
>
> If you look at the bounding box, it is outside all standard
> paper sizes.  Now it turns out that pdfwrite assumes a paper
> size and clips outside that size.  Thus my figure did not
> show because it was clipped.  This does not happen when one
> uses dvips because the EPS file is handled *as* an EPS
> *before* creation of the PDF file.
>
> Lesson (I think): matplotlib should create its EPS files so
> that they have bounding boxes inside a4 width and letter
> paper height boundaries, or people will have trouble with
> their standard configurations of some standard tools.

I have wondered why the origin of the bbox was shifted in eps files, but it
shouldn't matter. Seeing as how dvips, ps2pdf, and epstopdf all work as
expected, it sounds like a dvipdfm bug to me.

I don't think its a good idea to limit the size of eps figures. At some point,
I will make eps files that are larger than A4 for use in posters.

Darren


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re[2]: dvipdfm problem with the matplotlib eps files

Alan G Isaac
On Sat, 3 Sep 2005, Darren Dale apparently wrote:
> I have wondered why the origin of the bbox was shifted in
> eps files, but it shouldn't matter.

I agree is should not matter.  But it does for GhostScript's
pdfwrite.

> Seeing as how dvips, ps2pdf, and epstopdf all work as
> expected, it sounds like a dvipdfm bug to me.

If it is a bug (and I also believe it is), it's a pdfwrite
bug, assuming that pdfwrite should know how to produce
encapsulated PDF, which has been treated as the case by many
people for many years.

> I don't think its a good idea to limit the size of eps
> figures. At some point, I will make eps files that are
> larger than A4 for use in posters.

As you said, it should not matter.
And it will make pdfwrite work as expected.

Cheers,
Alan Isaac






-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users