如标题所说,一个节点和一个坐标能放在同一条线上吗?
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (P1) at (-2, 0);
\coordinate (P2) at (2, 0);
\draw (P1) -- (P2);
\draw[-latex] (P1) -- ++(-88.2036:1.75cm) node[scale = .75, pos = .5,
fill = white, shape = circle, inner sep = 0cm] {\(\nu_2\)};
\draw[-latex](P1) -- ++(-20:5cm) node[scale = .75, pos= .5,
fill = white, inner sep = 0cm, shape = circle] {\(v_2 = 12.9005\)};
\end{tikzpicture}
\end{document}
我可以在末尾添加坐标吗(P1) -- ++(-88.2036:1.75cm)
?我通过搜索或在手册中找不到任何内容。
答案1
您可以直接在节点之后或之前添加坐标。
代码
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (P1) at (-2, 0);
\coordinate (P2) at (2, 0);
\draw (P1) -- (P2);
\draw[-latex] (P1) -- ++(-88.2036:1.75cm)
node[scale = .75, pos = .5, fill = white, shape = circle, inner sep = 0cm] {\(\nu_2\)}
coordinate (here);
\draw[-latex] (P1) -- ++(-20:5cm)
coordinate (there)
node[scale = .75, pos= .5, fill = white, inner sep = 0cm, shape = circle] {\(v_2 = 12.9005\)};
\draw[blue] (here) -- (there);
\end{tikzpicture}
\end{document}