When I create a contour plot it looks fine. When I copy as PDF, and paste into another document (e.g. Apple Mail, Keynote, etc.) it has an extra unwanted white mesh. This occurs even when the option Method -> {"TransparentPolygonMesh" -> True} is used.

Here is an example.

plot = ContourPlot[Exp[-Norm[{x, y}]^2], {x, -1, 1}, {y, -1, 1}, 
  Method -> {"TransparentPolygonMesh" -> True}]

Here is the picture that results, after copying as PDF, pasting into Mail, and doing a screen grab. plot with mesh

Here are the options:


{DisplayFunction -> Identity, 
     AspectRatio -> 1, DisplayFunction :> Identity, Frame -> True, 
     FrameTicks -> {{Automatic, Automatic}, {Automatic, Automatic}}, 
     GridLinesStyle -> Directive[
    GrayLevel[0.5, 0.4]], 
     Method -> {"TransparentPolygonMesh" -> True, 
       "DefaultBoundaryStyle" -> Automatic}, 
     PlotRange -> {{-1, 1}, {-1, 1}}, PlotRangeClipping -> True, 
     PlotRangePadding -> {{Scaled[0.02], Scaled[0.02]}, {Scaled[0.02], 
        Scaled[0.02]}}, Ticks -> {Automatic, Automatic}}

I am using version on Apple OS X 10.11.6 but the problem was present in previous versions.

I am aware that similar questions have been asked, but none provided a solution.

  • $\begingroup$ For what it's worth, if I right-click the graphic, select "Save graphic as...", and save as a PDF in Windows, then the PDF is clean, with no underlying mesh. This is true even without setting the TransparentPolygonMesh method explicitly. the output of my Options function is identical to yours. $\endgroup$
    – Pirx
    Aug 18, 2016 at 0:02
  • $\begingroup$ I should have added: The resulting PDF looks clean in Adobe Acrobat. I just opened it in my GhostScript viewer, and it shows a somewhat uglier version of the mesh you show in your post. I then opened the PDF in PDF-XChange viewer, and that again gave a clean image, and so did Photoshop. My guess is what you are seeing is an artifact of your OS X PDF viewer. $\endgroup$
    – Pirx
    Aug 18, 2016 at 0:06
  • $\begingroup$ Try the cleanContourPlot function from here. It doesn't work on everything but it works well on your example. $\endgroup$
    – Szabolcs
    Aug 18, 2016 at 9:24
  • $\begingroup$ Possible duplicate of Saner alternative to ContourPlot fill $\endgroup$ Jun 17, 2018 at 10:49


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.