# Tikz graph library with no node text

I'm trying to use the TikZ graph library to draw graphs, but I'm having trouble figuring out how to draw graphs without text on the nodes. Here's a MWE.

\documentclass{article}
\usepackage{amsthm, amsfonts, ae}
\usepackage{tikz}
\usetikzlibrary{graphs, graphdrawing}
\usegdlibrary{circular}

\begin{document}

\begin{tikzpicture}
[baseline=-1mm,
field/.style={circle,fill=black, minimum size=2mm},
wall/.style={rectangle,draw=black, fill=white, minimum size=2mm}]
\graph [simple necklace layout, nodes={field},horizontal=C to B] {
A[wall] -- B -- C -- A,
};
\end{tikzpicture}

\end{document}


What I would like is for the nodes of the graph to not have A, B, and C rendered as text on each node, but for them to simply have no text at all. This seems simple but I've not found a way to do it yet looking through the TikZ manual.

• Welcome to TeX.SE. While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. This is especially important for tikz as there are numerous libraries. – Peter Grill Jan 22 at 17:39

You can use the as key for this, which is documented on page 282 (in section 19.3.4 Syntax of Node Specifications) of the manual for version 3.1.8b. This key lets you set the text of the node separately from the node names, and if you want all the nodes to be empty, add as= to the nodes={...}, i.e.:

\documentclass{article}
\usepackage{amsthm, amsfonts, ae}
\usepackage{tikz}
\usetikzlibrary{graphs, graphdrawing}
\usegdlibrary{circular}

\begin{document}

\begin{tikzpicture}
[baseline=-1mm,
field/.style={circle,fill=black, minimum size=2mm},
wall/.style={rectangle,draw=black, fill=white, minimum size=2mm}]
\graph [simple necklace layout,
nodes={field,as=}, % <-- added as= here
horizontal=C to B] {
A[wall] -- B -- C -- A,
};
\end{tikzpicture}

\end{document}