Certain (but not all) images displayed in ArrayPlot, and then copied to PDF, show what appear to be fuzzy mesh lines in white areas. An example is shown below.

I am aware of previous answers regarding viewing in Preview, but this happens when the copied image is viewed in Pages, TextEdit, or even Mathematica! It persists in these when the preview smoothing option is turned off, though the problem goes away in preview.

Also, the PDF file is very large, takes long time to copy. Is it representing all the elements of the array as graphic rectangles?

Here is a simple example:

ArrayPlot[1. - IdentityMatrix[4], ColorFunction -> GrayLevel, 
 ColorFunctionScaling -> False, Mesh -> None]

Copy the output as PDF, then paste back into the Mma notebook, and Mesh lines will be evident.

  • 1
    $\begingroup$ I also see this issue. Perhaps you can use one of the answers to this question instead: Plotting large datasets. A simple way to display the array is Image[1. - IdentityMatrix[4], ImageSize -> 360]. $\endgroup$ – Jens Aug 20 '14 at 22:26
  • 1
    $\begingroup$ Yes, I am aware of Image, but I need labeled frame and frameticks. I did find a workaround using Raster. Unfortunately its FrameTicks->Automatic differs from that of ArrayPlot. $\endgroup$ – abwatson Aug 20 '14 at 23:39
  • $\begingroup$ I tried CopyToClipboard and got a slightly better looking result in a Mac, I do still see very fine lines when magnifying in Preview... so I guess this is worth a bug report. $\endgroup$ – Jens Aug 20 '14 at 23:51
  • $\begingroup$ PDF uses a vector format, and ArrayPlot produces a Graphics, some replacement rules are needed to get rid of those fine lines $\endgroup$ – hieron Aug 21 '14 at 0:32

When you save it as PDF and open it later, Graphics content is no more the same.

You may check it out with:

ArrayPlot[1. - IdentityMatrix[4], ColorFunction -> GrayLevel, 
 ColorFunctionScaling -> False, Mesh -> None] // FullForm

Then you save the image output as PDF (copy should have the same effect)

Reopen the PDF (or paste it), then examine it with


Using InputForm instead of FullForm you may insert at the beginning of Graphics the directive EdgeForm@White,. Gives something like Graphics[{EdgeForm@White, ... those gray lines should become white on evaluation

  • $\begingroup$ I don't understand why you post this as a solution. Have you actually tried it? Then you must be seeing something in the FullForm of the PDF that I am not. $\endgroup$ – Jens Aug 21 '14 at 4:49
  • $\begingroup$ I tried Save Selection As and I'm missing something in the Graphics expression. $\endgroup$ – hieron Aug 21 '14 at 10:04

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