\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}
das ist mein Code für dieses Bild aber ich brauche das Bild wie dieses Bild
Antwort1
Mit dem können Sie |-
die richtigen Punkte ermitteln
Anmerkungen:
- Ich habe die geänderten Linien eingefärbt, damit sie leichter zu finden sind (etwas, das man für zukünftigeMWE).
- Gemäß dem Kommentar von Schrödingers Katze habe ich das
\tikzstyle
durch ersetzt\tikzset
. SieheSollten \tikzset oder \tikzstyle zum Definieren von TikZ-Stilen verwendet werden? . - Verbindung von der Mitte der |-Zeile aus
kann eine nützliche Referenz zur Verwendung von
|-
und sein-|
.
Code:
\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}