Apply a color palette for node and/or edge coloring.
Arguments
- network
A cograph_network object, matrix, data.frame, or igraph object. Matrices and other inputs are auto-converted.
- palette
Palette name (see
list_palettes) or a function that takesnand returnsncolors.- target
What to apply the palette to: "nodes" (default), "edges", or "both". For edges, the first two palette colors become the colors of positive and negative edges.
- by
Name of a node-table column whose values are mapped to palette colors. When
byis NULL or not a column of the node table, every node gets the first palette color.
Value
The cograph_network with the node fill colors and edge colors
stored in its node_aes and edge_aes elements.
Details
Available Palettes
Use list_palettes() to see all available palettes. Common options:
"viridis"Perceptually uniform, colorblind-friendly.
"colorblind"Optimized for color vision deficiency.
"pastel"Soft, muted colors.
"blues"Blue sequential palette.
"reds"Red sequential palette.
"diverging"Blue-white-red diverging palette.

