我想将一个节点放置在由一系列箭头组成的decoration
路径下方(即类似“ ”的位置):myDecoratePath.south
为了获得这样的东西:
有没有办法用以下最小非工作示例来实现它(灵感来自pschulz 的回答)?
\documentclass[tikz,drop]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\tikzset{arrow/.pic={
\draw[-latex,line width=1pt] (0,0) -- (0.1,0);%
}}%
\begin{document}
\begin{tikzpicture}[decoration = {%
markings,%
mark =%
between positions 0 and 1 step 5mm % adjust step size here
with {%
{\pic {arrow};},
postaction={decorate}}%
}%
]%
\path[decorate] (0, 0) -- (2, 0);%
% Here the node I would like to place at something like 'myDecoratePath.south'
% \node (n1) [draw, text width=3em, minimum height=2em] {node 1};%
\end{tikzpicture}
\end{document}
答案1
只需将节点放在正确位置即可里面你的路径并调整定位。
\documentclass[tikz,drop,border=3.14mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings, positioning}
\tikzset{arrow/.pic={
\draw[-latex,line width=1pt] (0,0) -- (0.1,0);%
}}%
\begin{document}
\begin{tikzpicture}[decoration = {%
markings,%
mark =%
between positions 0 and 1 step 5mm % adjust step size here
with {%
{\pic {arrow};},
postaction={decorate}}%
}%
]%
\path[decorate] (0, 0) -- (2, 0) node (n1) [pos=0.5, below = 4 pt , draw, text width=3em, minimum height=2em] {node 1};%
\end{tikzpicture}
\end{document}