mplot3_xym | R Documentation |
Draw a scatter plot with fit line and marginal density and/or histogram
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),
margin.mar = 0.2,
xaxs = "r",
yaxs = "r",
theme = rtTheme,
par.reset = TRUE,
widths = NULL,
heights = NULL,
filename = NULL,
pdf.width = 7,
pdf.height = 7,
...
)
x |
Numeric vector: x-axis data |
y |
Numeric vector: y-axis data |
margin |
Character: "density", "histogram", or "both". Type of marginal plots to draw. |
fit |
Character: Algorithm to use to draw |
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 |
Numeric: Alpha for density plots |
hist.breaks |
Integer: Number of histogram breaks |
hist.alpha |
Numeric: Alpha for barplots |
hist.space |
Numeric: Space between bars in barplots |
hist.lwd |
Numeric: Line width for barplots |
lwd |
Numeric: Line width |
main |
Character: Main title |
main.adj |
Numeric: Main title adjustment |
axes.density |
Logical: If TRUE, plot margin plot axes for density (debugging only) |
pty |
Character: "s" gives a square plot; "m" gives a plot that fills
graphics device size. Default = "m" (See |
mar |
Float, vector, length 4: Margins; see |
margin.mar |
Numeric: Margin for marginal plots |
xaxs |
Character: "r": Extend plot x-axis limits by 4% on either end; "i": Use exact x-axis limits. |
yaxs |
Character: as |
theme |
Character: Run |
par.reset |
Logical: Resest |
filename |
Character: Path to file to save plot. Default = NULL |
pdf.width |
Float: Width in inches for pdf output (if |
pdf.height |
Float: Height in inches for pdf output. |
... |
Additional arguments to passed to mplot3_xy |
To make wide plot, change widths
: e.g. widths = c(7, 1)
E.D. Gennatas
## Not run:
x <- rnorm(500)
y <- x^3 + 12 + rnorm(500)
mplot3_xym(x, y)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.