Rotating Standard Graphs

Clash Royale CLAN TAG#URR8PPP
up vote
6
down vote
favorite
Is there are way to rotate standard graphs in tikz?
For example, the following produces a cyclic graph with 6 vertices
begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
graph[clockwise, radius=2cm] subgraph C_n [n=6];
endtikzpicture
Is there a way I can rotate this graph by a given angle?
tikz-pgf tikz-graphs
add a comment |Â
up vote
6
down vote
favorite
Is there are way to rotate standard graphs in tikz?
For example, the following produces a cyclic graph with 6 vertices
begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
graph[clockwise, radius=2cm] subgraph C_n [n=6];
endtikzpicture
Is there a way I can rotate this graph by a given angle?
tikz-pgf tikz-graphs
add a comment |Â
up vote
6
down vote
favorite
up vote
6
down vote
favorite
Is there are way to rotate standard graphs in tikz?
For example, the following produces a cyclic graph with 6 vertices
begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
graph[clockwise, radius=2cm] subgraph C_n [n=6];
endtikzpicture
Is there a way I can rotate this graph by a given angle?
tikz-pgf tikz-graphs
Is there are way to rotate standard graphs in tikz?
For example, the following produces a cyclic graph with 6 vertices
begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
graph[clockwise, radius=2cm] subgraph C_n [n=6];
endtikzpicture
Is there a way I can rotate this graph by a given angle?
tikz-pgf tikz-graphs
edited Aug 16 at 23:34
asked Aug 16 at 1:01
Neil
313
313
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
9
down vote
Using rotate and transform shape you can rotate the graph any angle you choose.

documentclass[tikz,margin=0.5cm]standalone
usetikzlibrarygraphs
usetikzlibrarygraphs.standard
begindocument
begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
beginscope[rotate=15,transform shape]
graph[clockwise, radius=2cm] subgraph C_n [n=6];
endscope
endtikzpicture
enddocument
add a comment |Â
up vote
8
down vote
Just for testing, the graph generated by library Graphs actues as a node, when you use scope with the modificator rotate, only afects coordinates, to rotate each node you must declare the rotate value in each node style; the correct way is using trasform shape, here a test of these aspects included basic tikz code drawing, in red, and imported images in nodes using graphicx.
RESULT:

MWE: animation using imagemagik converter
% arara: pdflatex: synctex: yes, action: nonstopmode
% arara: animate: density: 150, delay: 15, other: -background white -alpha remove
% arara: showanimate
documentclass[tikz,margin=0.5cm]standalone
usetikzlibrarygraphs
usepackagegraphicx
usetikzlibrarygraphs.standard,calc
begindocument
foreach x in 0,1,...,29
begintikzpicture[
every node/.style=
fill=blue!20,
circle,
very thick,
inner sep=0pt,
minimum size=12pt
]
pgfmathparseint(12*x)
edefAnglepgfmathresult
%Set image limits to avoid flickering
draw(-3,4) rectangle (9,-9);
draw(90:2.7) node[fill=none,font=scriptsize] Scope[rotate=0]
++(6,0) node[fill=none,font=scriptsize] Scope[rotate=Angle]
++(0,-6) node[fill=none,font=scriptsize] Scope[rotate=Angle,trasform shape]
++(-6,0) node[fill=none,font=scriptsize] Scope[rotate=0], each node[rotate=Angle];
%basic drawing test
beginscope[rotate=0]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) 0;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
%test rotate
beginscope[shift=(6,0),rotate=Angle]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
%test rotate nodes
beginscope[shift=(0,-6),rotate=0]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20,rotate=Angle](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none,rotate=Angle]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle,rotate=Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm,angle=Angle]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm,angle=-Angle]example-image-a;
endscope
%test 4 transform shape
beginscope[shift=(6,-6),rotate=Angle, transform shape]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
endtikzpicture
enddocument
add a comment |Â
up vote
3
down vote
You should look into the tkz-berge package. It is especially designed for graph theory and the rotation is easily set through the options.
documentclass[11pt,border=2pt]standalone
usepackagetkz-berge
begindocument
begintikzpicture
GraphInit[vstyle=Shade]
SetVertexNoLabel
grCycle[x=0,y=0, rotation=90]6
grCycle[x=10,y=0]6
endtikzpicture
enddocument
The output running in Gummi is:
Notice there is a command for cycles, grCycle, and in the options the placement of the first cycle is put at x=0 and y=0 and is rotated 90 degrees. Also notice there are specific looks you can make your graph have; the one below is Shade. There is also the option to label vertices inside or outside and to weight the arcs.
EDIT: I should also point out the "Gallery of Named Graphs" which is here. This includes 3 different representations of the Petersen graph, cages, and others not mentioned in the documentation of tkz-berge.
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
9
down vote
Using rotate and transform shape you can rotate the graph any angle you choose.

