I am drawing some diagrams of mechanical systems which have many rotated components. For each of these components I am attaching a coordinate system, which is often rotated with the component. I am drawing the coordinates using the draw command and adding labels (x
and y
) using the node command. I would like the axis label to be in line with the axis (i.e., the arrow points directly at it) regardless of how the coordinate system is rotated. Currently I have done:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[<->,rotate around={22.5:(0,0)}](0,1)node[above]{$y$}--(0,0.2)--(1,0.2)node[right]{$x$};
\end{tikzpicture}
\end{document}
This code results in the following output:
TikZ seems to be interpreting node[above]
to mean above using the standard coordinates, instead of "rotating" what it means for the node to be above the end of the line. I would ideally like to be able to write something like node[angle=22.5]
to correctly position the label. Is there a way to do this where I can specify the angle instead of just above, right, etc.?