Apply a visual theme to the network.
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
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")
#> Cograph network: 3 nodes, 3 edges ( undirected )
#> Source: matrix
#> Nodes (3): 1, 2, 3
#> Edges: 3 / 3 (density: 100.0%)
#> Weights: [1.000, 1.000] | mean: 1.000
#> Strongest edges:
#> 1 -- 2 1.000
#> 1 -- 3 1.000
#> 2 -- 3 1.000
#> Layout: set
