I suspect the shadowing uses PDF features, which are not available in PostScript.
From the documentations, pgf-blur
:
This effect can be achieved in TikZ/PGF with the circular drop shadow
key,
And from the PGF manual:
In addition to the general shadow
option, there exist special options
like circular shadow
. These can only (sensibly) be used with a special
kind of path (for circular shadow
, a circle) and, thus, they are not
as general. The advantage is, however, that they are more visually
pleasing since these shadows blend smoothly with the background. Note
that these special shadows use fadings, which few printers will
support.
Export the image as PDF and pdfTeX can include it directly without the need to run a converter for the down-graded PostScript file (the conversion is actually done by ghostscript).
I ran into this as well on Windows. I used two solutions, the first one being portable and preferred.
Solution 1. Just read the eps file as text inside Matlab and replace any new lines \n
by carriage returns + new lines \r\n
. To make this portable, just use fwrite with the 'text' flag:
f = 'myplot.eps';
eps = fileread(f);
fd = fopen(f, 'wt');
fwrite(fd, eps);
fclose(fd);
system(['epstopdf ' f]);
Note the wt
instead of just w
in fopen(). This tells fopen() to write in text mode, which will replace any \n
or \r\n\
with whatever the current OS is using, i.e. \r\n
on Windows, \n
on Linux etc.
Solution 2. The other, less portable way (and prone to font embedding issues) is to call Ghostscript directly to convert the .eps to .pdf and then pdfcrop
(from Miktex) to crop to the bounding box for no white margins. You need to install Ghostscript for this, obviously.
gswin32c -sDEVICE=pdfwrite -o myplot.pdf myplot.eps
pdfcrop --hires --margins 0.25 myplot.pdf
This will produce mygraph-crop.pdf
which you can use. You could also use the eps2pdf.pl script from the Xpdf binaries for Windows, but as far as I remember, that script also calls gswin32c. It may pass better/more complete options to gswin32c though (I haven't tried it). Note that you will (most probably) get warnings about font substitutions. The pdf should look fine, I haven't run into any visual issues. If it doesn't look fine then fixing those is a different animal (you'd have to either point Ghostscript to search more font paths probably via the -sFONTPATH= switch, or edit the font mapping file).
I just use Solution 1.
Cheers
Best Answer
The following adds an option
crop
tographicx
/\includegraphics
. If enabled, it addspdfcrop
to the conversion of.eps
to.pdf
.Because
pdfcrop
is not added to the restricted shell escape command list, full shell escape is needed:--shell-escape
(TeX Live) or--enable-write18
(MiKTeX).If the file is converted and uptodate, changing the option
crop
does not have an effect. Also the option does not affect other image files.Example usages: