splot()

The one-function network plot

Pass any network — matrix, igraph, tna, edge list, cograph — and get a publication-ready plot. Customize with 100+ parameters for nodes, edges, labels, donuts, pies, confidence intervals, themes, and more. All in base R graphics.

6 Input Formats 12+ Node Shapes Triple-Layer Donuts CI & P-value Overlays 7 Themes 100+ Parameters
6
Input Formats
100+
Parameters
12+
Node Shapes
8+
Layout Algorithms
7
Built-in Themes
3
Donut + Pie Layers

Nodes

node_size · node_shape · node_fill · node_border_color · node_alpha · scale_nodes_by
18 parameters

Edges

edge_color · edge_width · edge_alpha · curvature · arrow_size · edge_style
20 parameters

Donuts & Pies

donut_fill · donut_color · pie_values · pie_colors · donut2_values · donut_shape
22 parameters

Edge Labels

edge_labels · edge_label_style · edge_label_template · edge_label_p · edge_label_stars
25 parameters

Layout & Theme

layout · theme · background · seed · layout_scale · rescale
14 parameters

Output

filetype · filename · width · height · res · title
7 parameters
# That's it. One line.
splot(model)

Input & Layout

Accepted Formats

splot() auto-detects the input type. Directionality is inferred from matrix symmetry or the source object. Override with directed.

ParameterDefaultDescription
xrequiredNetwork data: matrix, data.frame (edge list), igraph, cograph_network, tna, group_tna, bootstrap, or permutation object
directedNULLForce directed/undirected. NULL = auto-detect from input
iNULLGroup index or name when x is group_tna. NULL = plot all groups in a grid
Tip: Matrices with symmetric weights are treated as undirected. Edge lists default to directed. igraph/tna objects carry their own directionality.

Layout Algorithms

ParameterDefaultDescription
layout"oval"Layout algorithm or coordinate matrix
seed42Random seed for reproducible layouts
rescaleTRUERescale layout to −1 to 1 range
aspectTRUEMaintain aspect ratio

Built-in layouts: "oval", "circle", "spring", "groups", "grid", "star", "bipartite". Or pass any igraph layout by name ("fr", "kk", "drl", "mds", "ni", "tr") or as a two-column matrix of x,y coordinates.

Example: Layouts
splot(mat, layout = "circle")
splot(mat, layout = "spring", seed = 123)
splot(mat, layout = "groups", groups = c("A","A","B","B","B"))

# igraph layout
splot(mat, layout = "kk")

# Custom coordinates
coords <- cbind(x = runif(10), y = runif(10))
splot(mat, layout = coords)

Plot Controls

ParameterDefaultDescription
titleNULLPlot title
title_size1.2Title font size
background"white"Background color
layout_scale1Scale factor: >1 expands, <1 contracts. "auto" scales by node count
layout_margin0.15Margin as fraction of layout range
marginsc(.1,.1,.1,.1)Plot margins: c(bottom, left, top, right)
scaling"default""default" (qgraph-matched) or "legacy" (pre-v2.0)

Node Aesthetics

Size, Shape & Color

ParameterDefaultDescription
node_sizeNULLNode size. Scalar or per-node vector. Default 3
node_size2NULLSecondary size for ellipse/rectangle height
node_shape"circle"Shape name or per-node vector
node_svgNULLCustom SVG: file path or inline string
svg_preserve_aspectTRUEMaintain SVG aspect ratio
node_fillNULLFill color(s). Uses theme default if NULL
node_border_colorNULLBorder color(s)
node_border_width1Border width(s)
node_alpha1Transparency (0–1)
use_pchFALSEUse points() for simple circles (faster for large networks)

Available shapes: "circle", "square", "triangle", "diamond", "pentagon", "hexagon", "star", "heart", "ellipse", "cross", "rectangle", "pie", plus any registered SVG shape.

Example: Node styling
# Per-node shapes and colors
splot(mat,
  node_shape = c("circle", "hexagon", "diamond", "square", "star"),
  node_fill = c("#E63946", "#457B9D", "#2A9D8F", "#E9C46A", "#F4A261"),
  node_size = 8,
  node_border_width = 2
)

