plot.BDataHistograms: Plot histograms as segments

View source: R/plots.R

plot.BDataHistogramsR Documentation

Plot histograms as segments

Description

Plot a histograms dataset as a set of "stairs" using matplot.

Usage

## S3 method for class 'BDataHistograms'
plot(
  x,
  probability = is(x, "BDataDensityHistograms"),
  xlab = "x",
  ylab = ifelse(probability, "density", "frequency"),
  ...
)

Arguments

x

a "BDataHistograms" object, of any class

probability

logical, should the histogram represent density (forced if 'x' is of class "BDataDensityHistograms") or frequency?

xlab

label for the x-axis

ylab

label for the y-axis

...

further arguments to [graphics::matplot()]

Value

nothing, called for its side effect to produce a plot. Each histogram is represented only as its outline.

See Also

Other BDataHistograms: BDataFrequencyHistograms(), as.BDataDensityHistograms(), as.BDataDensityHistograms.list(), as.BDataFrequencyHistograms.list(), getBreaks()

Examples

x = lapply(rep(1000,4), runif)
bdfhx = as.BDataFrequencyHistograms(x, breaks="Sturges",basis=B2Unif01Basis5)
plot(bdfhx)
bdfhx2 = as.BDataFrequencyHistograms(x, breaks=sqrt(0:10)/sqrt(10),basis=B2Unif01Basis5)
plot(bdfhx2, probability=TRUE)
# plot(bdfhx2) # this generates a warning

DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.