Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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)

share|improve this question
    
This is Export-related only (but duplicate-ish): mathematica.stackexchange.com/q/5442/131. I guess sizes on-screen are another animal entirely. –  Yves Klett Nov 19 '13 at 15:06
    
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. –  bill s Nov 19 '13 at 15:29
    
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. –  Szabolcs Nov 19 '13 at 17:50
    
Take a look here, some of the ideas may be of use to you. –  Szabolcs Nov 19 '13 at 20:48

1 Answer 1

I export graphics like this:

m = 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 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.

share|improve this answer
1  
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. –  Oleksandr R. Apr 20 at 1:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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