TransWikia.com

Drawing a circular graph using xypic

TeX - LaTeX Asked on December 7, 2020

How can I draw a circular graph, as in the picture below, using xypic?

enter image description here

2 Answers

My it is only a comment instead of a true answer, because I think that with xymatrix the way is very very long and with lot of difficulties.

documentclass[a4paper,12pt]{article}
usepackage[all]{xy}
usepackage{newtxtext,newtxmath}

begin{document}
xymatrix{
G& {overset{displaystyle 1}{bullet}}ar@/^1pc/[dr]^{alpha_1} &  
A& B& {bullet}ar@/^1pc/[dl]
D& E& F}
end{document}

enter image description here

My problems are:

  1. @{.} give me only dotted straight line and not curved arrows withouts tips. In addendum in the picture there are only 3 dots.
  2. To put the rotated circle labels. For 1 it is very simple but for the others (????).
  3. Create a fast circle loop (see the § 8.2 Circles and Ellipses of the complete/old documentation http://texdoc.net/texmf-dist/doc/generic/xypic/xyrefer.pdf).

enter image description here

I should read and to understood the manual and the commands that they are differents from the canonical but not very simple use of the arrows.

Answered by Sebastiano on December 7, 2020

Compile with Asymptote

unitsize(3cm);

pair[] A;
for (int i=0; i<8; ++i){ A[i]=dir(90-i*45); }

arrowbar Ar=Arrow(TeXHead,2);
margin Tr=TrueMargin(10,10);
margin Tr1=TrueMargin(10,15);
margin Tr2=TrueMargin(15,10);

dot("$1$",A[0],2*dir(A[0]));
dot("$2$",A[1],2*dir(A[1]));
path a1=arc(0,A[0],A[1],false);
draw(Label("$alpha_1$",2*LeftSide),a1,Ar,Tr);
dot("$3$",A[2],2*dir(A[2]));
path a2=arc(0,A[1],A[2],false);
draw(Label("$alpha_2$",2*LeftSide),a2,Ar,Tr);
dot("$i$",A[4],2*dir(A[4]));

frame f;
draw(f,(-7.5,0)--(7.5,0),dotted+2bp);
add(rotate(degrees(dir(A[3]))+90)*f,A[3]);
add(rotate(degrees(dir(A[5]))+90)*f,A[5]);

draw(Label("$alpha_3$",2*LeftSide),arc(0,A[2],A[3],false),Ar,Tr1);
draw(Label("$alpha_{i-1}$",2*LeftSide),arc(0,A[3],A[4],false),Ar,Tr2);
draw(Label("$alpha_i$",2*LeftSide),arc(0,A[4],A[5],false),Ar,Tr1);
draw(Label("$alpha_{n-2}$",2*LeftSide),arc(0,A[5],A[6],false),Ar,Tr2);

dot("$n-1$",A[6],2*dir(A[6]));
dot("$n$",A[7],2*dir(A[7]));
draw(Label("$alpha_n$",2*LeftSide),arc(0,A[7],A[0],false),Ar,Tr);
draw(Label("$alpha_{n-1}$",2*LeftSide),arc(0,A[6],A[7],false),Ar,Tr);

enter image description here

Answered by Nguyen Van Justonly Chi on December 7, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP