Bug introduced in 12 or earlier and persisting through 13.1.0 [CASE:4899765]
How can I remove the outline in my export PDF here which seems to be caused by the overlapping of the shape and the grid lines?
It doesn't seem to show on the Mathematica image (or just because I couldn't zoom in enough) but when I exported PDF and zoom in I can see it.
polygon = {{1, 1}, {3, 1}, {4, 2}, {2, 4}, {1, 3}}
image = ListLinePlot[polygon,
GridLines -> {Range[1, 5, 1/2], Range[0, 5, 1/2]},
PlotRange -> {{1, 5}, {0, 5}}, Filling -> {1 -> Axis},
FillingStyle -> Directive[Opacity[0.2], Orange],
GridLines -> {Range[1, 5, 1], Range[1, 5, 1]}, ImageSize -> 250,
AspectRatio -> 1,
Frame -> {{None, Automatic}, {Automatic, None}}] /. _Line ->
Sequence[];
Export["image.pdf", image]
This is the output in my 13.0.1 version which is even worse than the 12.1 version. I'm going to check for the update.
I checked for the update but unfortunately we here we don't have the latest version for support. Is there any way to work around this?



_Line -> Sequence[]already but somehow it still appears when I export to pdf. – hana Jun 30 '22 at 08:18