# Subcaptions for TikZ pictures

I'd like to put (sub)captions under the diagrams on the right hand side of the equation in the following code. For example, I'd like to label them (a) through (e).

Thanks in advance for any help!

\documentclass[11 pt]{amsart}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{subfig}

\usetikzlibrary{calc}
\tikzstyle{hackennode}=[draw,circle,inner sep=0,minimum size=4pt]
\tikzstyle{hackenline}=[line width=3pt]

\begin{document}

\begin{figure}[h]
{\Large
$\begin{tikzpicture}[baseline=-0.65ex,scale=0.5] \draw[densely dashed] (-1,-1) -- (3,-1); \node[hackennode] (0) at (0,-1) {}; \node[hackennode] (1) at (0,0) {}; \node[hackennode] (2) at (0,1) {}; \node[hackennode] (3) at (0,2) {}; \draw[hackenline,blue] (0) -- (1) {}; \draw[hackenline,red] (1) -- (2) -- (3) {}; \node[hackennode] (10) at (1,-1) {}; \node[hackennode] (11) at (1,0) {}; \node[hackennode] (12) at (1,1) {}; \node[hackennode] (13) at (1,2) {}; \draw[hackenline,blue] (10) -- (11) {}; \draw[hackenline,red] (11) -- (12) -- (13) {}; \node[hackennode] (20) at (2,-1) {}; \node[hackennode] (21) at (2,0) {}; \node[hackennode] (22) at (2,1) {}; \draw[hackenline,red] (20) -- (21); \draw[hackenline,blue] (21) -- (22); \end{tikzpicture} = \left \{ \begin{tikzpicture}[baseline=-0.65ex,scale=0.5] \draw[densely dashed] (-1,-1) -- (3,-1); \node[hackennode] (10) at (1,-1) {}; \node[hackennode] (11) at (1,0) {}; \node[hackennode] (12) at (1,1) {}; \node[hackennode] (13) at (1,2) {}; \draw[hackenline,blue] (10) -- (11) {}; \draw[hackenline,red] (11) -- (12) -- (13) {}; \node[hackennode] (20) at (2,-1) {}; \node[hackennode] (21) at (2,0) {}; \node[hackennode] (22) at (2,1) {}; \draw[hackenline,red] (20) -- (21); \draw[hackenline,blue] (21) -- (22); \end{tikzpicture} \tikz[baseline=-0.65ex,scale=0.5] \node[inner sep=0] at (0,-1) {,\,}; \begin{tikzpicture}[baseline=-0.65ex,scale=0.5] \draw[densely dashed] (-1,-1) -- (3,-1); \node[hackennode] (0) at (0,-1) {}; \node[hackennode] (1) at (0,0) {}; \node[hackennode] (2) at (0,1) {}; \node[hackennode] (3) at (0,2) {}; \draw[hackenline,blue] (0) -- (1) {}; \draw[hackenline,red] (1) -- (2) -- (3) {}; \node[hackennode] (10) at (1,-1) {}; \node[hackennode] (11) at (1,0) {}; \node[hackennode] (12) at (1,1) {}; \node[hackennode] (13) at (1,2) {}; \draw[hackenline,blue] (10) -- (11) {}; \draw[hackenline,red] (11) -- (12) -- (13) {}; \node[hackennode] (20) at (2,-1) {}; \node[hackennode] (21) at (2,0) {}; \draw[hackenline,red] (20) -- (21); \end{tikzpicture} \middle | \begin{tikzpicture}[baseline=-0.65ex,scale=0.5] \draw[densely dashed] (-1,-1) -- (3,-1); \node[hackennode] (0) at (0,-1) {}; \node[hackennode] (1) at (0,0) {}; \node[hackennode] (2) at (0,1) {}; \draw[hackenline,blue] (0) -- (1) {}; \draw[hackenline,red] (1) -- (2) {}; \node[hackennode] (10) at (1,-1) {}; \node[hackennode] (11) at (1,0) {}; \node[hackennode] (12) at (1,1) {}; \node[hackennode] (13) at (1,2) {}; \draw[hackenline,blue] (10) -- (11) {}; \draw[hackenline,red] (11) -- (12) -- (13) {}; \node[hackennode] (20) at (2,-1) {}; \node[hackennode] (21) at (2,0) {}; \node[hackennode] (22) at (2,1) {}; \draw[hackenline,red] (20) -- (21); \draw[hackenline,blue] (21) -- (22); \end{tikzpicture} \tikz[baseline=-0.65ex,scale=0.5] \node[inner sep=0] at (0,-1) {,\,}; \begin{tikzpicture}[baseline=-0.65ex,scale=0.5] \draw[densely dashed] (-1,-1) -- (3,-1); \node[hackennode] (0) at (0,-1) {}; \node[hackennode] (1) at (0,0) {}; \draw[hackenline,blue] (0) -- (1) {}; \node[hackennode] (10) at (1,-1) {}; \node[hackennode] (11) at (1,0) {}; \node[hackennode] (12) at (1,1) {}; \node[hackennode] (13) at (1,2) {}; \draw[hackenline,blue] (10) -- (11) {}; \draw[hackenline,red] (11) -- (12) -- (13) {}; \node[hackennode] (20) at (2,-1) {}; \node[hackennode] (21) at (2,0) {}; \node[hackennode] (22) at (2,1) {}; \draw[hackenline,red] (20) -- (21); \draw[hackenline,blue] (21) -- (22); \end{tikzpicture} \tikz[baseline=-0.65ex,scale=0.5] \node[inner sep=0] at (0,-1) {,\,}; \begin{tikzpicture}[baseline=-0.65ex,scale=0.5] \draw[densely dashed] (-1,-1) -- (3,-1); \node[hackennode] (0) at (0,-1) {}; \node[hackennode] (1) at (0,0) {}; \node[hackennode] (2) at (0,1) {}; \node[hackennode] (3) at (0,2) {}; \draw[hackenline,blue] (0) -- (1) {}; \draw[hackenline,red] (1) -- (2) -- (3) {}; \node[hackennode] (10) at (1,-1) {}; \node[hackennode] (11) at (1,0) {}; \node[hackennode] (12) at (1,1) {}; \node[hackennode] (13) at (1,2) {}; \draw[hackenline,blue] (10) -- (11) {}; \draw[hackenline,red] (11) -- (12) -- (13) {}; \end{tikzpicture} \right \}$
}% End group with \Large
\caption{}
\end{figure}

\end{document}

-
I took the liberty to format your code to make it a easier to read, and removed some unnecessary stuff in the preamble. It's great that you showed a working example, but it's usually a good idea to include only the relevant portion of the code. See this question for more information: meta.tex.stackexchange.com/questions/228/… –  Martin Tapankov Feb 23 '11 at 8:17
@Martin: Thanks for editing it...I tried to take out all the irrelevant garbage, but I honestly didn't know what some of the preamble stuff was... –  pgaf Feb 24 '11 at 18:42
Don't forget to mark the answer as "accepted" (see the checkmark below the score) if you are satisfied with the solution. This will help others with similar problems to see what worked for you. –  Martin Tapankov Feb 24 '11 at 19:19

\draw[densely dashed] (-1,-1) -- node[below] {b)} (3,-1);

Thanks! (And sorry that I orphaned your comment by deleting mine.) A tip for the next image: Use png instead of jpg; this gives much better quality for this kind of image. –  Hendrik Vogt Feb 23 '11 at 9:41