plot.spgraph: Plotting of shortest path graphs

Description Usage Arguments Details Examples

View source: R/plot.R

Description

plot.spgraph is a wrapper around plot.igraph providing convenience features for shortest path graph plotting.

Usage

 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, ...)

Arguments

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 igraph.plotting.

edge.label.color

See igraph.plotting.

edge.label.cex

See igraph.plotting.

vertex.label.color

See igraph.plotting.

vertex.label.dist

See igraph.plotting.

vertex.label.cex

See igraph.plotting.

vertex.label.family

See igraph.plotting.

vertex.label.degree

See igraph.plotting.

default.margins

If TRUE, plot margins will be zeroed.

...

All other parameters are passed to plot.igraph. as is.

Details

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:

Available edge characteristics:

Examples

1
2
3
g <- randomGraph()
d <- dijkstra(g, "A", "B")
plot(d)

huoston/shortestpath documentation built on May 25, 2019, 8:18 a.m.