plot.magbin: Plot 2D Histogram or Bin Data

View source: R/magbin.R

plot.magbinR Documentation

Plot 2D Histogram or Bin Data

Description

Plot 2D histogram counts or a third (z) axis summary statistic in 2D cells of different shapes.

Usage

## S3 method for class 'magbin'
plot(x, colramp = hcl.colors(21), colstretch = "lin",
  sizestretch = "lin", colref = "count", sizeref = "none", add = FALSE,
  dobar = TRUE, title = colref, colnorm = FALSE, projden = FALSE, projsig = FALSE,
  xdata = NULL, ydata = NULL, pch.dust = '.', cex.dust = 1, ...)

Arguments

x

Object of class 'magbin'.

colramp

Vector; a colour palette to use. Must be a vector and not a function.

colstretch

Character scalar; colour stretch, either linear (lin, default) or logarithmic (log, good for large dynamic ranges).

sizestretch

Character scalar; size stretch, either linear (lin, default) or logarithmic (log, good for large dynamic ranges).

colref

Character scalar; colour reference for call, either it should be based on the counts (count) or the z-axis statistic (zstat)?

sizeref

Character scalar; colour reference for call, either it should be ignored (none, so all are the same size and closely packed), based on the counts (count) or the z-axis statistic (zstat)?

add

Logical; should bins be added to the current plot? If FALSE then a new plot will be made.

dobar

Logical; should a colour bar be added to the plot?

title

Character scalar; title to use for the magbar label.

colnorm

Logical; should the colour bar be normalised so the maximum value equals 1?

projden

Logical; do you want projected density PDFs to be displayed above and to the side of the standard plot.magbin plot? If so you also need to pass the same xdata and ydata that you originally sent to magbin, since this is not stored in the object output from magbin.

projsig

Logical; if projden = TRUE then this will optionally add lines to show the pseudo 1-sigma range (15.9% to 84.1% quantiles).

xdata

Numeric vector; the original x data sent to magbin. Only relevant if projden=TRUE.

ydata

Numeric vector; the original y data sent to magbin. Only relevant if projden=TRUE.

pch.dust

Scalar; pch symbol to use for the dust points.

cex.dust

Scalar; cex size to use for the dust points.

...

Dots to be passed to magplot, magmap and magmap. Relevant arguments are matched, so look in those functions for optional arguments to pass.

Value

Run for the side effect of making a nice plot.

Author(s)

Aaron Robotham

See Also

magbin

Examples

temp = magbin(rnorm(1e4), rnorm(1e4), plot=FALSE)
plot(temp, xlab='x', ylab='y')

asgr/magicaxis documentation built on March 26, 2024, 9:50 p.m.