Tikz Network Manual
Tikz Network Manual
Tikz Network Manual
TIKZ-NETWORK
arXiv:1709.06005v2 [cs.OH] 31 Jul 2018
MANUAL
Lay
er α
Lay
er β
VERSION 1.0
tikz-network
version 1.0
https://github.com/hackl/tikz- network
This program is free software: you can redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
out even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see
https://www.gnu.org/licenses/.
Contents
1 Introduction 5
1.1 How to read this manual? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.1 A few explanations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.2 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.3 Additional help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 Additional necessary packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 Simple Networks 9
2.1 Vertex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Edge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.3 Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3 Complex Networks 23
3.1 Vertices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2 Edges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4 Multilayer Networks 31
4.1 Simple Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.2 Complex Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.3 Layers and Layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.4 Plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5 Default Settings 37
5.1 General Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.2 Vertex Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.3 Edge Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.4 Text Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.5 Plane Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
A ToDo 43
A.1 Code to fix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
A.2 Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
A.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4 CONTENTS
A.4 Add-ons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
B Add-ons 45
B.1 Python networks to TikZ with network2tikz . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
B.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
B.1.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
B.1.3 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
B.1.4 Simple example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
B.1.5 The plot function in detail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
1 Introduction
• The default settings used and how they can be modified is ex-
plained in Chapter 5.
\begin{tikzpicture}
\filldraw (-.2,.2) circle (2pt) (.2,.2) circle (2pt);
\draw (0,0) circle (5mm) (-.3,-.1) .. controls (0,-.3) ..
(.3,-.1);
\end{tikzpicture}
\begin{tikzpicture}
\draw (0,0) .. controls (1,1) and (2,1) .. (2,0);
\end{tikzpicture}
1.1.2 Inputs
The commands in the tikz-network library (e.g. \Vertex, \Edge)
always start with capital letters and DO NOT need a semicolon «;»
at the end. Boolean arguments start also with capital letters (e.g.
hNoLabeli). Arguments which need an user input, use are written in
small letters (e.g. hcolori).
tikz-network manual 7
1.2 Installation
% ------------
% header
\documentclass{scrreprt}
item % ------------
% packages
\usepackage{tikz-network}
2.1 Vertex
\Vertex[hlocal optionsi]{Name}
Option Default Type Definition Table 2.1: Local options for the
\Vertex command.
x 0 measure x-coordinate
y 0 measure y-coordinate
size {} measure diameter of the circle
color {} color fill color of vertex
opacity {} number opacity of the fill color
shape {} string shape of the vertex
label {} string label
fontsize {} string font size of the label
fontcolor {} color font color of the label
fontscale {} number scale of the label
position center valuea label position
distance 0 measure label distance from the center
style {} string additional TikZ styles
layer {} number assigned layer of the vertex
NoLabel false Boolean delete the label
IdAsLabel false Boolean uses the Name as label
Math false Boolean displays the label in math mode
RGB false Boolean allow RGB colors
Pseudo false Boolean create a pseudo vertex
a
either measure or string
The order how the options are entered does not matter. Changes
to the default Vertex layout can be made with \SetVertexStyle1 1
see Section 5.2
\Vertex[hxi=measure,hyi=measure]{Name}
entered measures are in default units (cm). Changing the unites (lo-
cally) can be done by adding the unit to the measure2 . Changes to 2
e.g. x=1 in
the default setting can be made with \SetDefaultUnit3 . 3
see Section 5.1
\begin{tikzpicture}
\Vertex{A}
B
\Vertex[x=1,y=1]{B}
\Vertex[x=2]{C}
\end{tikzpicture}
A C
\Vertex[hsizei=measure]{Name}
The diameter of the vertex can be changed with the option hsizei.
Per default a vertex has 0.6 cm in diameter. Also, here the default
units are cm and have not to be added to the measure.
\begin{tikzpicture}
\Vertex[size=.3]{A}
\Vertex[x=1,size=.7]{B}
\Vertex[x=2.3,size=1]{C}
\end{tikzpicture}
\Vertex[hcolori=color]{Name}
\begin{tikzpicture}
\Vertex[color = blue]{A}
\Vertex[x=1,color=red]{B}
\Vertex[x=2,color=green!70!blue]{C}
\end{tikzpicture}
\Vertex[hopacityi=number]{Name}
With the option hopacityi the opacity of the vertex fill color can
be modified. The range of the number lies between 0 and 1. Where 0
represents a fully transparent fill and 1 a solid fill.
\begin{tikzpicture}
\Vertex[opacity = 1]{A}
\Vertex[x=1,opacity =.7]{B}
\Vertex[x=2,opacity =.2]{C}
\end{tikzpicture}
\Vertex[hshapei=string]{Name}
With the option hshapei the shape of the vertex can be modified.
Thereby the shapes implemented in TikZ can be used, including:
circle, rectangle, diamond, trapezium, semicircle, isosceles triangle, . . . .
\begin{tikzpicture}
\Vertex[shape = rectangle]{A}
\Vertex[x=1,shape = diamond]{B}
\Vertex[x=2,shape = isosceles triangle]{C}
\end{tikzpicture}
tikz-network manual 11
\Vertex[hlabeli=string]{Name}
\begin{tikzpicture}
\Vertex[label=foo]{A}
\Vertex[x=1,label=bar]{B} foo bar u1
\Vertex[x=2,label=$u_1$]{C}
\end{tikzpicture}
\Vertex[hlabeli=string,hfontsizei=string]{Name}
The font size of the hlabeli can be modified with the option
hfontsizei. Here common LATEX font size commands4 can be used 4
e.g. \tiny, \scriptsize,
\footnotesize, \small, . . . .
to change the size of the label.
\begin{tikzpicture}
\Vertex[label=foo,fontsize=\normalsize]{A}
\Vertex[x=1,label=bar,fontsize=\tiny]{B} foo bar u1
\Vertex[x=2,label=$u_1$,fontsize=\large]{C}
\end{tikzpicture}
\Vertex[hlabeli=string,hfontcolori=color]{Name}
The color of the hlabeli can be changed with the option hfontcolori.
Currently, only the default TikZ and LATEX colors are supported5 . 5
TODO! Add RGB option!
\begin{tikzpicture}
\Vertex[label=foo,fontcolor=blue]{A}
\Vertex[x=1,label=bar,fontcolor=magenta]{B} foo bar u1
\Vertex[x=2,label=$u_1$,fontcolor=red]{C}
\end{tikzpicture}
\Vertex[hlabeli=string,hfontscalei=number]{Name}
\begin{tikzpicture}
\Vertex[label=foo,fontscale=0.5]{A}
\Vertex[x=1,label=bar,fontscale=1]{B} foo bar u1
\Vertex[x=2,label=$u_1$,fontscale=2]{C}
\end{tikzpicture}
\Vertex[hlabeli=string,hpositioni=value,hdistancei=number]{Name}
Per default the hpositioni of the hlabeli is in the center of the ver-
tex. Classical TikZ commands6 can be used to change the hpositioni 6
e.g. above, below, left, right, above left,
above right,. . .
12 simple networks
\begin{tikzpicture} C
\Vertex[label=A,position=below]{A}
\Vertex[x=1,label=B,position=below,distance=2mm]{B} 30◦
\Vertex[x=2,label=C,position=30,distance=1mm]{C} A
B
\end{tikzpicture}
\Vertex[hstylei={string}]{Name}
\begin{tikzpicture}
\Vertex[style={color=green}]{A}
\Vertex[x=1,style=dashed]{B}
\Vertex[x=2,style={shading=ball}]{C}
\end{tikzpicture}
\Vertex[hIdAsLabeli]{Name}
\Vertex[hNoLabeli,hlabeli=string]{Name}
\begin{tikzpicture}
\Vertex[IdAsLabel]{A}
\Vertex[x=1,label=B,NoLabel]{B} A
\Vertex[x=2,IdAsLabel,NoLabel]{C}
\end{tikzpicture}
\Vertex[hMathi,hlabeli=string]{Name}
\begin{tikzpicture}
\Vertex[IdAsLabel]{A1}
\Vertex[x=1,label=B_1,Math]{B} A1 B1 C1
\Vertex[x=2,Math,IdAsLabel]{C_1}
\end{tikzpicture}
\Vertex[hRGBi,hcolori=RGB values]{Name}
tikz-network manual 13
In order to display RGB colors for the vertex fill color, the op-
tion hRGBi has to be entered. In combination with this option, the
hcolori hast to be a list with the RGB values, separated by «,» and
within { }.7 7
e.g. the RGB code for white:
{255, 255, 255}
\begin{tikzpicture}
\Vertex[RGB,color={127,201,127}]{A}
\Vertex[x=1,RGB,color={190,174,212}]{B}
\Vertex[x=2,RGB,color={253,192,134}]{C}
\end{tikzpicture}
\Vertex[hPseudoi]{Name}
\begin{tikzpicture}
\Vertex{A}
\Vertex[x=2,Pseudo]{B}
\end{tikzpicture}
\Vertex[hlayeri=number]{Name}
2.2 Edge
Option Default Type Definition Table 2.2: Local options for the \Edge
command.
lw {} measure line width of the edge
color {} color edge color
opacity {} number opacity of the edge
bend 0 number angle out/in of the vertex
label {} string label
fontsize {} string font size of the label
fontcolor {} color font color of the label
fontscale {} number scale of the label
position {} string label position
distance 0.5 number label distance from vertex i
style {} string additional TikZ styles
path {} list path over several vertices
loopsize 1cm measure size parameter of the self-loop
loopposition 0 number orientation of the self-loop
loopshape 90 number loop angle out/in of the vertex
Direct false Boolean allow directed edges
Math false Boolean displays the label in math mode
RGB false Boolean allow RGB colors
NotInBG false Boolean edge is not in the background layer
\Edge(Vertex i)(Vertex j)
\begin{tikzpicture}
\Vertex{A} \Vertex[x=2]{B}
\Edge(A)(B)
\end{tikzpicture}
\Edge[hlwi=measure](Vertex i)(Vertex j)
The line width of an edge can be modified with the option hlwi.
Here, the unit of the measure has to be specified. The default value
is 1.5 pt.
tikz-network manual 15
\begin{tikzpicture}
\Vertex{A} \Vertex[x=2]{B} \Vertex[x=2,y=-1]{C}
\Edge[lw=3pt](A)(B)
\Edge[lw=5pt](A)(C)
\end{tikzpicture}
\Edge[hcolori=color](Vertex i)(Vertex j)
\begin{tikzpicture}
\Vertex{A} \Vertex[x=2]{B} \Vertex[x=2,y=-1]{C}
\Edge[color=red](A)(B)
\Edge[color=green!70!blue](A)(C)
\end{tikzpicture}
\Edge[hopacityi=number](Vertex i)(Vertex j)
With the option hopacityi the opacity of the edge line can be
modified. The range of the number lies between 0 and 1. Where 0
represents a fully transparent fill and 1 a solid fill.
\begin{tikzpicture}
\Vertex{A} \Vertex[x=2]{B} \Vertex[x=2,y=-1]{C}
\Edge[opacity=.7](A)(B)
\Edge[opacity=.2](A)(C)
\end{tikzpicture}
\Edge[hbendi=number](Vertex i)(Vertex j)
The shape of the edge can be modified with the hbendi option. If
nothing is specified a straight edge, between the vertices, is drawn.
The number defines the angle in which the edge is diverging from
its straight connection. A positive number bend the edge counter
clockwise, while a negative number make changes clockwise.
\begin{tikzpicture}
\Vertex{A} \Vertex[x=2]{B} 45◦
\Edge[bend=45](A)(B)
\Edge[bend=-70](A)(B) 70◦
\end{tikzpicture}
\Edge[hlabeli=string](Vertex i)(Vertex j)
An edge is labeled with the option hlabeli. For the label any
string argument can be used, including blank spaces. The environ-
ment $ $ can be used to display mathematical expressions.
\begin{tikzpicture}
\Vertex{A} \Vertex[x=2]{B}
X
\Edge[label=X](A)(B)
\end{tikzpicture}
16 simple networks
\Edge[hlabeli=string,hfontsizei=string](Vertex i)(Vertex j)
The font size of the hlabeli can be modified with the option
hfontsizei. Here common LATEX font size commands8 can be used 8
e.g. \tiny, \scriptsize,
\footnotesize, \small, . . . .
to change the size of the label.
\begin{tikzpicture}
\Vertex{A} \Vertex[x=2]{B} \Vertex[x=2,y=-1]{C} X
\Edge[label=X,fontsize=\large](A)(B)
Y
\Edge[label=Y,fontsize=\tiny](A)(C)
\end{tikzpicture}
\Edge[hlabeli=string,hfontcolori=color](Vertex i)(Vertex j)
The color of the hlabeli can be changed with the option hfontcolori.
Currently, only the default TikZ and LATEX colors are supported 9 . 9
TODO! Add RGB option!
\begin{tikzpicture} X
\Vertex{A} \Vertex[x=2]{B} \Vertex[x=2,y=-1]{C}
Y
\Edge[label=X,fontcolor=blue](A)(B)
\Edge[label=Y,fontcolor=red](A)(C)
\end{tikzpicture}
\Edge[hlabeli=string,hfontscalei=color](Vertex i)(Vertex j)
\begin{tikzpicture} X
\Edge[hlabeli=string,hpositioni=string](Vertex i)(Vertex j)
\begin{tikzpicture}
\Vertex{A} \Vertex[x=2]{B} \Vertex[x=2,y=-1]{C} X
\Edge[label=X,position=above](A)(B)
\Edge[label=Y,position={below left=2mm}](A)(C)
Y
\end{tikzpicture}
\Edge[hlabeli=string,hdistancei=number](Vertex i)(Vertex j)
The label position between the vertices can be modified with the
hdistancei option. Per default the hlabeli is centered between both
vertices. The position is expressed as the percentage of the length
between the vertices, e.g. of hdistancei=0.7, the label is placed at 70%
of the edge length away of Vertex i.
tikz-network manual 17
\begin{tikzpicture} 1.0
\Vertex{A} \Vertex[x=2]{B} X
\Edge[label=X,distance=.7](A)(B) 0.7
\end{tikzpicture}
\Edge[hstylei=string](Vertex i)(Vertex j)
\begin{tikzpicture}
\Vertex{A} \Vertex[x=2]{B}
\Edge[style={dashed}](A)(B)
\end{tikzpicture}
\Edge[hpathi=list](Vertex i)(Vertex j)
\begin{tikzpicture}
\Vertex{A} \Vertex[x=2]{B} \Vertex[x=2,y=-1]{C}
\Edge[path={A,{0,-1},C,B}](A)(B)
\end{tikzpicture}
\Edge(Vertex i)(Vertex i)
\begin{tikzpicture}
\Vertex{A}
\Edge(A)(A)
\end{tikzpicture}
\Edge[hloopsizei=measure](Vertex i)(Vertex i)
With the option hloopsizei the length of the edge can be modi-
fied. The measure value has to be insert together with its units. Per
default the hloopsizei is 1 cm.
18 simple networks
\begin{tikzpicture}
\Vertex{A} \Vertex[x=1.3]{B}
\Edge[loopsize=.5cm](A)(A)
\Edge[loopsize=1.5cm](B)(B)
\end{tikzpicture}
\Edge[hlooppositioni=number](Vertex i)(Vertex i)
\begin{tikzpicture} 45◦
\Vertex{A} \Vertex[x=1.5]{B}
\Edge[loopposition=45](A)(A)
\Edge[loopposition=-70](B)(B) 70◦
\end{tikzpicture}
\Edge[hloopshapei=number](Vertex i)(Vertex i)
\begin{tikzpicture}
\Vertex{A} 45◦
\Edge[loopshape=45](A)(A)
\end{tikzpicture}
\Edge[hDirecti](Vertex i)(Vertex j)
\begin{tikzpicture}
\Vertex{A} \Vertex[x=2]{B}
\Edge[Direct](A)(B)
\end{tikzpicture}
\begin{tikzpicture}
\Vertex{A} \Vertex[x=2]{B} X1
\Edge[Math,label=X_1](A)(B)
\end{tikzpicture}
In order to display RGB colors for the line color of the edge, the
option hRGBi has to be entered. In combination with this option,
the hcolori hast to be a list with the RGB values, separated by «,» and
within { }.12 12
e.g. the RGB code for white:
{255, 255, 255}
\begin{tikzpicture}
\Vertex{A} \Vertex[x=2]{B} \Vertex[x=2,y=-1]{C}
\Edge[RGB,color={127,201,127}](A)(B)
\Edge[RGB,color={253,192,134}](A)(C)
\end{tikzpicture}
\Edge[hNotInBGi]{filename}
\begin{tikzpicture}
\Vertex{A} \Vertex[x=2]{B} \Vertex[x=1,y=-.5]{C}
\Vertex[y=-1]{D} \Vertex[x=2,y=-1]{E}
\Edge[bend=-30](A)(B)
\Edge[bend=30,NotInBG](D)(E)
\end{tikzpicture}
20 simple networks
2.3 Text
While TikZ offers multiple ways to label objects and create text
elements, a simplified command \Text is implemented, which
allow placing and modifying text to the networks.
\Text[hlocal optionsi]{string}
Option Default Type Definition Table 2.3: Local options for the \Text
command.
x 0 measure x-coordinate
y 0 measure y-coordinate
fontsize {} fontsize font size of the text
color {} color color of the text
opacity {} number opacity of the text
position center string position of the text to the origin
distance 0 cm measure distance from the origin
rotation 0 number rotation of the text
anchor {} string anchor of the text
width {} number width of the text box
style {} string additional TikZ styles
layer {} number assigned layer of the text
RGB false Boolean allow RGB colors
The order how the options are entered does not matter. Changes
to the default Text layout can be made with \SetTextStyle14 14
see Section 5.4
\Text[hxi=measure,hyi=measure]{string}
\begin{tikzpicture}
\Text{A} B
\Text[x=1,y=1]{B}
\Text[x=2]{C}
\end{tikzpicture} A C
\Text[hfontsizei=font size]{string}
The font size of the text can be changed with the option hfontsizei.
Per default the font size of the text is defined as \normalsize.
\begin{tikzpicture}
\Text[fontsize=\small]{A}
\Text[x=1,fontsize=\LARGE]{B}
\Text[x=2,fontsize=\Huge]{C}
\end{tikzpicture}
A B C
tikz-network manual 21
\Text[hcolori=color]{string}
\begin{tikzpicture}
\Text[color = blue]{A}
\Text[x=1,color=red]{B} A B C
\Text[x=2,color=green!70!blue]{C}
\end{tikzpicture}
\Text[hopacityi=number]{string}
With the option hopacityi the opacity of the text can be modified.
The range of the number lies between 0 and 1. Where 0 represents a
fully transparent text and 1 a solid text.
\begin{tikzpicture}
\Text[opacity = 1]{A}
\Text[x=1,opacity =.7]{B} A B C
\Text[x=2,opacity =.2]{C}
\end{tikzpicture}
\Text[hpositioni=string,hdistancei=measure]{string}
Per default the hpositioni of the text is in the center of the origin.
Classical TikZ commands17 can be used to change the hpositioni of 17
e.g. above, below, left, right, above left,
the text. above right,. . .
With the option, hdistancei the distance between the text and the
origin can be changed.
\begin{tikzpicture}
\Text[position=above]{above}
\Text[position=below]{below} above right
\Text[position=left,distance=5mm]{left} above origin (0, 0)
\Text[position=above right,distance=5mm]{above right} left
below
\end{tikzpicture}
\Text[hrotationi=number]{string}
\begin{tikzpicture}
\Text[rotation=30]{A}
\Text[x=1,rotation=45]{B}
C
A
B
\Text[x=2,rotation=75]{C} 75◦
\end{tikzpicture}
22 simple networks
\Text[hanchori=string]{string}
With the option hanchori the alignment of the text can be changed.
Per default the text will be aligned centered. Classical TikZ com-
mands18 can be used to change the alignment of the text. 18
e.g. north, east, south, west, north east,
north west,. . .
\begin{tikzpicture}
\Text[anchor=north east]{NE}
\Text[x=1,anchor = south]{S} S SW
\Text[x=2,anchor =south west]{SW} NE
\end{tikzpicture}
\Text[hwidthi=measure]{string}
With the option hwidthi enabled, the text will break after the
entered measure.
2.5cm
\begin{tikzpicture}
\Text[width=2.5cm]{This might be a very long text.} This might be a
\end{tikzpicture} very long text.
\Text[hstylei={string}]{string}
\begin{tikzpicture}
\Text[style={draw,rectangle}]{A}
\Text[x=1,style={fill=red}]{B} A B C
\Text[x=2,style={fill=blue,circle,opacity=.3}]{C}
\end{tikzpicture}
\Text[hRGBi,hcolori=RGB values]{string}
In order to display RGB colors for the text color, the option
hRGBi has to be entered. In combination with this option, the
hcolori hast to be a list with the RGB values, separated by «,» and
within { }.19 19
e.g. the RGB code for white:
{255, 255, 255}
\begin{tikzpicture}
\Text[RGB,color={127,201,127}]{A}
\Text[x=1,RGB,color={190,174,212}]{B}
A B C
\Text[x=2,RGB,color={253,192,134}]{C}
\end{tikzpicture}
\layer[hlayeri=number]{string}
3.1 Vertices
\Vertices[hglobal optionsi]{filename}
File: vertices.csv
id, x, y ,size,color ,opacity,label,IdAsLabel,NoLabel
A, 0, 0, .4 ,green , .9 , a , false , false
B, 1, .7, .6 , , .5 , b , false , false
C, 2, 1, .8 ,orange, .3 , c , false , true
D, 2, 0, .5 ,red , .7 , d , true , false
E,.2,1.5, .5 ,gray , , e , false , false
e
\begin{tikzpicture}
\Vertices{data/vertices.csv}
b
\end{tikzpicture}
a D
Option Default Type Definition Table 3.1: Global options for the
\Vertices command.
size {} measure diameter of the circles
color {} color fillcolor of vertices
opacity {} number opacity of the fill color
style {} string additional TikZ styles
layer {} number assigned layer of the vertices
NoLabel false Boolean delete the labels
IdAsLabel false Boolean uses the Names as labels
Math false Boolean displays the labels in math mode
RGB false Boolean allow RGB colors
Pseudo false Boolean create a pseudo vertices
The use of these options are similar to the options for a single
\Vertex defined in Section 2.1.
\Vertices[hsizei=measure]{filename}
\Vertices[hcolori=color]{filename}
To change the fill color for all vertices, the option hcolori has
to be used. Without the option hRGBi set, the default TikZ and
LATEX colors can be applied.
e
\begin{tikzpicture}
\Vertices[color=green!70!blue]{data/vertices.csv}
b
\end{tikzpicture}
a D
\Vertices[hopacityi=number]{filename}
With the option hopacityi the opacity of all vertices fills colors can
be modified. The range of the number lies between 0 and 1. Where 0
represents a fully transparent fill and 1 a solid fill.
tikz-network manual 25
e
\begin{tikzpicture}
\Vertices[opacity=.3]{data/vertices.csv}
b
\end{tikzpicture}
a D
\Vertices[hstylei=string]{filename}
\begin{tikzpicture}
\Vertices[style={shading=ball,blue}]{data/vertices.csv} b
\end{tikzpicture}
a D
\Vertices[hIdAsLabeli]{filename}
\Vertices[hNoLabeli]{filename}
C
\begin{tikzpicture}
B
\Vertices[IdAsLabel]{data/vertices.csv}
\end{tikzpicture}
A D
\begin{tikzpicture}
\Vertices[NoLabel]{data/vertices.csv}
\end{tikzpicture}
\Vertices[hRGBi]{filename}
In order to display RGB colors for the vertex fill colors, the op-
tion hRGBi has to be entered. Additionally, the RGB values have to
be specified in the file where the vertices are stored. Each value has
its own column with the caption hRi, hGi, and hBi.
File: vertices_RGB.csv
id, x, y ,size, color,opacity,label, R , G , B
A, 0, 0, .4 , green, .9 , a ,255, 0, 0
B, 1, .7, .6 , , .5 , b , 0,255, 0
C, 2, 1, .8 ,orange, .3 , c , 0, 0,255
D, 2, 0, .5 , red, .7 , d , 10,120,255
E,.2,1.5, .5 , gray, , e , 76, 55,255
The “normal” color definition can also be part of the vertex def-
inition. If the option hRGBi is not set, then the colors under hcolori
are applied.
26 complex networks
e
\begin{tikzpicture}
\Vertices[RGB]{data/vertices_RGB.csv} c
\end{tikzpicture} b
a d
\Vertices[hPseudoi]{filename}
\Vertices[hlayeri=number]{filename}
With the option hlayeri, only the vertices on the selected layer are
plotted. More about this option and the use of layers is explained in
Chapter 4.
tikz-network manual 27
3.2 Edges
\Edges[hglobal optionsi]{filename}
Like the vertices, the edges have to be stored in a clear text file3 , 3
e.g. .txt, .tex, .csv, .dat, . . .
preferentially in a .csv format. The first row should contain the
headings, which are equal to the options defined in Table 2.2. Op-
tion are separated by a comma «,». Each new row is corresponds to
a new edge.
File: edges.csv
u,v,label,lw,color ,opacity,bend, R , G , B ,Direct
A,B, ab ,.5,red , 1 , 30, 0,120,255,false
B,C, bc ,.7,blue , 1 , -60, 76, 55,255,false
B,D, bd ,.5,blue , .5 , -60, 76, 55,255,false
A,E, ae , 1,green , 1 , 75,255, 0, 0,true
C,E, ce , 2,orange, 1 , 0,150,150,150,false
A,A, aa ,.3,black , .5 , 75,255, 0 ,0,false
The mandatory values are the hui and hvi argument, which
corresponds to the Vertex i and Vertex j arguments of a single \Edge.
Edges can only create if a vertex exists with the same Name. All
other options are optional. No specific order of the options must be
maintained. If no value is entered for an option, the default value
will be chosen4 . The filename should not contain blank spaces or 4
TODO! This is NOT valid for
special characters. The edges are drawn by the command \Edges Boolean options, here values for all
vertices have to be entered.
with the filename plus file format (e.g. .csv). If the edges file is not
in the same directory as the main LATEX file, also the path has to
be specified. In order to draw edges, first, the vertices have to be
generated. Only then, edges can be assigned.
e
\begin{tikzpicture} ce
\Vertices{data/vertices.csv} c
ae
\Edges{data/edges.csv} b
ab
\end{tikzpicture} bc
a aa bd d
Option Default Type Definition Table 3.2: Global options for the
\Edges command.
lw {} measure line width of the edge
color {} color edge color
opacity {} number opacity of the edge
style {} string additional TikZ styles
vertices {} file vertices were the edges are assigned to
layer {} number edges in specific layers
Direct false Boolean allow directed edges
Math false Boolean displays the labels in math mode
NoLabel false Boolean delete the labels
RGB false Boolean allow RGB colors
NotInBG false Boolean edges are not in the background layer
The use of these options are similar to the options for a single
\Edge defined in Section 2.2.
\Edges[hlwi=measure]{filename}
The line width of the edges can be modified with the option
hlwi. Here, the unit of the measure can be specified, otherwise, it is
in pt.
e
\begin{tikzpicture} ce
c
\Vertices{data/vertices.csv} ae
b
\Edges[lw=2.5]{data/edges.csv} ab
bc
\end{tikzpicture}
a aa bd d
\Edges[hcolori=color]{filename}
To change the line color of all edges, the option hcolori has to be
used. Without the option hRGBi set, the default TikZ and LATEX col-
ors can be applied.
e
\begin{tikzpicture} ce
\Vertices{data/vertices.csv} c
ae
\Edges[color=green!70!blue]{data/edges.csv} b
ab
\end{tikzpicture} bc
a aa bd d
\Edges[hopacityi=number]{filename}
With the option hopacityi the opacity of all edge lines can be
modified. The range of the number lies between 0 and 1. Where 0
represents a fully transparent fill and 1 a solid fill.
e
\begin{tikzpicture} ce
\Vertices{data/vertices.csv} c
ae
\Edges[opacity=0.3]{data/edges.csv} b
ab
\end{tikzpicture} bc
a aa bd d
tikz-network manual 29
\Edges[hstylei=string]{filename}
Any other TikZ style option or command can be entered via the
option hstylei. Most of these commands can be found in the “TikZ
and PGF Manual”.
e
\begin{tikzpicture} ce
c
\Vertices{data/vertices.csv} ae
b
\Edges[style={dashed}]{data/edges.csv} ab
bc
\end{tikzpicture}
a aa bd d
\Edges[hDirecti]{filename}
e
\begin{tikzpicture} ce
\Vertices{data/vertices.csv} c
ae
\Edges[Direct]{data/edges.csv} b
ab
\end{tikzpicture} bc
a aa bd d
\Edges[Math]{filename}
\Edges[hNoLabeli]{filename}
\Edges[hRGBi]{filename}
In order to display RGB colors for the edge line colors, the option
hRGBi has to be entered. Additionally, the RGB values have to be
specified in the file where the vertices are stored. Each value has its
own column with the caption hRi, hGi, and hBi. The “normal” color
definition can also be part of the vertex definition. If the option
hRGBi is not set, then the colors under hcolori are applied.
e
\begin{tikzpicture} ce
c
\Vertices{data/vertices.csv} ae
b
\Edges[RGB]{data/edges.csv} ab
bc
\end{tikzpicture}
a aa bd d
\Edges[hNotInBGi]{filename}
Per default, the edges are drawn on the background layer of the
tikzpicture. I.e. objects which are created after the edges appear also
on top of them. To turn this off, the option hNotInBGi has to be
enabled.
30 complex networks
\Edges[hverticesi=filename]{filename}
With the option hlayeri only the edges between layer α and β
are plotted. The argument is a tuple of both layers indicated by
{ , }. More about this option and the use of layers is explained in
Chapter 4.
4 Multilayer Networks
\Vertex[hlayeri=number]{Name}
\begin{tikzpicture}[multilayer]
\Vertex[x=0.5,IdAsLabel,layer=1]{A}
\Vertex[x=1.5,IdAsLabel,layer=1]{B}
\Vertex[x=1.5,IdAsLabel,layer=2]{C} A C
B
\Edge[bend=60](A)(B)
\Edge[style=dashed](B)(C)
\Edge(C)(C)
\end{tikzpicture}
\begin{tikzpicture}[multilayer=3d]
\Vertex[x=0.5,IdAsLabel,layer=1]{A} A
B
\Vertex[x=1.5,IdAsLabel,layer=1]{B} Layer
1
\Vertex[x=1.5,IdAsLabel,layer=2]{C}
\Edge[bend=60](A)(B)
\Edge[style=dashed](B)(C)
\Edge(C)(C) C
Layer
\end{tikzpicture} 2
32 multilayer networks
File: ml_vertices.csv
id, x, y ,size, color,opacity,label,layer
A, 0, 0, .4 , green, .9 , a , 1
B, 1, .7, .6 , , .5 , b , 1
C, 2, 1, .8 ,orange, .3 , c , 1
D, 2, 0, .5 , red, .7 , d , 2
E,.2,1.5, .5 , gray, , e , 1
F,.1, .5, .7 , blue, .3 , f , 2
G, 2, 1, .4 , cyan, .7 , g , 2
H, 1, 1, .4 ,yellow, .7 , h , 2
File: ml_edges.csv
u,v,label,lw,color ,opacity,bend,Direct
A,B, ab ,.5,red , 1 , 30,false
B,C, bc ,.7,blue , 1 , -60,false
A,E, ae , 1,green , 1 , 45,true
C,E, ce , 2,orange, 1 , 0,false
A,A, aa ,.3,black , .5 , 75,false
C,G, cg , 1,blue , .5 , 0,false
E,H, eh , 1,gray , .5 , 0,false
F,A, fa ,.7,red , .7 , 0,true
D,F, df ,.7,cyan , 1 , 30,true
F,H, fh ,.7,purple, 1 , 60,false
D,G, dg ,.7,blue , .7 , 60,false
With the \Vertices option hlayeri only the vertices on the se-
lected layer are plotted. While, with the \Edges option hlayeri, the
edges between layer α and β are plotted. The argument is a tuple of
both layers indicated by { , }.
e
\begin{tikzpicture}[multilayer=3d] ce
ae
\Vertices[layer=1]{data/ml_vertices.csv} ab b c
\Edges[layer={1,1}]{data/ml_edges.csv} a bc
aa
\end{tikzpicture} Layer
1
tikz-network manual 33
\begin{tikzpicture}[multilayer=3d]
eh
\Edges[vertices=data/ml_vertices.csv,
layer={1,2},style=dashed]{data/ml_edges.csv} fa cg
\end{tikzpicture}
\begin{tikzpicture}[multilayer=3d]
\begin{Layer}[layer=1] e
\draw[very thick] (-.5,-.5) rectangle (2.5,2); ae ce
\node at (-.5,-.5)[below right]{Layer 1}; ab b c
\end{Layer} a bc
aa
\Vertices[layer=1]{data/ml_vertices.csv} Layer
1
\Edges[layer={1,1}]{data/ml_edges.csv}
\end{tikzpicture}
\SetLayerDistance{measure}
4.4 Plane
Option Default Type Definition Table 4.1: Options for the \Plane
command.
x 0 measure x-coordinate of the origin
y 0 measure y-coordinate of the origin
width 5 cm measure width of the plane
height 5 cm measure height of the plane
color vertexfill color fill color of the plane
opacity 0.3 number opacity of the fill color
grid {} measure spacing of the grid
image {} file path to the image file
style {} string additional TikZ styles
layer 1 number layer where the plane is located
RGB false Boolean allow RGB colors
NoFill false Boolean disable fill color
NoBorder false Boolean disable border line
ImageAndFill false Boolean allow image and fill color
InBG false Boolean plane is in the background layer
a
either measure or string
\Plane[hxi=measure,hyi=measure,hwidthi=measure,hheighti=measure]
\begin{tikzpicture}[multilayer=3d]
\Plane[x=-.5,y=-.5,width=3,height=2.5]
\end{tikzpicture} origin
ht
ig
he
width
\Plane[hcolori=color]
\begin{tikzpicture}[multilayer=3d]
\Plane[x=-.5,y=-.5,width=3,height=2.5,color=green!70!blue]
\end{tikzpicture}
tikz-network manual 35
\Plane[hopacityi=number]
With the option hopacityi the opacity of the plane fill color can be
modified. The range of the number lies between 0 and 1. Where 0
represents a fully transparent fill and 1 a solid fill. Per default the
opacity is set to 0.3.
\begin{tikzpicture}[multilayer=3d]
\Plane[x=-.5,y=-.5,width=3,height=2.5,opacity=.7]
\end{tikzpicture}
\Plane[hgridi=measure]
With the option hgridi a grid will be drawn on top of the plane.
The argument of this option defines the spacing between the grid
lines. The entered measures are in default units (cm). Changing
the unites (locally) can be done by adding the unit to the measure2 . 2
e.g. x=5 mm
Changes to the default setting can be made with \SetDefaultUnit3 . 3
see Section 5.1
\begin{tikzpicture}[multilayer=3d]
\Plane[x=-.5,y=-.5,width=3,height=2.5,grid=5mm]
\end{tikzpicture}
m
5m
5mm
\Plane[himagei=file]
\begin{tikzpicture}[multilayer=3d]
\Plane[x=-.5,y=-.5,width=3,height=2.5,image=data/plane.png]
\end{tikzpicture}
\Plane[hstylei=string]
\begin{tikzpicture}[multilayer=3d]
\Plane[x=-.5,y=-.5,width=3,height=2.5,style={dashed,inner
color=white,outer color=red!80}]
\end{tikzpicture}
\Plane[hlayeri=number]
\begin{tikzpicture}[multilayer=3d]
\SetLayerDistance{-1.5}
\Plane[x=-.5,y=-.5,width=3,height=2.5,color=green,layer=2] Layer
2
\Plane[x=-.5,y=-.5,width=3,height=2.5]
\end{tikzpicture}
Layer
\Plane[hRGBi,hcolori=RGB values] 2
In order to display RGB colors for the plane fill color, the op-
tion hRGBi has to be entered. In combination with this option, the
hcolori hast to be a list with the RGB values, separated by «,» and
within { }.4 4
e.g. the RGB code for white:
{255, 255, 255}
\begin{tikzpicture}[multilayer=3d]
\Plane[x=-.5,y=-.5,width=3,height=2.5,RGB,color={0,0,0}]
\end{tikzpicture}
\Plane[hNoFilli]
\Plane[hNoBorderi]
\begin{tikzpicture}[multilayer=3d]
Layer
\SetLayerDistance{-1.5} 2
\Plane[x=-.5,y=-.5,width=3,height=2.5,layer=2,NoFill]
\Plane[x=-.5,y=-.5,width=3,height=2.5,NoBorder]
\end{tikzpicture}
Layer
2
\Plane[hImageAndFilli]
With the option hImageAndFilli both, image and fill color can be
drawn on a plane. The option hopacityi is applied to both objects.
\begin{tikzpicture}[multilayer=3d]
\Plane[x=-.5,y=-.5,width=3,height=2.5,image=data/plane.png,
color=red,opacity=.4,ImageAndFill]
\end{tikzpicture}
\Plane[hInBGi]
With the general settings mainly the sizes, distances and measures
of the networks can be modified.
\SetDefaultUnit{unit}
cm.
\SetDistanceScale{number}
\SetLayerDistance{measure}
\SetCoordinates[hxAnglei=number,hyAnglei=number,hzAnglei=number,
hxLengthi=number,hyLengthi=number,hzLengthi=number]
Option Default Type Definition Table 5.1: Document style options for
the vertices.
Shape circle text shape of the vertex
InnerSep 2pt measure separation space which will be
added inside the shape
OuterSep 0pt measure separation space outside the
background path
MinSize 0.6\DefaultUnit measure diameter (size) of the vertex
FillColor vertexfill color color of the vertex
FillOpacity 1 number opacity of the vertex
LineWidth 1pt measure line width of the vertex boundary
LineColor black color line color of the vertex boundary
LineOpacity 1 number line opacity of the vertex bound-
ary
TextFont \scriptsize fontsize font size of the vertex label
TextColor black color color of the vertex label
TextOpacity 1 number opacity of the vertex label
TextRotation 0 number initial rotation of the vertex
Option Default Type Definition Table 5.2: Document style options for
the edges.
LineWidth 1.5pt measure width of the edge
Color black!75 color color of the edge
Opacity 1 number opacity of the edge
Arrow -latex text arrow shape of the directed edge
TextFont \scriptsize fontsize font size of the edge label
TextOpacity 1 number opacity of the edge label
TextFillColor white color fill color of the edge label
TextFillOpacity 1 number fill opacity of the edge label
InnerSep 0pt measure separation space which will be
added inside the shape
OuterSep 1pt measure separation space outside the back-
ground path
TextRotation 0 number initial rotation of the edge label
\EdgesNotInBG
\EdgesInBG
Per default edges are drawn on the background layer, with the
command \EdgesNotInBG this can be disabled, while the command
\EdgesInBG restores the default setting.
tikz-network manual 39
\SetTextStyle[document options]
Option Default Type Definition Table 5.3: Document style options for
the planes.
TextFont \normalsize fontsize font size of the text
TextOpacity 1 number opacity of the text
TextColor black color color of the text
TextOpacity 1 number opacity of the text
InnerSep 2pt measure separation space which will be added
inside the shape
OuterSep 0pt measure separation space outside the back-
ground path
TextRotation 0 number initial rotation of the text
\SetPlaneStyle[document options]
Option Default Type Definition Table 5.4: Document style options for
the planes.
LineWidth 1.5pt measure width of the border line
LineColor black color color of the border line
LineOpacity 1 number opacity of the border line
FillColor vertexfill color fill color of the plane
FillOpacity 0.3 number fill opacity of the plane
GridLineWidth 0.5pt measure width of the grid lines
GridColor black color color of the grid lines
GridOpacity 0.5 number opacity of the grid lines
\SetPlaneWidth{measure}
\SetPlaneHeight{measure}
The following is a list of all of the errors, warnings, and other mes-
sages generated by the tikz-network classes and a brief description
of their meanings.
• etex – arrows
• xifthen – positioning
– 3d
• xkeyval
– fit
• datatool – calc
• tikz – backgrounds
A ToDo
A.2 Documentation
• add indices to the manual.
A.3 Features
A.4 Add-ons
B.1.1 Introduction
network2tikz is a Python tool for converting network visualizations
into tikz-network figures, for native inclusion into your LaTeX
documents.
network2tikz works with Python 3 and supports (currently) the
following Python network modules:
• cnet
• python-igraph
• networkx
• pathpy
nodes = [’a’,’b’,’c’,’d’]
edges = [(’a’,’b’), (’a’,’c’), (’c’,’d’),(’d’,’b’)]
gender = [’f’, ’m’, ’f’, ’m’]
colors = {’m’: ’blue’, ’f’: ’red’}
style = {} Alice
style[’node_label’] = [’Alice’, ’Bob’, ’Claire’, ’Dennis’] Dennis
style[’node_color’] = [colors[g] for g in gender]
style[’node_opacity’] = .5
style[’edge_curved’] = .1
Claire
from network2tikz import plot
plot((nodes,edges),’network.tex’,**style)
\documentclass{standalone}
\usepackage{tikz-network}
\begin{document}
\begin{tikzpicture}
\clip (0,0) rectangle (6,6);
\Vertex[x=0.785,y=2.375,color=red,opacity=0.5,label=Alice]{a}
\Vertex[x=5.215,y=5.650,color=blue,opacity=0.5,label=Bob]{b}
\Vertex[x=3.819,y=0.350,color=red,opacity=0.5,label=Claire]{c}
\Vertex[x=4.654,y=2.051,color=blue,opacity=0.5,label=Dennis]{d}
\Edge[,bend=-8.531](a)(c)
\Edge[,bend=-8.531](c)(d)
\Edge[,bend=-8.531](d)(b)
\Edge[,bend=-8.531](a)(b)
\end{tikzpicture}
\end{document}
B.1.2 Installation
network2tikz is available from the Python Package Index, so sim-
ply type
B.1.3 Usage
1. Generate, manipulation, and study of the structure, dynamics,
and functions of your complex networks as usual, with your
preferred python module.
plot(G,’mytikz.tex’)
Advanced usage:
Of course, you always can improve your plot by manipulating
the generated LaTeX file, but why not do it directly in Python?
To do so, all visualization options available in tikz-network are
also implemented in network2tikz. The appearance of the plot
can be modified by keyword arguments.1 1
For a detailed explanation, please see
Section B.1.5.
tikz-network manual 47
my_style = {}
plot(G,’mytikz.tex’,**my_style)
plot(G,’mypdf.pdf’)
plot(G)
to create a temporal plot and directly show the result, i.e. similar
to the matplotlib function show(). Finally, you can also create a
node and edge list, which can be read and easily modified (in a
post-processing step) as showd above.
plot(G,’mycsv.csv’)
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
import igraph
from network2tikz import plot
plot(net)
# Node options
visual_style[’vertex_size’] = .5
visual_style[’vertex_color’] = [color_dict[g] for g in net.vs[’
gender’]]
visual_style[’vertex_opacity’] = .7
visual_style[’vertex_label’] = net.vs[’name’]
visual_style[’vertex_label_position’] = ’below’
# Edge options
visual_style[’edge_width’] = [1 + 2 * int(f) for f in net.es(’
is_formal’)]
visual_style[’edge_curved’] = 0.1
tikz-network manual 49
plot(net,’network.tex’,**visual_style)
George
produces
\documentclass{standalone}
\usepackage{tikz-network}
\begin{document}
\begin{tikzpicture}
\clip (0,0) rectangle (8.0,8.0);
\Vertex[x=2.868,y=5.518,size=0.5,color=red,opacity=0.7,label=Alice,position=below]{a}
\Vertex[x=1.000,y=7.000,size=0.5,color=blue,opacity=0.7,label=Bob,position=below]{b}
\Vertex[x=5.006,y=5.387,size=0.5,color=red,opacity=0.7,label=Claire,position=below]{c}
\Vertex[x=6.858,y=3.552,size=0.5,color=blue,opacity=0.7,label=Dennis,position=below]{d}
\Vertex[x=7.000,y=6.419,size=0.5,color=red,opacity=0.7,label=Esther,position=below]{e}
\Vertex[x=3.698,y=2.808,size=0.5,color=blue,opacity=0.7,label=Frank,position=below]{f}
\Vertex[x=5.551,y=1.000,size=0.5,color=blue,opacity=0.7,label=George,position=below]{g}
\Edge[,lw=1.0,bend=-8.531,Direct](a)(b)
\Edge[,lw=1.0,bend=-8.531,Direct](a)(c)
\Edge[,lw=3.0,bend=-8.531,Direct](c)(d)
\Edge[,lw=3.0,bend=-8.531,Direct](d)(e)
\Edge[,lw=3.0,bend=-8.531,Direct](e)(c)
\Edge[,lw=1.0,bend=-8.531,Direct](c)(f)
\Edge[,lw=3.0,bend=-8.531,Direct](f)(a)
\Edge[,lw=1.0,bend=-8.531,Direct](f)(g)
\Edge[,lw=1.0,bend=-8.531,Direct](g)(g)
\Edge[,lw=1.0,bend=-8.531,Direct](g)(d)
\end{tikzpicture}
\end{document}
Instead of the tex file, a node and edge list can be generates,
which can also be used with the library.
plot(net,’network.csv’,**visual_style)
id,x,y,size,color,opacity,label,position
a,2.868,5.518,0.5,red,0.7,Alice,below
b,1.000,7.000,0.5,blue,0.7,Bob,below
c,5.006,5.387,0.5,red,0.7,Claire,below
d,6.858,3.552,0.5,blue,0.7,Dennis,below
e,7.000,6.419,0.5,red,0.7,Esther,below
f,3.698,2.808,0.5,blue,0.7,Frank,below
g,5.551,1.000,0.5,blue,0.7,George,below
u,v,lw,bend,Direct
a,b,1.0,-8.531,true
a,c,1.0,-8.531,true
c,d,3.0,-8.531,true
d,e,3.0,-8.531,true
e,c,3.0,-8.531,true
c,f,1.0,-8.531,true
f,a,3.0,-8.531,true
f,g,1.0,-8.531,true
g,g,1.0,-8.531,true
g,d,1.0,-8.531,true
Parameters
seed : int or None, optional (default = None) Set the random state
for deterministic node layouts. If int, seed is the seed used by
the random number generator, if None, the a random seed by
created by the numpy random number generator is used.