A diagram drawn with TikZ is used a couple of times and I defined a command for it.
In the first picture I want to mark a subset of the nodes by filling them with light gray, and another subset of nodes in the second picture. Is this possible, or do I need to duplicate the whole command for this?
The MWE shows the output before the desired node fillings.
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes,arrows}
\tikzstyle{main}=[circle, minimum size = 10mm, thick, draw =black!80, fill = white!100, node distance = 12mm]
\tikzstyle{connect}=[-latex, thick]
\tikzstyle{box}=[rectangle, draw=black!100]
\newcommand{\model}{
\node[main] (alpha) {$\alpha$};
\node[main] (gamma) [right=of alpha] {$\lambda$};
\node[main] (Z) [below=of alpha] {$Z$};
\node[main] (C) [below=of gamma] {$C$};
\node[main] (W) [right=of C] {$W$};
\node[main] (R) [below=of W, fill=lightgray] {$R$};
\node[main] (bias) [above=of W] {$b$};
\node[main] (sigma) [right=of bias] {$\sigma$};
\path (alpha) edge [connect] (Z)
(gamma) edge [connect] (C)
(Z) edge [connect] (C)
(C) edge [connect] (R)
(W) edge [connect] (R)
(bias) edge [connect, bend left] (R)
(sigma) edge [connect, bend left] (R)
(C) edge [connect] (W);
}
\begin{document}
\begin{tikzpicture}
\model
%TODO: fill some nodes here
\end{tikzpicture}
\begin{tikzpicture}
\model
%TODO: fill other nodes here
\end{tikzpicture}
\end{document}

