\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\usepackage{xifthen}
\begin{document}
\begin{tikzpicture}[>=latex', node distance=2cm]
\node (X0) {$X_o$};
\pgfmathsetmacro{\N}{4}
\foreach \x in {0,...,\N}
{
\pgfmathtruncatemacro{\nextval}{\x+1}
\ifthenelse{\x = \N}
{\def\speciesName{$X_1$}}
{\def\speciesName{\large $x_\nextval$}}
\node [right of = X\x] (X\nextval) {\speciesName};
\draw [->,ultra thick,blue] (X\x) -- node[above, black] {$v_{\nextval}$} (X\nextval);
}
\end{tikzpicture}
\end{document}
Here are some examples for N = 0, N = 2 and N = 4
No comments:
Post a Comment