Im trying to create the following:
I have tried:
\draw [dashed] (1,1) -- (4,5)node[anchor=north west] {Line};
however i cant figure out how to place the word in the enter of the line and not in it ends.
Thank you.
Im trying to create the following:
I have tried:
\draw [dashed] (1,1) -- (4,5)node[anchor=north west] {Line};
however i cant figure out how to place the word in the enter of the line and not in it ends.
Thank you.
\documentclass[tikz,margin=3mm]{standalone}
\usetikzlibrary{quotes}
\begin{document}
\begin{tikzpicture}[auto]
\draw [dashed] (0,1) -- node[left] {Line} (3,5);
\draw [dashed] (1,1) -- node[above,sloped] {Line} (4,5);
\draw [dashed] (3,1) to ["Line"] (6,5); % use library quotes
\draw [dashed] (4,1) to ["Line",sloped] (7,5);% use library quotes
\end{tikzpicture}
\end{document}
midway(which is the same aspos=0.5) to the node options, or place it immediately after--. – Torbjørn T. Jun 17 '17 at 12:14