[Tex/LaTex] Creating a graph in LyX


I am new to LyX and I was trying to build the following graph:

enter image description here

  • I tried to draw it using Paint but failed to do a proper graph. Hope LyX can do a better job then me.

How To draw this graph in LyX?

Best Answer

According to @scottkosty, you should be able to import the following snippet into Lyx.

\newdimen\R % radius
\newdimen\SmallR % node radius
\node[circle,minimum size=2*\SmallR,draw,thick] (1) at (0,0) {1};
\foreach \X in {2,...,8}
{\node[circle,minimum size=2*\SmallR,draw,thick] (\X) at ({-\X*\A+180}:\R) {\X};}
\foreach \X in {2,...,8}
\draw[-latex] (\X)--({\Y});
\draw[-latex] (1)--({\Y});}

When compiled with pdflatex, it produces

enter image description here

Related Question