When setting the Opacity option, there are mesh grids on the background of the pdf file. Opacity option should be saved because some shapes may be overlay.

Version:12.2, Windows 10

ff = RegionPlot[x^2 + y^3 < 2, {x, -2, 2}, {y, -2, 2}, PlotStyle -> Directive[Gray, Opacity[0.6]]]
Export["ff.pdf", ff]

Mesh->none option not work. Is there any way to remove the mesh grids when exporting the image?

enter image description here

  • 1
    $\begingroup$ Add the setting Method -> {"TransparentPolygonMesh" -> True} to RegionPlot[] and report back. $\endgroup$ – J. M.'s ennui Feb 9 at 7:28
  • $\begingroup$ It does not work. $\endgroup$ – zongxian Feb 9 at 7:32
  • $\begingroup$ Can you mention your OS and version number of Mathematica for reference? $\endgroup$ – J. M.'s ennui Feb 9 at 12:37
  • $\begingroup$ I add the version number and OS: Version 12.2, Windows 10. $\endgroup$ – zongxian Feb 9 at 15:42
  • $\begingroup$ An old but highly related question: (644). $\endgroup$ – Silvia Feb 9 at 19:44

I get the same meshed result as @zongxian with and without @J.M.'s recommendation. I am using:

(* "12.2.0 for Microsoft Windows (64-bit) (December 12, 2020)" *)

A possible workaround is to use Region with the appropriate specification like so:

ff = Region[
  Style[ImplicitRegion[x^2 + y^3 < 2, {{x, -2, 2}, {y, -2, 2}}], Gray,
    Opacity[0.6]], PlotTheme -> "Detailed"]
Export["ff.pdf", ff]

The PDF is close to what is desired as shown below:

PDF output


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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