如何从同一节点在不同位置绘制两个箭头

如何从同一节点在不同位置绘制两个箭头
\begin{tikzpicture}[node distance=2.5cm]
\tikzstyle{process} = [rectangle, minimum width=1.5cm, minimum height=0.8cm, text centered, draw=black]
\tikzstyle{resource} = [rectangle, minimum height=0.8cm, text centered]
\tikzstyle{arrow} = [thick,->,>=stealth]
\node (start)[process] {ward};
\node (stage1)[process, right of=start, xshift= 0.5cm]{PHU};
\node (stage2)[process, right of=stage1]{OR};
\node (stage3)[process, right of=stage2, xshift=0.5cm]{PACU};
\node (stage4)[process, right of=stage3]{ICU};
\node (nurse)[resource, below of=stage1, yshift=0.6cm, xshift= 1.25cm]{nurses (circulating/scrub/anesthetist)};
\node (surgeon)[resource, above of=stage2, yshift= -1cm, text width=5cm]{surgeons/anesthesiologist/ tools and equipment};
\node (bed)[resource, below of=stage3, yshift= 1.2cm]{recovery bed};
\node (discharge)[resource, below of=start, yshift= 1.2cm]{patient discharge};
\node (arrival)[resource, left of=start, text width=1.3cm]{patient arrival};
\draw [arrow] (arrival)--(start);
\draw [arrow] (start)--(stage1);
\draw [arrow] (start)--(discharge);
\draw [arrow] (nurse)--(stage1);
\draw [arrow] (stage1)--(stage2);
\draw [arrow] (nurse)--(stage2);
\draw [arrow] (surgeon)--(stage2);
\draw [arrow] (stage2)--(stage3);
\draw [arrow] (bed)--(stage3);
\draw [arrow, densely dashed] (stage3)--(stage4);
\draw [arrow] (nurse)-|(stage4);
\draw [arrow] (stage3) -- +(0,2.2) -| (start);
\draw [arrow, densely dashed] (stage4) -- +(0,2.2) -- +(-2.5,2.2);
\end{tikzpicture}

这是这张图片的代码我 但我需要像这样的图片在此处输入图片描述

答案1

您可以使用|-来确定正确的点

图像

笔记:

代码:

\documentclass[10pt]{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[node distance=2.5cm]
\tikzset{process/.style={rectangle, minimum width=1.5cm, minimum height=0.8cm, text centered, draw=black}}
\tikzset{resource/.style={rectangle, minimum height=0.8cm, text centered}}
\tikzset{arrow/.style={thick,->,>=stealth}}
\node (start)[process] {ward};
\node (stage1)[process, right of=start, xshift= 0.5cm]{PHU};
\node (stage2)[process, right of=stage1]{OR};
\node (stage3)[process, right of=stage2, xshift=0.5cm]{PACU};
\node (stage4)[process, right of=stage3]{ICU};
\node (nurse)[resource, below of=stage1, yshift=0.6cm, xshift= 1.25cm]{nurses (circulating/scrub/anesthetist)};
\node (surgeon)[resource, above of=stage2, yshift= -1cm, text width=5cm]{surgeons/anesthesiologist/ tools and equipment};
\node (bed)[resource, below of=stage3, yshift= 1.2cm]{recovery bed};
\node (discharge)[resource, below of=start, yshift= 1.2cm]{patient discharge};
\node (arrival)[resource, left of=start, text width=1.3cm]{patient arrival};
\draw [arrow] (arrival)--(start);
\draw [arrow] (start)--(stage1);
\draw [arrow] (start)--(discharge);
\draw [arrow, <-, red] (stage1) -- (stage1 |- nurse.north);
\draw [arrow] (stage1)--(stage2);
\draw [arrow, <-,  blue] (stage2) -- (stage2 |- nurse.north);
\draw [arrow] (surgeon)--(stage2);
\draw [arrow] (stage2)--(stage3);
\draw [arrow] (bed)--(stage3);
\draw [arrow, densely dashed] (stage3)--(stage4);
\draw [arrow] (nurse)-|(stage4);
\draw [arrow] (stage3) -- +(0,2.2) -| (start);
\draw [arrow, densely dashed] (stage4) -- +(0,2.2) -- +(-2.5,2.2);
\end{tikzpicture}
\end{document}

相关内容