jmplot: Joint-marginal plot

View source: R/plot.R

jmplotR Documentation

Joint-marginal plot

Description

Joint and marginal distributions scatterplots with tplots on margins.

Usage

jmplot(
  x,
  y,
  z,
  main = "",
  sub = "",
  xlab = NULL,
  ylab = NULL,
  names = NULL,
  xlim = NULL,
  ylim = NULL,
  axes = TRUE,
  frame.plot = axes,
  log = "",
  xratio = 0.8,
  yratio = xratio,
  show.n = TRUE,
  show.na = show.n,
  cex.n = 1,
  ann = par("ann"),
  asp = NA,
  panel.first = NULL,
  panel.last = NULL,
  ...
)

Arguments

x, y

x- and y-axis variables

z

grouping variable

main, sub

main- and sub-titles (below x-axis) for the plot

xlab, ylab

x- and y-axis labels

names

labels for x and y variables

xlim, ylim

x- and y-axis limits

axes

logical; draw axes

frame.plot

logical; draw box around x-y plot

log

"x", "y", or "xy" for logarithmic scale or "" for none (default); sets negative values to NA and gives a warning; see xy.coords

xratio, yratio

proportion of x- and y-axes allotted for scatterplots; see widths and heights in layout

show.n, show.na

logical; show total and missing in each group

cex.n

size of show.n and show.na text

ann

logical; annotate plot

asp

numeric, giving the aspect ratio y/x; see plot.window

panel.first

an "expression" to be evaluated after the plot axes are set up but before any plotting takes place; this can be useful for drawing background grids or scatterplot smooths; note that this works by lazy evaluation: passing this argument from other plot methods may well not work since it may be evaluated too early; see also plot.default

panel.last

an expression to be evaluated after plotting has taken place but before the axes, title, and box are added; see the comments about panel.first

...

further arguments passed to par (las, pch, etc) and/or tplot (group.col, group.pch, etc)

Value

A list with elements x and y corresponding to boxplots on x- and y-axes, respectively. See boxplot or tplot for a detailed description of each list.

References

Tatsuki jmplot; tplot; boxplot

Examples

set.seed(1)
dat <- data.frame(
  x = rnorm(100, 20, 5),
  y = rexp(100),
  z = c('M', 'F'),
  zz = c(LETTERS[1:4])
)

with(dat, {
  jmplot(x, y, zz, type = 'db', jit = 0.02, col = 1:4, las = 1, cex.n = 0.5,
         group.col = TRUE, pch = 1:4, group.pch = TRUE, boxcol = grey(0.9))
})


raredd/plotr documentation built on Nov. 19, 2023, 4:09 a.m.