# Undesirable grid appears when ParametricPlot is exported as PDF

Writing:

plot = ParametricPlot[{x, Min[1, 2] t}, {x, 0, 2}, {t, 0, 1},
PlotRange -> {{0, 2}, {-1, 2}}]


I get:

but if I write:

Export["test.pdf", plot]


I get:

How can I get the same image in test.pdf?

• How about this? plot = Plot[1, {x, 0, 2}, PlotRange -> {{0, 2}, {-1, 2}}, Frame -> True, Filling -> Axis, AspectRatio -> 1.5,PlotStyle -> Thin] Commented Aug 13, 2018 at 13:43
• You can try Will Robertson's FixPolygons package for joining the polygons. Commented Aug 13, 2018 at 14:40
• – Jens
Commented Aug 13, 2018 at 14:53
• What's up with Min[1, 2] t? Surely that can be replaced by t alone? Or doesn't the problem reproduce then? Commented Aug 13, 2018 at 16:46
• TeM, could you check if SetSystemOptions["VisualizationOptions" -> {"GraphicsComplexPolygonCombine" -> True}];plot = ParametricPlot[{x, Min[1, 2] t}, {x, 0, 2}, {t, 0, 1}, PlotRange -> {{0, 2}, {-1, 2}}];Export["test.pdf", plot] works in your version/OS?
– kglr
Commented Aug 20, 2018 at 18:04

UPDATE: See more general solution in this answer.

You can solve this problem by joining the polygons using undocumented function GraphicsPolygonUtilsPolygonCombine:

plot = Normal@
ParametricPlot[{x, Min[1, 2] t}, {x, 0, 2}, {t, 0, 1},
PlotRange -> {{0, 2}, {-1, 2}}] /.
p : {__Polygon} :> GraphicsPolygonUtilsPolygonCombine[p];

Export["test.pdf", plot] // SystemOpen


Here is how the file is rendered by Adobe Acrobat:

(checked with version 11.1.0).

Another workaround is to remove transparency from the polygons by specifying the PlotStyle explicitly:

plot = ParametricPlot[{x, Min[1, 2] t}, {x, 0, 2}, {t, 0, 1},
PlotRange -> {{0, 2}, {-1, 2}}, Mesh -> None,
PlotStyle -> RGBColor[{0.812, 0.851, 0.914, 1}]]


Now the PDF

Export["test.pdf", %] // SystemOpen


is rendered as