I need to export some (2D) graphs from mathematica in eps format (only, unfortunately). The graphs are of similar nature (plotted from our different functions), and I have used the PlotRange option to make all the graphs of equal size (in both x and y direction). However, while exporting, we get the exported files of slightly unequal size. This creates a problem while putting in some document, as when we scale it to the same size, the font size looks different (which, needless to say are same for everyone). I tried to use the ImageSize option, but definitely I am making some mistakes, as I am not getting the graphics ( or to be precise getting a small part of the graphics). So my question is, what is the best way to export all of them in a fixed size, say of 5cm x 4cm?

I use version 7. Advanced thanks for any help.

  • 1
    $\begingroup$ I think the answer is also ImageSize: Export["test.eps", Plot[Sin[x], {x, 0, 1}, ImageSize -> 200]] $\endgroup$
    – chris
    Nov 8 '12 at 8:32
  • $\begingroup$ and I forgot to say you can specify e.g. Imagesize->{250,200} $\endgroup$
    – chris
    Nov 8 '12 at 9:10
  • $\begingroup$ @chris ImageSize->{GoldenRatio*200,200} or any size in agreement with the AspectRatio specification might be even better to avoid the useless white border around the graph. $\endgroup$
    – VLC
    Nov 8 '12 at 9:26
  • $\begingroup$ You wrote that you tried ImageSize and you use the same PlotRange. What can still change the appearance of the plots are different Labels on the Axes/Frame (since ImageSize is the size of the whole Plot not just the plot area). Also let me add this: If you want the picture to be 5cm wide the right ImageSize to use should be 5*72/2.54. Then you can set up the font size to whatever size you want (e.g. 10pt) and use the graphic without scaling. $\endgroup$
    – jens_bo
    Nov 8 '12 at 9:59

To summarize all contributions,

Export["test.eps", Plot[Sin[x], {x, 0, 1},ImageSize -> 5*72/2.54*{GoldenRatio,1},
BaseStyle -> {FontSize -> 10, FontFamily -> "Helvetica"}]]

should produce a magnificent postscript file of the right size ;-)

it is truly magnificent

  • $\begingroup$ you can also add: BaseStyle -> {FontSize -> 10, FontFamily -> "Helvetica"} to get a sans-serif font in a size that matches the rest of your document. $\endgroup$
    – jens_bo
    Nov 8 '12 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.