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.

[The following problem occurs on OS X; I don't know if it also occurs with other OS's.]

If I produce a Graphics object with ArrayPlot, right-click on it, choose "Save Graphic As...", and save it as a PDF file, the resulting PDF graphic is absurdly fuzzy/blurry (which is particularly perverse, considering that it is among the simplest kind of graphics (all solid-color squares with vertical and horizontal edges).

For example, in the PNG screenshot below, one such figure is shown in the Mathematica GUI (on the left), and the PDF file exported as described above (and displayed at "Actual Size" magnification with the Preview app) is shown on the right:

original vs PDF

(Actually, the screenshot of the original on the left looks fuzzier to me than what I actually see on the screen, but that degree of fuzziness is nothing compared to what the PDF looks like.)

As I understand it PDF is the native graphics format for OS X. It should be possible (not to say trivial) to save this very simple graphic as a PDF in a way that preserves all the edges and corners to infinite resolution.

Does anyone know how?

PS: FWIW, I did try displaying the Graphics object above with Style[#, Antialiasing->False]&, but this change had no effect, either on the resulting PDF nor on the object's appearance in the Mathematica GUI.

share|improve this question
2  
Does the same thing happen if you use Export["file.pdf", ArrayPlot[(* stuff *)]]? –  J. M. Sep 29 '12 at 16:13
    
@J.M. Yes, same problem. The only difference this time is that, when this second PDF is displayed at "Actual Size" magnification, the plot has the same size as it does in the Mathematica GUI. –  kjo Sep 29 '12 at 16:25
3  
This is a problem with Preview.app, not Mathematica. Try opening it in Adobe Reader or ghostview and it'll look correct –  rm -rf Sep 29 '12 at 16:51
    
note that pl = ArrayPlot[Table[i - j, {i, 5}, {j, 5}]]; Export["pl.pdf", pl]; produces a non fuzzy array (macos 10.7 preview). –  chris Sep 29 '12 at 17:45
    
@rm-rf: Thanks! If you post your comment, I'll by happy to accept it. –  kjo Sep 29 '12 at 19:41
show 1 more comment

2 Answers 2

up vote 8 down vote accepted

This is a problem with Preview, the PDF reader included in OS X. The problem does not show when using other PDF readers (not based on PDFKit) such as Adobe Reader.

To prevent blurring you just need to untick the "Smooth text and line art" checkbox under "Viewing documents" in Preview's preferences:

in the preview pdf preferences

However, this will lower the quality of text and line art as well.

share|improve this answer
add comment

In version 9 of Mathematica, if you export the graphics by right clicking and choosing Save As..., the problem does not occur. Unfortunately this will cause other problems. It's a tradeoff you need to consider.

If the figure is simple enough, it may be a good workaround, but keep an eye on the width of the frame and tick marks: they may be off.

share|improve this answer
add comment

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.