plot_density: Produce a 1D density/histogram plot given data values 'x'.

Description Usage Arguments Details Value See Also Examples

View source: R/plot_contour.R

Description

plot_density generates a 1D density/histogram plot.

Usage

1
2
3
plot_density(x, breaks = 30, xlim, prob = NULL, smooth = FALSE,
  fill.col = "steelblue", plot.lines = TRUE, logx = FALSE,
  xlab = "", ylab = "", main = "", ...)

Arguments

x

(vector) x data values.

breaks

(integer) how many bins for 1D histograms

xlim

(vector) The limits of the x axis (x1, x2).

fill.col

(string) Colour to use under the histogram.

logx

(logical) produce density of log(variable)?

xlab, ylab

(strings) Labels for x, y axes.

...

(anything) any other graphical keywords to be passed to plot(...)

Details

Produce a single histogram or density plot, for use with contour_matrix.

Value

None.

See Also

chain_convergence, contour_matrix

Examples

1
2
3
4
5
6
7
n <- 1000
x <- rnorm(n)
y <- x + rnorm(n)
img <- hist2d(x, y, npix = 40)
junk <- plot_density(x, xlim = c(-4, 4))
junk <- plot_density(x, xlim = c(-4, 4), smooth = TRUE)
axis(1)

svdataman/tonic documentation built on Aug. 2, 2019, 3:21 p.m.