# ArrayPlot copied to PDF shows blurred mesh [duplicate]

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.

• 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]. – Jens Aug 20 '14 at 22:26
• 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. – abwatson Aug 20 '14 at 23:39
• 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. – Jens Aug 20 '14 at 23:51
• PDF uses a vector format, and ArrayPlot produces a Graphics, some replacement rules are needed to get rid of those fine lines – 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

%//FullForm


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

• 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. – Jens Aug 21 '14 at 4:49
• I tried Save Selection As and I'm missing something in the Graphics expression. – hieron Aug 21 '14 at 10:04