Represents the layout of a graph.
A layout is practically a list of coordinates in an n-dimensional
space. This class is generic in the sense that it can store coordinates
in any n-dimensional space.
Layout objects are not associated directly with a graph. This is
deliberate: there were times when I worked with almost identical copies
of the same graph, the only difference was that they had different colors
assigned to the vertices. It was particularly convenient for me to use
the same layout for all of them, especially when I made figures for a
paper. However, igraph
will of course refuse to draw a graph
with a layout that has less coordinates than the node count of the
graph.
Layouts behave exactly like lists when they are accessed using the
item index operator ([...]
). They can even be iterated
through. Items returned by the index operator are only copies of the
coordinates, but the stored coordinates can be modified by directly
assigning to an index.
|
|
|
|
|
|
|
__init__(self,
coords=[ ] ,
dim=None)
Constructor. |
|
|
|
|
|
__setitem__(self,
idx,
value) |
|
|
|
|
|
|
|
append(self,
value)
Appends a new point to the layout |
|
|
|
bounding_box(self,
border=0)
Returns the bounding box of the layout. |
|
|
|
center(self,
*args,
**kwds)
Centers the layout around the given point. |
|
|
|
centroid(self)
Returns the centroid of the layout. |
|
|
|
copy(self)
Creates an exact copy of the layout. |
|
|
|
mirror(self,
dim)
Mirrors the layout along the given dimension(s) |
|
|
|
rotate(self,
degree,
dim1=0,
dim2=1)
Rotates the layout by the given degrees along the plane defined by
the given two dimensions |
|
|
|
scale(self,
*args,
**kwds)
Scales the layout. |
|
|
|
to_radial(self,
min_angle=100,
max_angle=80,
min_radius=0.0,
max_radius=1.0)
Converts a planar layout to a radial one |
|
|
|
transform(self,
function,
*args,
**kwds)
Performs an arbitrary transformation on the layout |
|
|
|
translate(self,
*args,
**kwds)
Translates the layout. |
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__str__
|