This is fixed for in version 10.3 by disabling interpolation in the PDF (see Romwell's answer). However, Preview.app on OS X simply ignores this flag. Thus, in practice, the problem remains for all but small matrices. Systems other than Mathematica are also affected by this Preview.app problem.
[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:
(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.
Export["file.pdf", ArrayPlot[(* stuff *)]]
? $\endgroup$pl = ArrayPlot[Table[i - j, {i, 5}, {j, 5}]]; Export["pl.pdf", pl];
produces a non fuzzy array (macos 10.7 preview). $\endgroup$