4

I have the following code to generate a 2D plot:

fig1 = Framed[
  Show[Graphics[{Orange, Opacity[1], 
     ConicHullRegion[{{0,0}}, {{-1,0},{1,1}}]}, 
    PlotRange -> {{-1.6, 1.6}, {-1.6, 1.6}}, Axes -> True, 
    LabelStyle -> {14, Bold, Black}, ImageSize -> Medium], 
   Graphics[{Black, Arrowheads[0.04], Thickness[0.01], 
       Arrow[{{0, 0},  {-1, 0}}] , 
     Text[Style[OverVector[Subscript[e, 1]], Medium, Bold, 
       Black], {-0.5, 0.15}]}], 
   Graphics[{Black, Arrowheads[0.04], Thickness[0.008], 
       Arrow[{{0, 0},  {1, 1}}] , 
     Text[Style[OverVector[Subscript[e, 3]], Medium, Bold, 
       Black], {0.32, 0.5}]}]]]

Mathematica generates the plot correctly but when I try to Export[] this plot as .pdf or using "Save Selection As..." then the image in the pdf has blunt arrow heads, which looks weird and different from the plot shown in Mathematica. I think this is a bug. I also tried to CloudExport[] on Mathematica online but the same problem persists.

Can someone help me to fix this problem?

Epsilon
  • 1,122
  • 4
  • 8
  • This is what I get in the pdf: image. I don't see blunt arrowheads, so it may be system-dependent. You should show what you see by posting a picture of your output. – MarcoB Dec 11 '20 at 16:42
  • Thank you for your comment. This is what I get in the pdf: https://imgur.com/a/Gxar25F – Epsilon Dec 11 '20 at 17:48
  • I've had similar issues with arrows. I believe it's caused by Mathematica trying to draw a border around things whenever it exports to PDF (or SVG). I assume it's a bug since EdgeForm[] still results in a border, but only when exporting to PDF/SVG. A high resolution PNG has no issues. If I open the PDF in Affinity, I can select the arrows, remove the border, and they look great. If I use a polygon as the arrowhead, it ends up drawing different border thicknesses for your code and makes the arrows appear to be different sizes. I'm on macOS 11.0.1 with MMA 12.1.1 June 9, 2020. – MassDefect Dec 11 '20 at 20:03
  • 12.1.1, Linux, work well,the arrow head is sharp. – cvgmt Dec 12 '20 at 00:43
  • I can confirm I have the same issues now, and unfortunately this means new exports of the same Mathematica code no longer produce the same figures I made in the past. MMA 12.1.1 on Windows. If someone has found a less hacky solution by now I'd still be interested. – TMM Apr 08 '21 at 01:44

1 Answers1

5

More of a workaround than a fix, but you can use Graphics to specify the arrowheads:

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

fig2 = Framed[ Show[Graphics[{Orange, Opacity[1], ConicHullRegion[{{0, 0}}, {{-1, 0}, {1, 1}}]}, PlotRange -> {{-1.6, 1.6}, {-1.6, 1.6}}, Axes -> True, LabelStyle -> {14, Bold, Black}, ImageSize -> Medium], Graphics[{Black, Arrowheads[{{.03, 1, {ah, 1}}}], Thickness[0.01], Arrow[{{0, 0}, {-1, 0}}], Text[Style[OverVector[Subscript[e, 1]], Medium, Bold, Black], {-0.5, 0.15}]}], Graphics[{Black, Arrowheads[{{.03, 1, {ah, 1}}}], Thickness[0.008], Arrow[{{0, 0}, {1, 1}}], Text[Style[OverVector[Subscript[e, 3]], Medium, Bold, Black], {0.32, 0.5}]}]]]

Export["test.pdf", fig2]

enter image description here

This exports with normal pointy arrows.

MelaGo
  • 8,586
  • 1
  • 11
  • 24