Dashed styling gets erroneously applied to the head of an Arrow when exported to PDF in version 12.1-12.2 on Mac -- it looks fine on the screen and when exported to PNG (also fine for versions 10.0-12.0).

testfig = Graphics[{Blue, Dashing[.03], Thickness[0.008], Arrow[{{0, 0}, {0, 1}}]}]
Export[StringJoin["testfig.png"], testfig, "PNG", ImageResolution -> 300];
Export[StringJoin["testfig.pdf"], testfig, "PDF"];

PDF: enter image description here

PNG: enter image description here

Bug? Workaround?

Possibly related (although the fix doesn't work)


This works for me in v12.1.1 on Windows 10:

ah = Graphics[{EdgeForm[Thickness[0]], 
   Triangle[{{-1, .4}, {0, 0}, {-1, -.4}}]}];

testfig2 = 
 Graphics[{Blue, Arrowheads[{{.03, 1, {ah, 1}}}], Dashing[0.03], 
   Thickness[0.01], Arrow[{{0, 0}, {0, 1}}]}]

Export["testfig.pdf", testfig2]

enter image description here


enter image description here

I don't understand why just EdgeForm[] doesn't work.


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.