documentclass[tikz,margin=0.5cm]standalone
usetikzlibrarygraphs
usetikzlibrarygraphs.standard
begindocument
begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
beginscope[rotate=15,transform shape]
graph[clockwise, radius=2cm] subgraph C_n [n=6];
endscope
endtikzpicture
enddocument
add a comment |Â
up vote
9
down vote
Using rotate and transform shape you can rotate the graph any angle you choose.

documentclass[tikz,margin=0.5cm]standalone
usetikzlibrarygraphs
usetikzlibrarygraphs.standard
begindocument
begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
beginscope[rotate=15,transform shape]
graph[clockwise, radius=2cm] subgraph C_n [n=6];
endscope
endtikzpicture
enddocument
add a comment |Â
up vote
9
down vote
up vote
9
down vote
Using rotate and transform shape you can rotate the graph any angle you choose.

documentclass[tikz,margin=0.5cm]standalone
usetikzlibrarygraphs
usetikzlibrarygraphs.standard
begindocument
begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
beginscope[rotate=15,transform shape]
graph[clockwise, radius=2cm] subgraph C_n [n=6];
endscope
endtikzpicture
enddocument
Using rotate and transform shape you can rotate the graph any angle you choose.

documentclass[tikz,margin=0.5cm]standalone
usetikzlibrarygraphs
usetikzlibrarygraphs.standard
begindocument
begintikzpicture[every node/.style=fill,circle,very thick,inner sep=0pt]
beginscope[rotate=15,transform shape]
graph[clockwise, radius=2cm] subgraph C_n [n=6];
endscope
endtikzpicture
enddocument
answered Aug 16 at 1:21
Milo
4,71821243
4,71821243
add a comment |Â
add a comment |Â
up vote
8
down vote
Just for testing, the graph generated by library Graphs actues as a node, when you use scope with the modificator rotate, only afects coordinates, to rotate each node you must declare the rotate value in each node style; the correct way is using trasform shape, here a test of these aspects included basic tikz code drawing, in red, and imported images in nodes using graphicx.
RESULT:

MWE: animation using imagemagik converter
% arara: pdflatex: synctex: yes, action: nonstopmode
% arara: animate: density: 150, delay: 15, other: -background white -alpha remove
% arara: showanimate
documentclass[tikz,margin=0.5cm]standalone
usetikzlibrarygraphs
usepackagegraphicx
usetikzlibrarygraphs.standard,calc
begindocument
foreach x in 0,1,...,29
begintikzpicture[
every node/.style=
fill=blue!20,
circle,
very thick,
inner sep=0pt,
minimum size=12pt
]
pgfmathparseint(12*x)
edefAnglepgfmathresult
%Set image limits to avoid flickering
draw(-3,4) rectangle (9,-9);
draw(90:2.7) node[fill=none,font=scriptsize] Scope[rotate=0]
++(6,0) node[fill=none,font=scriptsize] Scope[rotate=Angle]
++(0,-6) node[fill=none,font=scriptsize] Scope[rotate=Angle,trasform shape]
++(-6,0) node[fill=none,font=scriptsize] Scope[rotate=0], each node[rotate=Angle];
%basic drawing test
beginscope[rotate=0]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) 0;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
%test rotate
beginscope[shift=(6,0),rotate=Angle]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
%test rotate nodes
beginscope[shift=(0,-6),rotate=0]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20,rotate=Angle](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none,rotate=Angle]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle,rotate=Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm,angle=Angle]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm,angle=-Angle]example-image-a;
endscope
%test 4 transform shape
beginscope[shift=(6,-6),rotate=Angle, transform shape]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
endtikzpicture
enddocument
add a comment |Â
up vote
8
down vote
Just for testing, the graph generated by library Graphs actues as a node, when you use scope with the modificator rotate, only afects coordinates, to rotate each node you must declare the rotate value in each node style; the correct way is using trasform shape, here a test of these aspects included basic tikz code drawing, in red, and imported images in nodes using graphicx.
RESULT:

