| sn_theme | R Documentation |
Apply a visual theme to the network.
sn_theme(network, theme, ...)
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. |
Default theme with white background, blue nodes, gray edges.
Dark background with light nodes. Good for presentations.
Subtle styling with thin edges and muted colors.
Optimized for color vision deficiency.
Black and white only.
Bold, saturated colors.
Use list_themes() to see all available themes.
Modified cograph_network object.
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
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.