I have wondered more and more often lately how the size of an image is handled when displayed or exported. The documentation implies that the via ImageSize the size could be set in printer points (per inch). That does however not correspond with the displayed graphics (for instance ImageSize-> {72 1, 72 1 }) does not render a generic plot with the expected size of one inch square. (UI magnification at 100%)

I am using Mathematica 9 on OS X 10.9 and usually use .eps for exporting plots (since .pdf export doesn't really work that well with fonts and all)

  • $\begingroup$ This is Export-related only (but duplicate-ish): mathematica.stackexchange.com/q/5442/131. I guess sizes on-screen are another animal entirely. $\endgroup$ – Yves Klett Nov 19 '13 at 15:06
  • $\begingroup$ ImageSize only changes the display. To actually change the size of the image in pixels (for instance when you export), use ImageResize. Then you can specify exactly how big/small you want it. $\endgroup$ – bill s Nov 19 '13 at 15:29
  • 2
    $\begingroup$ For exporting to PDF, I sometimes need to use the workaround cm = 72/2.54; Export["file.pdf", Show[graphics, ImageSize -> 10 cm]]. This gives a size of precisely 10 cm. $\endgroup$ – Szabolcs Nov 19 '13 at 17:50
  • $\begingroup$ Take a look here, some of the ideas may be of use to you. $\endgroup$ – Szabolcs Nov 19 '13 at 20:48

I export graphics like this:

cm = 72/2.54;
Export["file.pdf", Show[graphics, ImageSize -> 10 cm]]

For some reason Show is required when exporting to PDF, i.e. you can't just use the ImageSize option directly in Export and still get the expected result.

Regarding display on the screen, ImageSize is interpreted as pixels for on-screen display and as PostScript points (1/72 inch) for exporting to printable formats such as PDF. In other words, Mathematica always assumes the display to be a 72 ppi one.

|improve this answer|||||
  • 2
    $\begingroup$ N.B. ImageSize is (documented to be) printer's points whether onscreen or on paper. It just happens that many screens have (or used to have) 72 pixels per inch, and Mathematica uses this as a default instead of the actual resolution, as you noted in your answer in the link. Why it does this, I don't quite know. $\endgroup$ – Oleksandr R. Apr 20 '14 at 1:14
  • $\begingroup$ @OleksandrR. and Szabolcs, If I understand correctly that means for MMA pp == px is always True? And this is quite fundamental and not mentioned in documentation, right? p.s. There is m cm naming problem. $\endgroup$ – Kuba Feb 11 '16 at 14:00
  • $\begingroup$ @Kuba what does pp == px mean? $\endgroup$ – Oleksandr R. Feb 11 '16 at 14:02
  • $\begingroup$ @OleksandrR. printer's points, pixels. $\endgroup$ – Kuba Feb 11 '16 at 14:05
  • $\begingroup$ and by always I meant by default. :P $\endgroup$ – Kuba Feb 11 '16 at 14:05

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.