MWE: animation using imagemagik converter
% arara: pdflatex: synctex: yes, action: nonstopmode
% arara: animate: density: 150, delay: 15, other: -background white -alpha remove
% arara: showanimate
documentclass[tikz,margin=0.5cm]standalone
usetikzlibrarygraphs
usepackagegraphicx
usetikzlibrarygraphs.standard,calc
begindocument
foreach x in 0,1,...,29
begintikzpicture[
every node/.style=
fill=blue!20,
circle,
very thick,
inner sep=0pt,
minimum size=12pt
]
pgfmathparseint(12*x)
edefAnglepgfmathresult
%Set image limits to avoid flickering
draw(-3,4) rectangle (9,-9);
draw(90:2.7) node[fill=none,font=scriptsize] Scope[rotate=0]
++(6,0) node[fill=none,font=scriptsize] Scope[rotate=Angle]
++(0,-6) node[fill=none,font=scriptsize] Scope[rotate=Angle,trasform shape]
++(-6,0) node[fill=none,font=scriptsize] Scope[rotate=0], each node[rotate=Angle];
%basic drawing test
beginscope[rotate=0]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) 0;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
%test rotate
beginscope[shift=(6,0),rotate=Angle]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
%test rotate nodes
beginscope[shift=(0,-6),rotate=0]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20,rotate=Angle](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none,rotate=Angle]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle,rotate=Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm,angle=Angle]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm,angle=-Angle]example-image-a;
endscope
%test 4 transform shape
beginscope[shift=(6,-6),rotate=Angle, transform shape]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
endtikzpicture
enddocument
add a comment |Â
up vote
8
down vote
up vote
8
down vote
Just for testing, the graph generated by library Graphs actues as a node, when you use scope with the modificator rotate, only afects coordinates, to rotate each node you must declare the rotate value in each node style; the correct way is using trasform shape, here a test of these aspects included basic tikz code drawing, in red, and imported images in nodes using graphicx.
RESULT:

MWE: animation using imagemagik converter
% arara: pdflatex: synctex: yes, action: nonstopmode
% arara: animate: density: 150, delay: 15, other: -background white -alpha remove
% arara: showanimate
documentclass[tikz,margin=0.5cm]standalone
usetikzlibrarygraphs
usepackagegraphicx
usetikzlibrarygraphs.standard,calc
begindocument
foreach x in 0,1,...,29
begintikzpicture[
every node/.style=
fill=blue!20,
circle,
very thick,
inner sep=0pt,
minimum size=12pt
]
pgfmathparseint(12*x)
edefAnglepgfmathresult
%Set image limits to avoid flickering
draw(-3,4) rectangle (9,-9);
draw(90:2.7) node[fill=none,font=scriptsize] Scope[rotate=0]
++(6,0) node[fill=none,font=scriptsize] Scope[rotate=Angle]
++(0,-6) node[fill=none,font=scriptsize] Scope[rotate=Angle,trasform shape]
++(-6,0) node[fill=none,font=scriptsize] Scope[rotate=0], each node[rotate=Angle];
%basic drawing test
beginscope[rotate=0]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) 0;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
%test rotate
beginscope[shift=(6,0),rotate=Angle]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
%test rotate nodes
beginscope[shift=(0,-6),rotate=0]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20,rotate=Angle](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none,rotate=Angle]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle,rotate=Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm,angle=Angle]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm,angle=-Angle]example-image-a;
endscope
%test 4 transform shape
beginscope[shift=(6,-6),rotate=Angle, transform shape]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
endtikzpicture
enddocument
Just for testing, the graph generated by library Graphs actues as a node, when you use scope with the modificator rotate, only afects coordinates, to rotate each node you must declare the rotate value in each node style; the correct way is using trasform shape, here a test of these aspects included basic tikz code drawing, in red, and imported images in nodes using graphicx.
RESULT:

