Learn R Programming

rtemis (version 0.79)

mplot3.xym: mplot3 Scatter plot with marginal density and/or histogram

Description

Draw a scatter plot with fit line and marginal density and/or histogram

Usage

mplot3.xym(x, y, margin = c("histogram", "density", "both"),
  fit = "gam", se.fit = TRUE, xlim = NULL, ylim = NULL,
  col = "#18A3AC", density.alpha = 0.66, hist.breaks = 30,
  hist.alpha = 0.66, hist.space = 0.05, hist.lwd = 3, lwd = 4,
  main = NULL, main.adj = 0, axes.density = FALSE, pty = "m",
  mar = c(3, 3, 0, 0), mar.mar = 0.2, axes = TRUE, xaxs = "r",
  yaxs = "r", theme = getOption("rt.theme", "lightgrid"),
  par.reset = TRUE, widths = c(5, 1), heights = c(1, 5),
  filename = NULL, pdf.width = 7, pdf.height = 7, ...)

Arguments

x

x-data

y

y-data

margin

What type of marginal plots to draw. Options: "density", "histogram", or "both"

fit

What model to use to draw y ~ x. Options: mode.select()

se.fit

Logical: If TRUE: plot +/- 2 * Standard Error of fit

xlim

Float vector, length 2: x-axis limits

ylim

Float vector, length 2: y-axis limits

col

Color for marginal plots

density.alpha

Alpha for density plots

hist.breaks

Integer. Number of histogram breaks

hist.alpha

Alpha for barplots

hist.space

Space between bars in barplots

lwd

Float: Line width

main

String: Main title

main.adj

Float: Plot title alignment (0 = left, .5 = center, 1 = right)

axes.density

Logical: If TRUE, plot margin plot axes for density (debugging only)

pty

"s" gives a square plot, "m" gives a plot that fills graphics device size. Defaults to "s" (See ?par)

mar

Vector, length 4: Margins; see mar in ?par

axes

Logical: Should the axes be drawn? Defaults to TRUE

theme

String: "light", "dark", "lightgrid", "darkgrid", "lightbox", "darkbox" Default = "lightgrid" if no default "rt.fit" is set using options. You can set a system-wide default in your .Rprofile by including a line like options(rt.theme = 'lightgrid')

par.reset

Logical. Resest par to original settings

...

Additional arguments to be passed to mplot3.xy

Details

At the moment, mplot3.xym is the only mplot3 function that does not support