I want to draw circles on top of a chemfig molecule and then connect these circles with elements in a table above. I have gotten this far:
\documentclass{memoir}
\usepackage{tikz}
\usepackage{chemfig}
\begin{document}
\begin{figure}
\begin{tikzpicture}[node distance=0]
\node (foo){};
\node (a) [draw,minimum height=0.5cm,minimum width = 0.7cm, above of = foo, node distance = 60 pt, xshift=0cm, ]{$1$};
\node (b) [draw,minimum height=0.5cm,minimum width = 0.7cm, right of = a, xshift=0.7cm]{$1$};
\node (c) [draw,minimum height=0.5cm,minimum width = 0.7cm, right of = a, xshift=1.4cm]{$1$};
\node (d) [draw,minimum height=0.5cm,minimum width = 0.7cm, right of = a, xshift=2.1cm]{$0$};
\node [above of = a, node distance = 12pt] {\small$C$};
\node [above of = b, node distance = 12pt] {\small$O$};
\node [above of = c, node distance = 12pt] {\small$OH$};
\node [above of = d, node distance = 12pt] {\small$N$};
\setatomsep{2.5em}
\chemfig[below of = a]{H-C(-[:90]H)(-[:-90]H)-C(-[:-90]H)(-[:90]H)-O-[:60]H}
\draw (-0.3,0.5) circle (0.8cm);
\draw (-0.3,0.5) -- (c);
\end{tikzpicture}
\end{figure}
\end{document}
For some reason I have trouble making the line go to the right location but I also wonder if I have to guess where my circles go like this or of there is some nice way of figuring out the location of the chemfig atoms?
This is what my current stuff looks like and some crude drawing in red explaining what more I wanted to do but didn't really manage to do:
remember picture
option totikz
and to use the@{argument}
syntax to create nodes that you can refer to later