1

want to plot the schematic diagram of the following diagram using tikz latex, but it is not correct. enter image description here

\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
  • 3
    Hi! Welcome to TeX.SE! It's better to put a compilable code in your question (you might just need to add \documentclass[tikz,margin=5pt]{standalone} \usetikzlibrary{positioning} \begin{document} and \end{document}). By the way, can you explain more what are your difficulties? It seems to me that you had a good start! (p.s. I had to remove the ' in >=latex')
    – Vinzza
    Feb 28, 2019 at 12:31

1 Answer 1

3

You are already on a good track.

\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}

enter image description here

2
  • Thanks!! but the arrow from Phytoplankton to Fish and the word Grazing on the line from Phytoplankton to Zooplankton is missing. I wish the broken lines to be some what visible and colored!!
    – YAB
    Mar 1, 2019 at 20:54
  • @YeshambelAzene I added the missing line and changed the style of the dashed lines. If you want a different appearance, you only need to change broken/.style accordingly.
    – user121799
    Mar 1, 2019 at 21:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .