plot_w_hist: Plot histograms of link weights

View source: R/plot_w_hist.R

plot_w_histR Documentation

Plot histograms of link weights

Description

The function enables to plot histogram to visualize the distribution of the link weights

Usage

plot_w_hist(graph, fill = "#396D35", class_width = NULL)

Arguments

graph

A graph object of class igraph whose links are weighted

fill

A character string indicating the color used to fill the bars (default: "#396D35"). It must be a hexadecimal color code or a color used by default in R.

class_width

(default values: NULL) A numeric or an integer specifying the width of the classes displayed on the histogram. When it is not specified, the width is equal to the difference between the minimum and maximum values divided by 80.

Value

A ggplot2 object to plot

Author(s)

P. Savary

Examples

data(data_ex_genind)
mat_w <- mat_gen_dist(data_ex_genind, dist = "DPS")
gp <- gen_graph_topo(mat_w = mat_w, topo = "gabriel")
hist <- plot_w_hist(gp)

graph4lg documentation built on Feb. 16, 2023, 5:43 p.m.