I am trying to change TikZ: draw only a certain central length of a given path to fit my needs.
I have a path that is built with \draw (A) to [bend right=30] (B);
I want to now shift this path in a parallel way but only show a segment of it. I am hoping this segment can be arbitrary chosen with two different coordinates. Here is my code:
\documentclass[12pt, thmsa]{article}
\usepackage{tikz,pgf, pgfplots}
\pgfdeclaredecoration{ignore}{final}
{
\state{final}{}
}
% Declare the actual decoration.
\pgfdeclaremetadecoration{myshortershift}{initial}{
\state{initial}[
width=1pt,
next state=myshortershift
]
{\decoration{moveto}}
\state{myshortershift}[
width={\the\pgfdecorationsegmentlength},
next state=final
]
{\decoration{curveto}}
\state{final}
{\decoration{ignore}}
}
\tikzset{myshortershift segment/.style={decoration={myshortershift},decorate, segment length=#1}}
\begin{document}
\begin{tikzpicture}[>=latex]
\begin{axis}[
axis x line=bottom,
axis y line=left,
xmin=0, xmax=10,
ymin=0, ymax=10,
x label style={at={(axis description cs:1,-.01)},anchor=south},
ylabel style={at={(axis description cs:0.1,1)},anchor=west, rotate=270},
xlabel={$X$},
ylabel={$Y$},
ytick=\empty,
xtick=\empty,
]
\coordinate (A) at (axis cs:2.2, 9.5);
\coordinate (B) at (axis cs:8, .5);
\draw (A) to [bend right=30] (B);
\draw[blue] (axis cs:2.2+1, 9.5+1) to [bend right=30] (axis cs:8+1,.5+1);
\draw [blue,->, dotted, myshortershift segment=1.75cm] (axis cs:2.2+.5,9.5+.5) to [bend right=30] (axis cs:8+.5,.5+.5);
\draw [blue,->, dotted, myshortershift segment=1.75cm] (axis cs:8+.5,.5+.5) to [bend left=30] (axis cs:2.2+.5,9.5+.5);
\end{axis}
\end{tikzpicture}
\end{document}
I am trying to get the dotted arrows to start and stop at any two given coordinate (these will be derived from some intersections commands)
Thank you


\path[name path=rest1,intersection segments={of=shifted curve and line1,sequence={A1}}]; \draw[latex-latex,red,very thick, intersection segments={of=rest1 and line2,sequence={A0}}];. – Jun 14 '19 at 15:23fillbetweenlibrary, which is loaded here. – Jun 14 '19 at 15:30