There are three ways to give values to the parameters described below,
in section 'Parameters'. We give these three ways here in the order of
their precedence. The first method is to supply named arguments to the plotting commands:
plot.igraph
, tkplot
or
rglplot
. Parameters for vertices start with prefix
vertex.
, parameters for edges have prefix
edge.
, and global parameters have no prefix. Eg. the
color of the vertices can be given via argument vertex.color
,
whereas edge.color
sets the color of the edges. layout
gives the layout of the graphs.
The second way is to assign vertex, edge and graph attributes to the
graph. These attributes have no prefix, ie. the color of the vertices
is taken from the color
vertex attribute and the color of the
edges from the color
edge attribute. The layout of the graph is
given by the layout
graph attribute. (Always assuming that the
corresponding command argument is not present.) Setting vertex and
edge attributes are handy if you want to assign a given look
to a graph, attributes are saved with the graph is you save it with
save
or in GraphML format with
write_graph
, so the graph will have the same look after
loading it again.
If a parameter is not given in the command line, and the corresponding
vertex/edge/graph attribute is also missing then the general igraph
parameters handled by igraph_options
are also
checked. Vertex parameters have prefix vertex.
, edge
parameters are prefixed with edge.
, general parameters
like layout
are prefixed with plot
.
These parameters are useful if you want
all or most of your graphs to have the same look, vertex size, vertex
color, etc. Then you don't need to set these at every plotting, and
you also don't need to assign vertex/edge attributes to every graph.
If the value of a parameter is not specified by any of the three ways
described here, its default valued is used, as given in the source
code.
Different parameters can have different type, eg. vertex colors can be
given as a character vector with color names, or as an integer vector
with the color numbers from the current palette. Different types are
valid for different parameters, this is discussed in detail in the
next section. It is however always true that the parameter can always
be a function object in which it will be called with the graph as its
single argument to get the proper value of the parameter.
(If the function returns another function object that will not
be called again...)