mplot3_xy | R Documentation |
mplot3
: XY Scatter and line plotsPlot points and lines with optional fits and standard error bands
mplot3_xy(
x,
y = NULL,
fit = NULL,
formula = NULL,
se.fit = FALSE,
fit.params = NULL,
error.x = NULL,
error.y = NULL,
cluster = NULL,
cluster.params = list(),
data = NULL,
type = "p",
group = NULL,
xlab = NULL,
ylab = NULL,
main = NULL,
xlim = NULL,
ylim = NULL,
xpd = TRUE,
xaxs = "r",
yaxs = "r",
log = "",
rsq = NULL,
rsq.pval = FALSE,
rsq.side = 1,
rsq.adj = 0.98,
rsq.col = NULL,
rsq.line = NULL,
fit.error = FALSE,
fit.error.side = 1,
fit.error.padj = NA,
xaxp = NULL,
yaxp = NULL,
scatter = TRUE,
axes.equal = FALSE,
pty = "m",
annotation = NULL,
annotation.col = NULL,
x.axis.at = NULL,
x.axis.labs = TRUE,
y.axis.at = NULL,
y.axis.labs = TRUE,
xlab.adj = 0.5,
ylab.adj = 0.5,
mar = NULL,
oma = rep(0, 4),
point.cex = 1,
point.bg.col = NULL,
pch = ifelse(is.null(point.bg.col), 16, 21),
line.col = NULL,
line.alpha = 0.66,
lwd = 1,
lty = 1,
marker.col = NULL,
marker.alpha = NULL,
error.x.col = NULL,
error.y.col = NULL,
error.x.lty = 1,
error.y.lty = 1,
error.x.lwd = 1,
error.y.lwd = 1,
error.arrow.code = 3,
fit.col = NULL,
fit.lwd = 2.5,
fit.alpha = 1,
fit.legend = ifelse(is.null(fit), FALSE, TRUE),
se.lty = "poly",
se.lwd = 1,
se.col = NULL,
se.alpha = 0.5,
se.times = 1.96,
se.border = FALSE,
se.density = NULL,
hline = NULL,
hline.col = NULL,
hline.lwd = 1.5,
hline.lty = 3,
vline = NULL,
vline.lwd = 1.5,
vline.col = "blue",
vline.lty = 3,
diagonal = FALSE,
diagonal.inv = FALSE,
diagonal.lwd = 1.5,
diagonal.lty = 1,
diagonal.col = "gray50",
diagonal.alpha = 1,
group.legend = NULL,
group.title = NULL,
group.names = NULL,
group.side = 3,
group.adj = 0.02,
group.padj = 2,
group.at = NA,
fit.legend.col = NULL,
fit.legend.side = 3,
fit.legend.adj = 0.02,
fit.legend.padj = 2,
fit.legend.at = NA,
rm.na = TRUE,
theme = rtTheme,
palette = rtPalette,
order.on.x = NULL,
autolabel = letters,
new = FALSE,
par.reset = TRUE,
return.lims = FALSE,
pdf.width = 6,
pdf.height = 6,
trace = 0,
filename = NULL,
...
)
x |
Numeric vector or list of vectors for x-axis.
If |
y |
Numeric vector of list of vectors for y-axis
If |
fit |
Character: rtemis model to calculate |
formula |
Formula: Provide a formula to be solved using s_NLS.
If provided, |
se.fit |
Logical: If TRUE, draw the standard error of the fit |
fit.params |
List: Arguments for learner defined by |
error.x |
Vector, float: Error in |
error.y |
Vector, float: Error in |
cluster |
Character: Clusterer name. Will cluster
|
cluster.params |
List: Names list of parameters to pass to the
|
data |
(Optional) data frame, where |
type |
Character: "p" for points, "l" for lines, "s" for steps.
Default = "p". If |
group |
Vector: will be converted to factor.
If |
xlab |
Character: x-axis label |
ylab |
Character: y-axis label |
main |
Character: Plot title |
xlim |
Float vector, length 2: x-axis limits |
ylim |
Float vector, length 2: y-axis limits |
xpd |
Logical or NA: FALSE: plotting clipped to plot region; TRUE: plotting clipped to figure region; NA: plotting clipped to device region. |
xaxs |
Character: "r": Extend plot x-axis limits by 4% on either end; "i": Use exact x-axis limits. |
yaxs |
Character: as |
log |
Character: "x", "y", or "xy", defines if either or both axes should be log-transformed. |
rsq |
Logical: If TRUE, add legend with R-squared (if fit is not NULL) |
rsq.pval |
Logical: If TRUE, add legend with R-squared and its p-value, if fit is not NULL |
rsq.side |
Integer: [1:4] Where to place the |
rsq.adj |
Float: Adjust |
rsq.col |
Color: Color for |
rsq.line |
Numeric: Passed to |
fit.error |
Logical: If TRUE: draw fit error annotation. Default = NULL, which results in TRUE, if fit is set |
fit.error.side |
Integer [1:4]: Which side to draw |
fit.error.padj |
Float: See |
xaxp |
See |
yaxp |
See |
scatter |
Logical: If TRUE, plot (x, y) scatter points. |
axes.equal |
Logical: Should axes be equal? Defaults to FALSE |
pty |
Character: "s" gives a square plot; "m" gives a plot that fills
graphics device size. Default = "m" (See |
annotation |
Character: Add annotation at the bottom right of the plot |
annotation.col |
Color for annotation |
x.axis.at |
Float, vector: x coordinates to place tick marks.
Default = NULL, determined by |
x.axis.labs |
See |
y.axis.at |
As |
y.axis.labs |
See |
xlab.adj |
Float: |
ylab.adj |
Float: |
mar |
Float, vector, length 4: Margins; see |
oma |
Float, vector, length 4: Outer margins; see |
point.cex |
Float: Character expansion for points. |
point.bg.col |
Color: point background |
pch |
Integer: Point character. |
line.col |
Color for lines |
line.alpha |
Float [0, 1]: Transparency for lines |
lwd |
Float: Line width |
lty |
Integer: Line type. See |
marker.col |
Color for marker |
marker.alpha |
Float [0, 1]: Transparency for markers |
error.x.col |
Color for x-axis error bars |
error.y.col |
Color for y-axis error bars |
error.x.lty |
Integer: line type for x-axis error bars |
error.y.lty |
Integer: line type for y-axis error bars |
error.x.lwd |
Float: Line width for x-axis error bars |
error.y.lwd |
Float: Line width for y-axis error bars |
error.arrow.code |
Integer: Type of arrow to draw for error bars.
See |
fit.col |
Color: Color of the fit line. |
fit.lwd |
Float: Fit line width |
fit.alpha |
Float [0, 1]: Transparency for fit line |
fit.legend |
Logical: If TRUE, show fit legend |
se.lty |
How to draw the |
se.lwd |
Float: Line width for standard error bounds |
se.col |
Color for |
se.alpha |
Alpha for |
se.times |
Draw polygon or lines at +/- |
se.border |
Define border of polygon for |
se.density |
Density of shading line of polygon for |
hline |
Vector: y-value(s) for horizontal lines. |
hline.col |
Color for horizontal line(s) |
hline.lwd |
Float: Width for horizontal line(s) |
hline.lty |
Integer: Line type for horizontal line(s) |
vline |
Vector: x-value(s) for vertical lines. |
vline.lwd |
Float: Width for vertical lines |
vline.col |
Color for vertical lines |
vline.lty |
Integer: Line type for vertical lines |
diagonal |
Logical: If TRUE, draw diagonal line. |
diagonal.inv |
Logical: If TRUE, draw inverse diagonal line. Will use
|
diagonal.lwd |
Float: Line width for |
diagonal.lty |
Integer: Line type for |
diagonal.col |
Color: Color for |
diagonal.alpha |
Float: Alpha for |
group.legend |
Logical: If TRUE, place |
group.title |
Character: Group title, shown above group names. e.g.
if group names are c("San Francisco", "Philadelphia"), |
group.names |
(Optional) If multiple groups are plotted, use these
names if |
group.side |
Integer: Side to show group legend |
group.adj |
Float: |
group.padj |
Float: |
group.at |
Float: location for group legend. See |
fit.legend.col |
Color for fit legend |
fit.legend.side |
Integer: Side for fit legend |
fit.legend.adj |
Float: |
fit.legend.padj |
Float: |
fit.legend.at |
Float: location for fit legend. See |
rm.na |
Logical: If TRUE, remove all NA values pairwise between x and y. Set to FALSE if you know your data has no missing values. |
theme |
Character: Run |
palette |
Vector of colors, or Character defining a builtin palette -
get options with |
order.on.x |
Logical: If TRUE, order (x, y) by increasing x. Default = NULL: will be set to TRUE if fit is set, otherwise FALSE |
autolabel |
Character vector to be used to generate autolabels when using
rtlayout with |
new |
Logical: If TRUE, add plot to existing plot. See |
par.reset |
Logical: If TRUE, reset |
return.lims |
Logical: If TRUE, return xlim and ylim. |
pdf.width |
Float: Width in inches for pdf output (if |
pdf.height |
Float: Height in inches for pdf output. |
trace |
Integer: If > 0, pass |
filename |
Character: Path to file to save plot. Default = NULL |
... |
Additional arguments to be passed to theme function |
E.D. Gennatas
## Not run:
set.seed(1999)
x <- rnorm(500)
ycu <- x^3 + 12 + rnorm(500)
mplot3_xy(x, ycu)
mplot3_xy(x, ycu, fit = "gam")
ysq <- x^2 + 3 + rnorm(500)
mplot3_xy(x, list(squared = ysq, cubed = ycu), fit = "gam")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.