# Custom SVG nodes
splot(mat, node_svg = "path/to/icon.svg", node_size = 10)

Centrality Scaling

Size nodes proportionally to any centrality measure. The value is computed internally — just pass the measure name.

ParameterDefaultDescription
scale_nodes_byNULLCentrality measure name: "degree", "strength", "betweenness", "closeness", "eigenvector", "pagerank", "authority", "hub", "harmonic", "indegree", "outdegree", "instrength", "outstrength", …
node_size_rangec(2, 8)Output size range c(min, max)
scale_nodes_scale1Dampening exponent. <1 compresses differences, >1 exaggerates
Example: Size by centrality
# PageRank scaling
splot(mat, scale_nodes_by = "pagerank", node_size_range = c(3, 12))

# In-strength with dampening
splot(mat, scale_nodes_by = "instrength", scale_nodes_scale = 0.5)

Labels

ParameterDefaultDescription
labelsTRUETRUE (use names), FALSE (none), or character vector
label_sizeNULLLabel text size (cex)
label_color"black"Label color
label_position"center""center", "above", "below", "left", "right"
label_fontface"plain""plain", "bold", "italic", "bold.italic"
label_fontfamily"sans""sans", "serif", "mono"
label_hjust0.5Horizontal justification (0=left, 1=right)
label_vjust0.5Vertical justification (0=bottom, 1=top)
label_angle0Rotation angle in degrees

Donuts & Pies

Nodes can carry up to three data layers: an outer donut ring, an inner donut ring, and a pie chart core. Use these to encode multiple variables per node without cluttering the graph.

Donut Rings

ParameterDefaultDescription
donut_fillNULLFill proportion (0–1) per node. Scalar or vector
donut_colorNULLFill color(s) for the ring. Scalar, vector, or list of vectors for segmented donuts
donut_inner_ratio0.8Inner radius as fraction of outer (0–1). Smaller = thicker ring
donut_bg_color"gray90"Background color for unfilled portion
donut_shape"circle"Base shape: "circle", "square", "hexagon", "triangle", "diamond", "pentagon"
donut_border_colorNULLBorder color. NULL inherits from node_border_color
donut_border_widthNULLBorder width. NULL inherits from node_border_width
donut_outer_border_colorNULLOuter boundary color (enables double border)
donut_line_type"solid"Line type: "solid", "dashed", "dotted"
donut_emptyTRUERender empty rings for NA values

Donut Value Display

ParameterDefaultDescription
donut_show_valueFALSEShow numeric value in donut center
donut_value_size0.8Font size for center value
donut_value_color"black"Color for center value
donut_value_fontface"bold"Font face for center value
donut_value_digits2Decimal places
donut_value_prefix""Text before value (e.g., "$")
donut_value_suffix""Text after value (e.g., "%")
Example: Donut rings
# Simple progress ring
splot(mat, donut_fill = c(0.9, 0.7, 0.5), donut_color = "steelblue")

# Segmented donut (3 categories per node)
splot(mat,
  donut_fill = lapply(1:5, function(i) c(runif(1), runif(1), runif(1))),
  donut_color = list(c("#E63946", "#457B9D", "#2A9D8F")),
  donut_inner_ratio = 0.6
)

# Hexagonal donut with value display
splot(mat,
  donut_fill = c(0.85, 0.72, 0.93),
  donut_color = "coral",
  donut_shape = "hexagon",
  donut_show_value = TRUE,
  donut_value_suffix = "%",
  donut_value_digits = 0
)

Pie Charts

ParameterDefaultDescription
pie_valuesNULLList of numeric vectors: segment sizes per node
pie_colorsNULLColor vector or list of vectors for pie segments
pie_border_widthNULLBorder width for slice dividers
Example: Pie + Donut combo
splot(mat,
  node_shape = "donut",
  donut_fill = c(0.9, 0.7, 0.5),
  donut_color = "steelblue",
  pie_values = list(c(3,2,1), c(1,1,4), c(2,3,1)),
  pie_colors = c("#E41A1C", "#377EB8", "#4DAF4A"),
  node_size = 8
)

Double Donut

A second donut ring inside the first, for encoding a third data dimension.

