One nice feature of TikZ is that you can apply a coordinate transformation in the middle of a \draw command (or \path, etc.) and it will automatically apply to the rest of whatever is in the command. I'd like to be able to use a command inside a tikzpicture that similarly applies a transformation automatically to all subsequent \draw commands, i.e., that lasts across semicolons.
For instance, consider the following working example:
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}[scale=1.5]
\foreach \n in {1,...,5}
{
\draw[thick,->] (-1.5,0) -- (4.5,0) node[right] {$x$};
[yshift=-1cm];
}
\end{tikzpicture}
\end{center}
%
%
\rule{0pt}{2cm}
%
%
\begin{center}
\begin{tikzpicture}[scale=1.5]
\foreach \n in {0cm,1cm,...,4cm}
{
\draw[yshift=\n, thick, ->] (-1.5,0) -- (4.5,0) node[right] {$x$};
}
\end{tikzpicture}
\end{center}
\end{document}

The second picture gives the result I want; the first picture is the style of code I would like to use for it.
Is there a way to do this?

\foreachat 0, and have to include thecmin the list for\foreach? Would be helpful to know why the second code style won't work for you. – Peter Grill Feb 3 '12 at 20:38tikzpictureenvironment. I've been using nested occurrences of things like\begin{scope}[yshift=-1cm]...\end{scope}to achieve this effect, but I found this an unaesthetic way of coding it. The use of\foreachseemed like an effective way to demonstrate why the "nested scope" approach is less than optimal. – Charles Staats Feb 3 '12 at 21:57\n), all the subsequent ones should fall into line automatically. It seems to me that the first coding style better incorporates this sort of flexibility. – Charles Staats Feb 3 '12 at 22:04