When making .EPS image files for publication, I tried to assemble several Graphics
by Grid
. For example, suppose I have:
img1 = ListLinePlot[#, ImageSize -> 500] & /@RandomReal[{0, 1}, {2, 40}];
It looks like:
which is the result of
Export["D:\\plapla\\eps\\test1.png", Grid[{img1}]]
So far so good, everything is fine for PNG files.
However, I need EPS (vectorgraph) rather than png (rid graphics) for publication, so I tried:
Export["D:\\plapla\\eps\\test1.eps", Grid[{img1}]]
Unfortunately, the resulting EPS file looks like (screen shot made with Snipping Tool -- ignore the gray backgroud):
You can see that the right part of image was lost after in the EPS file. The image is "too big" and spreads beyond the bounds and gets cut. I really need these damn EPS files. So how can I fix this problem?
-----------------------------I'm parting line---------------------------------
@george2079 's answer works perfectly except that there's a manual operation(add a line of ".8 dup scale" after "%%EndComments" in eps file by Notepad++).
@Jens 's answer has the advantage of automation and it's fine for the example above, however, it'll change the ratio between the sizes of frameticks and image. for example consider(noticed the FrameTicksStyle and LabelStyle):
img1 = ListLinePlot[#, Frame -> True, LabelStyle -> 20,
FrameLabel -> {"x", "y"}, FrameTicksStyle -> 20,
ImageSize -> 400] & /@ RandomReal[{0, 1}, {4, 40}]
it looks fine in notebook. Export to eps by:
Export["D:\\plapla\\eps\\test-4.eps",
Graphics[{Inset[GraphicsGrid[{img1}], {0, 0}, {Left, Bottom}, 1]},
ImageSize -> 500, PlotRange -> {{0, 1}, {0, 1}}]]
the EPS(after converted by evil Adobe Acrobat Pro) looks like:
It's a said story.too large label and ticks. the image size changes with s
in Graphics[{Inset[___]}, ImageSize -> s,___]
, but the size of label and frameticks remains the same. the fine-tuned ratio between the sizes of frameticks and image was lost...
ImageSize
, tryImageSize -> Full
in yourListPlot
. This should force the size of the plots to adapt so they fill theGrid
elements without overrun. $\endgroup$ImageSize
inListPlot
to adjust my plot image size and lable/frameticks size(because the size of lable/frameticks will not change withImageSize
) $\endgroup$