ParameterDefaultDescription
donut2_valuesNULLValues for inner donut ring
donut2_colorsNULLColors for inner donut ring
donut2_inner_ratio0.4Inner radius ratio for inner donut
Example: Triple layer (donut + donut + pie)
splot(mat,
  donut_fill = lapply(1:5, function(i) runif(3)),
  donut_color = list(c("#E63946", "#457B9D", "#2A9D8F")),
  donut_inner_ratio = 0.7,
  donut2_values = as.list(runif(5, 0.4, 0.9)),
  donut2_colors = list("#F4A261"),
  donut2_inner_ratio = 0.45,
  pie_values = lapply(1:5, function(i) sample(1:5, 4)),
  pie_colors = list(c("#264653", "#E9C46A", "#F4A261", "#E76F51")),
  node_size = 7
)

Edge Aesthetics

Color, Width & Style

ParameterDefaultDescription
edge_colorNULLEdge color(s). NULL = positive/negative coloring by weight sign
edge_positive_color"#2E7D32"Color for positive weights
edge_negative_color"#C62828"Color for negative weights
edge_widthNULLEdge width(s). NULL = scale by weight
edge_alpha0.8Transparency (0–1)
edge_style1Line type: 1=solid, 2=dashed, 3=dotted, etc.

Weight Scaling

How edge weights map to visual width. The default is adaptive — it adjusts to network size and weight distribution.

ParameterDefaultDescription
edge_sizeNULLBase size for weight scaling. NULL = adaptive: 15 * exp(-n/90) + 1
edge_width_rangec(0.1, 4)Output width range c(min, max)
edge_scale_mode"linear"Scaling: "linear", "log", "sqrt", or "rank"
edge_cutoffNULLTwo-tier width threshold. NULL = auto (75th percentile), 0 = disabled
Note: edge_scale_mode = "log" is useful when weights span several orders of magnitude. "rank" equalizes spacing and is useful for heavy-tailed distributions.

Arrows & Curvature

ParameterDefaultDescription
curvature0Edge curvature. 0 = straight
curve_scaleTRUEAuto-curve reciprocal edges
curve_shape0Spline tension (−1 to 1)
curve_pivot0.5Control point position along edge (0–1)
curvesTRUETRUE = auto-curve reciprocals, FALSE = all straight, "force" = all curved
arrow_size1Arrow head size
arrow_anglepi/6Arrow head angle (radians). Default = 30°
show_arrowsTRUEShow arrows on directed edges. Logical or per-edge vector
bidirectionalFALSEArrows at both ends. Logical or per-edge vector
loop_rotationNULLSelf-loop direction angle(s) in radians

Edge Start Style

A visual cue at the source end of directed edges — a dashed or dotted segment that indicates direction without relying solely on arrowheads.

ParameterDefaultDescription
edge_start_style"solid""solid", "dashed", or "dotted"
edge_start_length0.15Fraction of edge length for styled segment (0–0.5)
edge_start_dot_density"12"Dot pattern: two-char string (dot length, gap length)

Edge Labels

Basic Labels

ParameterDefaultDescription
edge_labelsFALSETRUE (show weights), FALSE (none), or character vector
edge_label_size0.8Label text size
edge_label_color"gray30"Text color
edge_label_bgNABackground color for label box
edge_label_position0.5Position along edge (0=source, 1=target)
edge_label_offset0Perpendicular offset (positive = above curve)
edge_label_fontface"plain"Font face
edge_label_haloTRUEWhite halo for readability
edge_label_digits2Decimal places for numeric values
edge_label_leading_zeroTRUEShow leading zero for values < 1
edge_label_onelineTRUESingle line format

Shadow

ParameterDefaultDescription
edge_label_shadowFALSEEnable drop shadow
edge_label_shadow_color"gray40"Shadow color
edge_label_shadow_offset0.5Shadow offset in points
edge_label_shadow_alpha0.5Shadow transparency

Templates & Styles

The template system composes edge labels from multiple data sources. Use preset styles or build your own with placeholders.

ParameterDefaultDescription
edge_label_style"none"Preset: "none", "estimate", "full", "range", "stars"
edge_label_templateNULLCustom template with placeholders. Overrides edge_label_style

