I am declaring an environment to help with drawing binomial distributions. One of the natural parameters to give to such a function is "n", the number of trials. My plotting function, however, needs to plot 0 .. n-1 samples. I am finding that I am unable to do the "-1" within a pgfplotsset. Can anyone help me do this? MWE:
\documentclass{minimal}
\usepackage{pgfplots}
\newenvironment{BinomDist}[1]{%
\pgfplotsset{DistAxis/.style={%
samples at={0,...,#1} % Want this to say ``#1-1'' or equiv.
}
}
}{}
\begin{document}
\begin{BinomDist}{8}
\begin{tikzpicture}
\begin{axis}[DistAxis]
\addplot [draw=black] {x};
\end{axis}
\end{tikzpicture}
\end{BinomDist}
\end{document}
