plot_node_degrees: Visualize Node Degree Distribution in a Network Graph
Description
Generates a horizontal bar‐style plot of node degrees for an igraph network.
For undirected graphs, it shows each node’s total degree.
For directed graphs, it displays in‐degrees (as negative bars) alongside out‐degrees.
Usage
plot_node_degrees(graph)
Value
A ggplot object:
Undirected graphs: A bar for each node showing its total degree.
Directed graphs: Split bars per node with negative values for in‐degree
(pointing left) and positive values for out‐degree (pointing right).
Arguments
graph
An igraph object. Can be either directed or undirected.
Customization
You can modify the returned ggplot with additional layers, themes, or labels.
For example, to add a title or change colors: