You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a problem if I have usetex=True. A simple script that produces the error is
import numpy as np
import matplotlib as mpl
from matplotlib import pyplot as plt
mpl.rc('text', usetex=True)
x = np.linspace(0.,5.,100)
y = np.exp(-x)
plt.plot(x,y,'k',linewidth=2)
plt.savefig("plot.eps",bbox_inches=0)
Preview cannot open plot.eps (it fails to convert it to pdf). On Arch Linux (for which I have matplotlib 1.3.1 on Python 3.3.3), the example script does not produce a corrupt file, and the difference appears to be in a few lines at the end of the file. plot.eps produced on the Mac has the lines
%%PageTrailer
%%Trailer
cleartomark
countdictstack
exch sub { end } repeat
restore
end
%%EOF
whereas the Linux plot.eps has instead
%%PageTrailer
%%Trailer
cleartomark
end
countdictstack
exch sub { end } repeat
restore
%%EOF
If I manually edit plot.eps using nano on the Mac and move the line with the word 'end' to where it is in the Linux file, then plot.eps opens in Preview and the problem disappears.
The text was updated successfully, but these errors were encountered:
This is a problem if I have usetex=True. A simple script that produces
the error is
|import numpy as np
import matplotlib as mpl
What happens on the Mac if you insert the following here?
mpl.use('ps')
from matplotlib import pyplot as plt
mpl.rc('text', usetex=True)
x = np.linspace(0.,5.,100)
y = np.exp(-x)
plt.plot(x,y,'k',linewidth=2)
plt.savefig("plot.eps",bbox_inches=0)
|
Preview cannot open plot.eps (it fails to convert it to pdf). On Arch
Linux (for which I have matplotlib 1.3.1 on Python 3.3.3), the example
script does not produce a corrupt file, and the difference appears to be
in a few lines at the end of the file. plot.eps produced on the Mac has
the lines
|%%PageTrailer
%%Trailer
cleartomark
countdictstack
exch sub { end } repeat
restore
end
%%EOF
|
whereas the Linux plot.eps has instead
|%%PageTrailer
%%Trailer
cleartomark
end
countdictstack
exch sub { end } repeat
restore
%%EOF
|
If I manually edit plot.eps using nano on the Mac and move the line with
the word 'end' to where it is in the Linux file, then plot.eps opens in
Preview and the problem disappears.
—
Reply to this email directly or view it on GitHub #2748.
@maxwellsdemon137 OK, that's what I expected, I just wanted to be sure. I think that with usetex=True the trailer is being written by ghostscript, so the problem on the Mac would be with the version of ghostscript on the Mac.
This is a problem if I have usetex=True. A simple script that produces the error is
Preview cannot open plot.eps (it fails to convert it to pdf). On Arch Linux (for which I have matplotlib 1.3.1 on Python 3.3.3), the example script does not produce a corrupt file, and the difference appears to be in a few lines at the end of the file. plot.eps produced on the Mac has the lines
whereas the Linux plot.eps has instead
If I manually edit plot.eps using nano on the Mac and move the line with the word 'end' to where it is in the Linux file, then plot.eps opens in Preview and the problem disappears.
The text was updated successfully, but these errors were encountered: