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.

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.

share|improve this question
1  
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 at 22:26
1  
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 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 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 at 0:32

1 Answer 1

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

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

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.