Description Usage Arguments Details Examples
plot.spgraph
is a wrapper around plot.igraph
providing
convenience features for shortest path graph plotting.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## S3 method for class 'spgraph'
plot(x, vertex.color.by = c("set", "type", "manual"),
vertex.color = wes_palette("Royal1")[c(3, 4, 1)],
vertex.frame.color.by = c("type", "set", "manual"),
vertex.frame.color = wes_palette("Rushmore")[3:5],
vertex.size.by = c("type", "set", "manual"), vertex.size = c(15, 25, 25),
edge.color.by = c("shortestpath", "manual"), edge.color = c("darkgrey",
wes_palette("Darjeeling")[4]), vertex.label = nice_vertex_labels(x),
edge.label = E(graph)$weight, edge.label.family = "sans",
edge.label.color = "#444444", edge.label.cex = 0.75,
vertex.label.color = nice_vertex_label_colors(x),
vertex.label.dist = 1.25, vertex.label.cex = 0.8,
vertex.label.family = "sans", vertex.label.degree = -pi/7,
default.margins = TRUE, ...)
|
x |
The graph to plot. |
vertex.color.by |
Characteristic which should be used to color vertices. |
vertex.color |
Color palette for the vertices. |
vertex.frame.color.by |
Characteristic which should be used to color vertex frames. |
vertex.frame.color |
Color palette for the vertices' frame. |
vertex.size.by |
Characteristic which should be used to determine vertex sizes. |
vertex.size |
The size options. |
edge.color.by |
Characteristic which should be used to color edges. |
edge.color |
Color palette for the edges. |
vertex.label |
The vertex label. |
edge.label |
The edge label. |
edge.label.family |
See |
edge.label.color |
See |
edge.label.cex |
See |
vertex.label.color |
See |
vertex.label.dist |
See |
vertex.label.cex |
See |
vertex.label.family |
See |
vertex.label.degree |
See |
default.margins |
If |
... |
All other parameters are passed to |
Vertex/edge visuals depending on the underlying graph characteristics:
vertex.color.by
denotes which attribute should be used to set the vertex color
vertex.color
specifies the color palette, or, if .by
is "manual"
, a color for each vertex.
Available vertex characteristics:
set
The set to which the vertex belongs: processed/front/unknown
type
start node/normal/destination node
manual
A color for each vertex is provided manually
Available edge characteristics:
shortestpath
edge is not on the shortest path / edge is on the shortest path
manual
A color for each edge is provided manualy
1 2 3 | g <- randomGraph()
d <- dijkstra(g, "A", "B")
plot(d)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.