0

I'd like to add a reversed arc barb tip to a curve in order to mark a discontinuity. While this works perfectly fine at the end of a line (and not a curve), reverting the barb tip horizontally at the end of a curve causes the curve to slightly cross the hook, as shown below:

enter image description here

\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{arrows.meta}

\begin{document}

\begin{tikzpicture}
\draw[black] [domain=0:2,-{Arc Barb[reversed]}, samples=100] plot (\x,0); % the curve crosses the hook
\draw[-{Arc Barb[reversed]}] (0,-1) -- (2,-1); % well-functioning plot I cannot generalise for curves
    \end{tikzpicture}

\end{document}

Could you please help me clip the end of the curve in the first example, or make the arrow tip begin a bit further?

2
  • Can you show your real plot? I suspect that if a sample lies between the start of the arrow tip and the actual end of the line, PGF messes up somewhere. Compare with \draw[-{Arc Barb[reversed]}] (0,-1) -- (1.99,-1) -- (2,-1);. Sep 5 at 15:11

1 Answer 1

1

Instead of shortening the curve, you can move the arrowhead to the end.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{arrows.meta}

\begin{document}

\begin{tikzpicture}
\draw[black, shorten >=-2pt] [domain=0:2,-{Arc Barb[reversed]}, samples=100] plot (\x,0); % the curve crosses the hook
\draw[-{Arc Barb[reversed]}] (0,-1) -- (2,-1); % well-functioning plot I cannot generalise for curves
    \end{tikzpicture}

\end{document}

demo

2

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.