Declare the scale for a mapped edge linewidth aesthetic (e.g.
mark_edges(linewidth = weight) on a vgraph() plot). The data range is
rescaled to a line-width range and an edge-width legend is drawn automatically.
Usage
scale_edge_width(
plot,
range = c(0.3, 3),
limits = NULL,
breaks = NULL,
name = NULL
)Arguments
- plot
A PlotSpec.
- range
Output line-width range
c(min, max).- limits
Data limits
c(min, max), orNULLto train from the data.- breaks
Explicit legend breaks, or
NULL.- name
Legend title, or
NULLto derive from the encoding.
Value
The modified PlotSpec.
Examples
if (FALSE) { # \dontrun{
g <- igraph::sample_gnp(20, 0.2)
g <- igraph::set_edge_attr(g, "w", value = runif(igraph::ecount(g)))
vgraph(g) |> mark_edges(linewidth = w) |> mark_nodes() |> scale_edge_width(range = c(0.3, 4))
} # }
