nplot using base graphicsnplot using base graphics
nplot_base(
x,
layout = igraph::layout_nicely(x),
vertex.size = igraph::degree(x, mode = "in"),
bg.col = "transparent",
vertex.nsides = 10,
vertex.color = grDevices::hcl.colors(1),
vertex.size.range = c(0.01, 0.03, 4),
vertex.frame.color = grDevices::adjustcolor(vertex.color, red.f = 0.75, green.f = 0.75,
blue.f = 0.75),
vertex.rot = 0,
vertex.frame.prop = 0.1,
edge.width = NULL,
edge.width.range = c(1, 2),
edge.arrow.size = NULL,
edge.color = NULL,
edge.color.mix = 0.5,
edge.color.alpha = c(0.1, 0.5),
edge.curvature = pi/3,
edge.line.lty = "solid",
edge.line.breaks = 5,
sample.edges = 1,
skip.vertex = FALSE,
skip.edges = FALSE,
skip.arrows = skip.edges,
add = FALSE,
zero.margins = TRUE
)nplot_base returns a list with the following components:
vertex.coords A list of length N where each element describes the
geomtry of each vertex.
vertex.color A vector of colors
vertex.frame.coords Similar to vertex.coords, but for the frame.
vertex.frame.color Similar to vertex.color, but for the frame.
edge.color Vector of functions used to compute the edge colors.
edge.coords Similar to vertex.coords, the points that describe each
edge.
edge.arrow.coords A list of matrices describing the geometry of the
tip of the edges.
edge.width A numeric vector with edges' widths.
xlim, ylim Limits of the plot area.
A graph. It supports networks stored as igraph, network, and
matrices objects (see details).
Numeric two-column matrix with the graph layout in x/y positions of the vertices.
Numeric vector of length vcount(x). Absolute size of the vertex from 0 to 1.
Color of the background.
Numeric vector of length vcount(x). Number of sizes of
the vertex. E.g. three is a triangle, and 100 approximates a circle.
Vector of length vcount(x). Vertex HEX or built in colors.
Numeric vector of length 3. Relative size for the
minimum and maximum of the plot, and curvature of the scale. The third number
is used as size^rel[3].
Vector of length vcount(x). Border of vertex in
HEX or built in colors.
Vector of length vcount(x) in Radians. Passed to npolygon,
elevation degree from which the polygon is drawn.
Vector of length vcount(x). What proportion of the
vertex does the frame occupy (values between 0 and 1).
Vector of length ecount(x) from 0 to 1. All edges will be
the same size.
Vector of length ecount(x) from 0 to 1. Adjusting
width according to weight.
Vector of length ecount(x) from 0 to 1.
A vector of length ecount(x). In HEX or built in colors.
Can be NULL in which case
the color is picked as a mixture between ego and alters' vertex.color values.
Proportion of the mixing.
Either a vector of length 1 or 2, or a matrix of
size ecount(x)*2 with values in [0,1]. Alpha (transparency) levels (see
details)
Numeric vector of length ecount(x). Curvature of edges
in terms of radians.
Vector of length ecount(x). Line types in R
(e.g.- 1 = Solid, 2 = Dashed, etc).
Vector of length ecount(x). Number of vertices to
draw (approximate) the arc (edge).
Numeric scalar between 0 and 1. Proportion of edges to sample.
Logical scalar. When TRUE the
object is not plotted.
Logical scalar.
Logical scalar.
nplot
# Same example as in nplot
library(igraph)
library(netplot)
set.seed(1)
x <- sample_smallworld(1, 200, 5, 0.03)
nplot_base(x) # ala netplot (using base)
Run the code above in your browser using DataLab