我使用 Tikz 绘制了下图:
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, positioning, quotes}
\begin{document}
\begin{tikzpicture}[
node distance = 12mm and 12mm,
box/.style = {draw, rounded corners,
minimum width=22mm, minimum height=5mm, align=center},
> = {Straight Barb[angle=60:2pt 3]},
bend angle = 15,
auto = right,
]
\node (n1) [box] {text\\ text text text 1};
\node (n2) [box, below right=of n1] {text\\ text text 2};
\node (n3) [box, above right=of n2] {text\\ text text 3};
%
\draw[dotted,->] (n1) to ["label 1", swap] (n3);
\draw[dashed,->] (n1) to [bend right, "label 2"] (n2);
\draw[->] (n2) to [bend right, "label 3"] (n1);
\draw[->] (n2) to [bend right, "label 5"] (n3);
\draw[dotted,->] (n3) to [bend right, "label 4"] (n2);
\end{tikzpicture}
\end {document}
我的问题是:我怎样才能使节点n1
看起来像那样?
答案1
让我阐述一下我的评论。对于这种情况,就像您希望在节点处n1
,在 Ti钾Z 库shadows
定义选项double copy shadow
:
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta,
positioning,
quotes,
shadows} % <--- added
\begin{document}
\begin{tikzpicture}[
node distance = 12mm and 12mm,
box/.style = {draw, rounded corners, fill=white,
minimum width=22mm, minimum height=5mm, align=center},
> = {Straight Barb[angle=60:2pt 3]},
bend angle = 15,
auto = right,
]
\node (n1) [box,
double copy shadow={% <--- added
shadow xshift=1ex,
shadow yshift=1ex}] {text\\ text text text 1};
\node (n2) [box, below right=of n1] {text\\ text text 2};
\node (n3) [box, above right=of n2] {text\\ text text 3};
%
\draw[dotted,->] (n1) to ["label 1", swap] (n3);
\draw[dashed,->] (n1) to [bend right, "label 2"] (n2);
\draw[->] (n2) to [bend right, "label 3"] (n1);
\draw[->] (n2) to [bend right, "label 5"] (n3);
\draw[dotted,->] (n3) to [bend right, "label 4"] (n2);
\end{tikzpicture}
\end {document}