tikz latex를 사용하여 다음 다이어그램의 개략도를 그리는 방법은 무엇입니까?

tikz latex를 사용하여 다음 다이어그램의 개략도를 그리는 방법은 무엇입니까?

tikz latex를 사용하여 다음 다이어그램의 개략도를 플롯하고 싶지만 올바르지 않습니다. 여기에 이미지 설명을 입력하세요

\begin{tikzpicture}[node distance=4cm,auto,>=latex',every node/.append style={align=center},int/.style={draw, minimum size=1cm}]
\node [int] (P)             {Phytoplankton (P)};
\node [int, below=of P] (Z) {Zooplankton(Z)};
\node [int, right=of P] (M) {Macrophytes(M)};
\node [int, below=of M] (F) {Fish(F)};
\node [int, right=of F] (W) {Water hyacinth(W)};
\coordinate[right=of M] (out);
 \coordinate[right=of Z] (out);
  \coordinate[right=of F] (out);
  \coordinate[right=of W] (out);
\path[<->, auto=false] (P) edge node {Nutrient/sun light\\competition} (M)
   (M) edge node {competition\\Refuge     \\[2em] } (out) edge  [out=180, in=90] node[below] {competition and\\ Refuge} (W);

\end{tikzpicture}

답변1

당신은 이미 좋은 길을 가고 있습니다.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[node distance=5cm and 4cm,auto,>=latex,
every node/.append style={align=center},int/.style={draw, minimum size=1cm},
broken/.style={thick,blue,dashed}]
  \node [int] (P)             {Phytoplankton (P)};
  \node [int, below=of P] (Z) {Zooplankton (Z)};
  \node [int, right=of P] (M) {Macrophytes (M)};
  \node [int, below=of M] (F) {Fish (F)};
  \path (M) -- (F) node [pos=0.7,int,auto=false] (W) {Water hyacinth (W)};
  \draw[->] (Z) -- (F) node[midway] {Predation} %<- uses auto
  node[midway,above=1cm,dashed,draw] (R1) {Refuge effect}
  node[midway,below=1cm,dashed,draw] (R2) {Refuge effect};
  \draw[->] (P) -- (Z) node[midway,below=2mm,dashed,draw,sloped] (R3) {Refuge effect};
  \draw[->] (P) -- (F);
  \foreach \X/\Y in {P/90,M/90}
  {\draw[->] (\X.\Y) -- ++ (\Y:2) node[midway,swap,align=left]{Death\\ respiration};}
  \foreach \X/\Y in {Z/180,W/0,F/0}
  {\draw[->] (\X.\Y) -- ++ (\Y:2) node[midway,above,align=center]{Death\\ respiration};}
  \foreach \X/\Y in {P/M,P.south east/W.north west,M.south east/W.north}
  {\draw[<->,broken] (\X) -- (\Y) 
   node[midway,above,align=center,sloped] {Nutrient/sun\\ light competition};}
  \draw[broken,->]  (W) -- (R3);
  \draw[broken,->]  (W) -- (R1);
  \draw[broken,->]  (M) -- ++ (4.5,0) |- (R2);
\end{tikzpicture}
\end{document}

여기에 이미지 설명을 입력하세요

관련 정보