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);. Commented Sep 5, 2022 at 15:11
  • See also tex.stackexchange.com/a/652578/8650 Commented Sep 6, 2022 at 6:32

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
  • Thank you, that's what I needed!
    – Piotr
    Commented Sep 6, 2022 at 5:35
  • 1
    If you want the arrowhead in the original position, which is needed for non tirvial plots, then you can use the method here: tex.stackexchange.com/a/652578/8650 Commented Sep 6, 2022 at 6:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .