Is there a way to continue a path we draw using \draw with a plot, just as we do for instance also with arc or similar commands?
In the example below I have a straight line, but I'd like the plot to append directly to that line, as indicated by the red dots. I can of course do that e.g. with plot[shift={(1,1)},...], but that means that I have to repeat that second coordinate in the path, which makes it again more cumbersome to use if we want to change something later (and the second straight line segment then points to the original endpoint without the shift). So this is more a question about "ergonomically" using this plot command inside other paths. E.g., I also like using the ++ syntax to precisely extend a path a certain distance horizontally, without having to repeat the previous y-coordinate, and I was wondering whether there is something similar we can do with the plot command inside such a path.
\documentclass{standalone}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[domain=0:4]
\draw[black!10!white, dashed] (0, 0) grid (4, 2);
\draw (0, 1) -- (1, 1) node[left] {} plot[domain=0:1, samples=100] function{sin(6.3*x)} node[right] {} -- ++(1, 0);
\end{tikzpicture}
\end{document}



plotas a\pic, i.e. put its calculation inside the\pic. A different approch might be using saveboxes. Yet another way is: a) compiling theplotseparately asstandalone, b) including it via\includegraphcisinside a\node, c) position saidnode.