Learn R Programming

cograph (version 2.7.2)

plot.cograph_degree_fit: Plot method for cograph_degree_fit

Description

Overlays fitted distribution curves on a histogram of observed degrees.

Usage

# S3 method for cograph_degree_fit
plot(
  x,
  which = NULL,
  log = "",
  cols = NULL,
  lwd = 2,
  main = "Degree Distribution Fit",
  ...
)

Value

Invisible NULL.

Arguments

x

A cograph_degree_fit object from fit_degree_distribution.

which

Character vector of distribution names to display. Default NULL shows all fitted distributions.

log

Character string for log-scale axes: one of "" (default), "x", "y" or "xy". Only "y" and "xy" actually log the histogram axis; the values containing "x" are accepted for compatibility but merely filter non-positive fitted curve values.

cols

Named or unnamed character vector of colors for distribution curves. Default uses a built-in palette.

lwd

Line width for fitted curves. Default 2.

main

Plot title. Default "Degree Distribution Fit".

...

Additional arguments passed to hist.

Examples

Run this code
adj <- matrix(c(0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
                1, 1, 0, 1, 1, 0, 1, 1, 0, 1,
                0, 0, 1, 1, 0), 5, 5, byrow = TRUE)
fit <- cograph::fit_degree_distribution(adj)
plot(fit)

Run the code above in your browser using DataLab