Skip to contents

Drawing networks

The main function of the package. nplot() draws a network using the grid graphics system and works with igraph, network, and matrix objects.

nplot() print(<netplot>)
Plot a network

Mapping attributes with formulas

Map vertex and edge aesthetics (colors, shapes, sizes, widths) directly from graph attributes. Edge colors use the richer ego()/alter() grammar.

color_formula() ego() alter()
Edge-color formulas in netplot

Editing and querying a plot

Retrieve and modify the graphical parameters of an existing netplot object, or interactively locate a vertex.

set_gpar() set_edge_gpar() set_vertex_gpar() get_vertex_gpar() get_edge_gpar() get_gpar()
Set/retrieve graphical parameters of a netplot object
locate_vertex()
Find a vertex in the current plot

Legends and color keys

Annotate a plot with legends and color keys.

nplot_legend() print(<netplot_legend>)
Add legend to a netplot object
colorkey()
Function to create a color key

Colors

Helpers for building color scales and gradients.

colorRamp2()
A faster implementation of grDevices::colorRamp for linear interpolation.
make_colors() make_edges_colors() make_vertex_colors()
Create a vector of colors for vertices and edges
segments_gradient()
Draw segments colored by gradients

Low-level drawing primitives

Building blocks used internally by nplot(), exposed for advanced grid graphics work.

npolygon()
n-sided polygons Calculate the coordinates for an nsided polygon
piechart()
A flexible piechart.

Base-graphics backend

An experimental base-graphics implementation of nplot.

nplot_base()
nplot using base graphics