MWE: animation using imagemagik converter
% arara: pdflatex: synctex: yes, action: nonstopmode
% arara: animate: density: 150, delay: 15, other: -background white -alpha remove
% arara: showanimate
documentclass[tikz,margin=0.5cm]standalone
usetikzlibrarygraphs
usepackagegraphicx
usetikzlibrarygraphs.standard,calc
begindocument
foreach x in 0,1,...,29
begintikzpicture[
every node/.style=
fill=blue!20,
circle,
very thick,
inner sep=0pt,
minimum size=12pt
]
pgfmathparseint(12*x)
edefAnglepgfmathresult
%Set image limits to avoid flickering
draw(-3,4) rectangle (9,-9);
draw(90:2.7) node[fill=none,font=scriptsize] Scope[rotate=0]
++(6,0) node[fill=none,font=scriptsize] Scope[rotate=Angle]
++(0,-6) node[fill=none,font=scriptsize] Scope[rotate=Angle,trasform shape]
++(-6,0) node[fill=none,font=scriptsize] Scope[rotate=0], each node[rotate=Angle];
%basic drawing test
beginscope[rotate=0]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) 0;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
%test rotate
beginscope[shift=(6,0),rotate=Angle]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
%test rotate nodes
beginscope[shift=(0,-6),rotate=0]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20,rotate=Angle](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none,rotate=Angle]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle,rotate=Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm,angle=Angle]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm,angle=-Angle]example-image-a;
endscope
%test 4 transform shape
beginscope[shift=(6,-6),rotate=Angle, transform shape]
%Graph generated objet
graph[clockwise, radius=2cm] subgraph C_n [n=6];
%Tikz basic code objet
foreach n in 1,2,...,6
node[fill=red!20](nn) at (60*n:1.5)n;
draw[red,->](n1)
-- (n2) -- node[midway,sloped,above=-10pt, font=tiny,fill=none]tikz objet (n3) -- (n4)
-- (n5) -- (n6) -- (n1);
node[label=-90:tiny Angle] at (0:2.5cm) Angle;
%Graphicx Objet
node at (0,0)includegraphics[width=1.5cm]example-image;
node at (180:2.5cm)includegraphics[width=0.5cm]example-image-a;
endscope
endtikzpicture
enddocument
answered Aug 16 at 8:34
J Leon V.
5,492425
5,492425
add a comment |Â
add a comment |Â
up vote
3
down vote
You should look into the tkz-berge package. It is especially designed for graph theory and the rotation is easily set through the options.
documentclass[11pt,border=2pt]standalone
usepackagetkz-berge
begindocument
begintikzpicture
GraphInit[vstyle=Shade]
SetVertexNoLabel
grCycle[x=0,y=0, rotation=90]6
grCycle[x=10,y=0]6
endtikzpicture
enddocument
The output running in Gummi is:
Notice there is a command for cycles, grCycle, and in the options the placement of the first cycle is put at x=0 and y=0 and is rotated 90 degrees. Also notice there are specific looks you can make your graph have; the one below is Shade. There is also the option to label vertices inside or outside and to weight the arcs.
EDIT: I should also point out the "Gallery of Named Graphs" which is here. This includes 3 different representations of the Petersen graph, cages, and others not mentioned in the documentation of tkz-berge.
add a comment |Â
up vote
3
down vote
You should look into the tkz-berge package. It is especially designed for graph theory and the rotation is easily set through the options.
documentclass[11pt,border=2pt]standalone
usepackagetkz-berge
begindocument
begintikzpicture
GraphInit[vstyle=Shade]
SetVertexNoLabel
grCycle[x=0,y=0, rotation=90]6
grCycle[x=10,y=0]6
endtikzpicture
enddocument
The output running in Gummi is:
Notice there is a command for cycles, grCycle, and in the options the placement of the first cycle is put at x=0 and y=0 and is rotated 90 degrees. Also notice there are specific looks you can make your graph have; the one below is Shade. There is also the option to label vertices inside or outside and to weight the arcs.
EDIT: I should also point out the "Gallery of Named Graphs" which is here. This includes 3 different representations of the Petersen graph, cages, and others not mentioned in the documentation of tkz-berge.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
You should look into the tkz-berge package. It is especially designed for graph theory and the rotation is easily set through the options.
documentclass[11pt,border=2pt]standalone
usepackagetkz-berge
begindocument
begintikzpicture
GraphInit[vstyle=Shade]
SetVertexNoLabel
grCycle[x=0,y=0, rotation=90]6
grCycle[x=10,y=0]6
endtikzpicture
enddocument
The output running in Gummi is:
Notice there is a command for cycles, grCycle, and in the options the placement of the first cycle is put at x=0 and y=0 and is rotated 90 degrees. Also notice there are specific looks you can make your graph have; the one below is Shade. There is also the option to label vertices inside or outside and to weight the arcs.
EDIT: I should also point out the "Gallery of Named Graphs" which is here. This includes 3 different representations of the Petersen graph, cages, and others not mentioned in the documentation of tkz-berge.
You should look into the tkz-berge package. It is especially designed for graph theory and the rotation is easily set through the options.
documentclass[11pt,border=2pt]standalone
usepackagetkz-berge
begindocument
begintikzpicture
GraphInit[vstyle=Shade]
SetVertexNoLabel
grCycle[x=0,y=0, rotation=90]6
grCycle[x=10,y=0]6
endtikzpicture
enddocument
The output running in Gummi is:
Notice there is a command for cycles, grCycle, and in the options the placement of the first cycle is put at x=0 and y=0 and is rotated 90 degrees. Also notice there are specific looks you can make your graph have; the one below is Shade. There is also the option to label vertices inside or outside and to weight the arcs.
EDIT: I should also point out the "Gallery of Named Graphs" which is here. This includes 3 different representations of the Petersen graph, cages, and others not mentioned in the documentation of tkz-berge.
edited Aug 16 at 1:57
answered Aug 16 at 1:31
DJP
6,66921628
6,66921628
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f446225%2frotating-standard-graphs%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password