Learn R Programming

cograph (version 1.5.2)

sn_theme: Apply Theme to Network

Description

Apply a visual theme to the network.

Usage

sn_theme(network, theme, ...)

Value

Modified cograph_network object.

Arguments

network

A cograph_network object, matrix, data.frame, or igraph object. Matrices and other inputs are auto-converted.

theme

Theme name (string) or CographTheme object.

...

Additional theme parameters to override.

Details

Available Themes

classic

Default theme with white background, blue nodes, gray edges.

dark

Dark background with light nodes. Good for presentations.

minimal

Subtle styling with thin edges and muted colors.

colorblind

Optimized for color vision deficiency.

grayscale

Black and white only.

vibrant

Bold, saturated colors.

Use list_themes() to see all available themes.

See Also

cograph for network creation, sn_palette for color palettes, sn_nodes for node customization, sn_edges for edge customization, list_themes to see available themes, splot and soplot for plotting

Examples

Run this code
adj <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), nrow = 3)

# Apply different themes
cograph(adj) |> sn_theme("dark") |> splot()
cograph(adj) |> sn_theme("minimal") |> splot()

# Override specific theme properties
cograph(adj) |> sn_theme("classic", background = "lightgray") |> splot()

# Direct matrix input
adj |> sn_theme("dark")

Run the code above in your browser using DataLab