2

I am trying to refer to nodes set within a graph structure deployed by using the graphdrawing library but I don't get the wished for result. This is my MWE, which is compiled over LuaLaTeX in order to have the functionality of the library available:

%\RequirePackage{luatex85} <- Not really needed, I believe

\documentclass{article}

\usepackage{tikz}

\usetikzlibrary{graphs,graphdrawing}
  \usegdlibrary{trees}

\pagestyle{empty}

\begin{document}
\centering
\begin{tikzpicture}[binary tree layout]    
  \graph{a -- b};
  \draw (a) circle[radius=2mm];
  \draw (b) circle[radius=5mm];
\end{tikzpicture}
\end{document}  

I'd like to have a circle centered on each node, but what I get instead is the two circles centered both on node "a". I may be doing something in the wrong way here, but I don't know what.

3

It works if you add the binary tree layout option to the \graph instead of the tikzpicture:

\documentclass{article}

\usepackage{tikz}

\usetikzlibrary{graphs,graphdrawing}
  \usegdlibrary{trees,circular}

\pagestyle{empty}

\begin{document}
\begin{tikzpicture}[binary tree layout]
  \graph 
  {a -- b};
  \draw (a) circle[radius=2mm];
  \draw (b) circle[radius=5mm];
\end{tikzpicture}
\quad
\begin{tikzpicture}
  \graph [binary tree layout]
  {a -- b};
  \draw (a) circle[radius=2mm];
  \draw (b) circle[radius=5mm];  
\end{tikzpicture}
\end{document}  

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.