1
$\begingroup$

I am trying to put a custom arrowhead on an arrow I am drawing in a plot. My problem is that the (thick) line of the arrow is showing behind the arrow tip. So it seems like the arrowhead is aligned not at the tip of the line, but too far behind, so the line shows through. This is the code you can use to replicate it:

"Custom arrowhead"    
h = Graphics[{FilledCurve[{BSplineCurve[{{-1.48, 0.}, {-1.455, 
             0.3580000000000001}, {-2, 1}}], 
          BSplineCurve[{{-2, 1}, {-1.079, 0.44599999999999995}, {0, 0}}], 
          BSplineCurve[{{0, 
             0}, {-1.079, -0.44599999999999995}, {-2, -1}}], 
          BSplineCurve[{{-2, -1}, {-1.455, -0.3580000000000001}, {-1.48, 
             0.}}]}]}];

"Plot with arrow"
Show[Plot[{}, {x, 0, .73}, PlotRange -> {{0, .73}, {0, 0.55}}, ImageSize -> Large], Graphics[{Thickness[0.005], Arrowheads[{{0.015, Automatic, h}}], Arrow[{{0.2, 0.12}, {0.24, 0.12}}]}]]

This is how the custom arrowhead looks like:

enter image description here

And this is how it looks like in the plot:

enter image description here

You can clearly see in the plot that the line itself is "showing through" the tip, making it "blunt" instead of sharp. How do I fix this?

(I've used the following recipe to customize the arrowhead.)

$\endgroup$
3
  • 2
    $\begingroup$ Use Arrowheads[{{0.015, Automatic, {h, .5}}}] to foreshorten the shaft of the arrow from the arrowhead. Also use (* Custom arrowhead *) for your comment, not strings like "Custom arrowhead" $\endgroup$
    – flinty
    Aug 17, 2020 at 12:49
  • 1
    $\begingroup$ This is the standard reference example that flinty refers to. $\endgroup$ Aug 17, 2020 at 15:17
  • $\begingroup$ @flinty this solved it, thank you. and thank you for the reference Trevillian $\endgroup$
    – bjoj
    Aug 18, 2020 at 8:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.