Template placeholders: {est} = estimate, {low} = lower CI, {up} = upper CI, {range} = [low, up], {p} = p-value, {stars} = significance stars.

StyleProduces
"estimate".23
"full".23 [.18, .29]*
"range"[.18, .29]
"stars"***
Example: Custom template
# Effect size with stars
splot(mat,
  edge_labels = TRUE,
  edge_label_template = "{est}{stars}",
  edge_label_p = pval_matrix,
  edge_label_stars = TRUE,
  edge_label_leading_zero = FALSE
)

# Full annotation
splot(mat,
  edge_label_style = "full",
  edge_ci_lower = ci_lo,
  edge_ci_upper = ci_hi,
  edge_label_p = pvals,
  edge_label_stars = TRUE
)

Confidence Intervals & P-values

Overlay confidence intervals as semi-transparent bands on edges, and annotate with p-values and significance stars.

ParameterDefaultDescription
edge_ciNULLCI width vector (0–1). Rendered as semi-transparent underlay
edge_ci_scale2.0Width multiplier for underlay thickness
edge_ci_alpha0.15Underlay transparency
edge_ci_colorNAUnderlay color. NA = match edge color
edge_ci_style2Underlay line type: 1=solid, 2=dashed, 3=dotted
edge_ci_arrowsFALSEShow arrows on underlay
edge_ci_lowerNULLLower CI bounds (for label annotation)
edge_ci_upperNULLUpper CI bounds (for label annotation)
edge_label_pNULLP-values per edge
edge_label_p_digits3Decimal places for p-values
edge_label_p_prefix"p="Prefix for p-value display
edge_label_starsNULLSignificance stars: TRUE (compute from p), character vector, or numeric (treated as p-values)
edge_label_ci_format"bracket""bracket" [low, up] or "dash" low–up
edge_priorityNULLRender priority per edge. Higher = drawn on top
Example: Full statistical annotation
splot(mat,
  edge_ci_lower = ci_lower_matrix,
  edge_ci_upper = ci_upper_matrix,
  edge_label_p = pvalue_matrix,
  edge_label_stars = TRUE,
  edge_label_style = "full",
  edge_label_leading_zero = FALSE,
  edge_label_color = "#800020"
)

Weight Handling

ParameterDefaultDescription
threshold0Minimum absolute weight to display an edge
minimum0Alias for threshold (qgraph compatibility). Uses max(threshold, minimum)
maximumNULLMaximum weight for scaling. NULL = auto from data
weight_digits2Decimal places to round weights. Edges rounding to 0 are removed. NULL = disable
edge_duplicatesNULLHandle duplicate edges in undirected networks: "sum", "mean", "first", "max", "min", or custom function

Themes & Legend

Built-in Themes

ParameterDefaultDescription
themeNULLTheme name. NULL = default styling

Available themes: "classic" (white bg, blue nodes), "dark" (dark bg for slides), "minimal" (subtle, thin edges), "colorblind" (CVD-optimized), "gray" (grayscale), "nature" (earth tones), "viridis" (viridis palette). Register custom themes with register_theme().

Legend

ParameterDefaultDescription
legendFALSEShow legend
legend_position"topright""topright", "topleft", "bottomright", "bottomleft"
legend_size0.8Legend text size
legend_edge_colorsTRUEShow positive/negative edge colors
legend_node_sizesFALSEShow node size scale
groupsNULLGroup assignments for node coloring and legend entries
node_namesNULLAlternative names for legend (separate from plot labels)

Output & Saving

ParameterDefaultDescription
filetype"default""default" (screen), "png", "pdf", "svg", "jpeg", "tiff"
filenametempdir()Output path (without extension)
width7Width in inches
height7Height in inches
res600Resolution (DPI) for raster formats
Example: Save to file
# Save as PDF
splot(mat, filetype = "pdf", filename = "network", width = 10, height = 8)

# Save as high-res PNG
splot(mat, filetype = "png", filename = "network", width = 10, height = 8, res = 300)
S3 Methods: splot has specialized methods for tna_bootstrap (solid/dashed by significance, stars on labels), tna_permutation (green/red by group direction), and group_tna_permutation objects. These add parameters like display, show_ci, show_stars, and width_by on top of the full parameter set above.