dplot3_xy | R Documentation |
Draw interactive scatter plots using plotly
dplot3_xy(
x,
y = NULL,
fit = NULL,
se.fit = FALSE,
se.times = 1.96,
include.fit.name = TRUE,
cluster = NULL,
cluster.params = list(k = 2),
group = NULL,
formula = NULL,
rsq = TRUE,
mode = "markers",
order.on.x = NULL,
main = NULL,
subtitle = NULL,
xlab = NULL,
ylab = NULL,
col = NULL,
alpha = NULL,
theme = rtTheme,
palette = rtPalette,
axes.square = FALSE,
group.names = NULL,
font.size = 16,
marker.col = NULL,
marker.size = 8,
symbol = "circle",
fit.col = NULL,
fit.alpha = 0.8,
fit.lwd = 2.5,
se.col = NULL,
se.alpha = 0.4,
scatter.type = "scatter",
show.marginal.x = FALSE,
show.marginal.y = FALSE,
marginal.x = x,
marginal.y = y,
marginal.x.y = NULL,
marginal.y.x = NULL,
marginal.col = NULL,
marginal.alpha = 0.333,
marginal.size = 10,
legend = NULL,
legend.xy = c(0, 0.98),
legend.xanchor = "left",
legend.yanchor = "auto",
legend.orientation = "v",
legend.col = NULL,
legend.bg = "#FFFFFF00",
legend.border.col = "#FFFFFF00",
legend.borderwidth = 0,
legend.group.gap = 0,
x.showspikes = FALSE,
y.showspikes = FALSE,
spikedash = "solid",
spikemode = "across",
spikesnap = "hovered data",
spikecolor = NULL,
spikethickness = 1,
margin = list(b = 65, l = 65, t = 50, r = 10, pad = 0),
main.y = 1,
main.yanchor = "bottom",
subtitle.x = 0.02,
subtitle.y = 0.99,
subtitle.xref = "paper",
subtitle.yref = "paper",
subtitle.xanchor = "left",
subtitle.yanchor = "top",
automargin.x = TRUE,
automargin.y = TRUE,
xlim = NULL,
ylim = NULL,
axes.equal = FALSE,
diagonal = FALSE,
diagonal.col = NULL,
diagonal.alpha = 0.2,
fit.params = list(),
vline = NULL,
vline.col = theme$fg,
vline.width = 1,
vline.dash = "dot",
hline = NULL,
hline.col = theme$fg,
hline.width = 1,
hline.dash = "dot",
hovertext = NULL,
width = NULL,
height = NULL,
displayModeBar = TRUE,
modeBar.file.format = "svg",
scrollZoom = TRUE,
filename = NULL,
file.width = 500,
file.height = 500,
file.scale = 1,
trace = 0,
...
)
x |
Numeric, vector/data.frame/list: x-axis data. If y is NULL and
|
y |
Numeric, vector/data.frame/list: y-axis data |
fit |
Character: rtemis model to calculate |
se.fit |
Logical: If TRUE, draw the standard error of the fit |
se.times |
Draw polygon or lines at +/- |
include.fit.name |
Logical: If TRUE, include fit name in legend. |
cluster |
Character: Clusterer name. Will cluster
|
cluster.params |
List: Names list of parameters to pass to the
|
group |
Vector: Will be converted to factor; levels define group members. Default = NULL |
formula |
Formula: Provide a formula to be solved using s_NLS.
If provided, |
rsq |
Logical: If TRUE, print R-squared values in legend if |
mode |
Character, vector: "markers", "lines", "markers+lines". |
order.on.x |
Logical: If TRUE, order |
main |
Character: Main plot title. |
subtitle |
Character: Subtitle |
xlab |
Character: x-axis label. |
ylab |
Character: y-axis label. |
col |
Color for markers. Default=NULL, which will draw colors from palette |
alpha |
Float (0, 1]: Transparency for bar colors. Default = .8 |
theme |
List or Character: Either the output of a |
palette |
Character: Name of rtemis palette to use.
Default = "rtCol1". Only used if |
axes.square |
Logical: If TRUE: draw a square plot to fill the graphic device. Default = FALSE. Note: If TRUE, the device size at time of call is captured and height and width are set so as to draw the largest square available. This means that resizing the device window will not automatically resize the plot. |
group.names |
Character, vector, length = NROW(x): Group names.
Default = NULL, which uses |
font.size |
Float: Font size for all labels. Default = 16 |
marker.col |
Color for marker |
marker.size |
Numeric: Marker size. |
symbol |
Character: Marker symbol. |
fit.col |
Color: Color of the fit line. |
fit.alpha |
Float [0, 1]: Transparency for fit line |
fit.lwd |
Float: Fit line width |
se.col |
Color for |
se.alpha |
Alpha for |
scatter.type |
Character: "scatter", "scattergl", "scatter3d", "scatterternary", "scatterpolar", "scattermapbox", |
show.marginal.x |
Logical: If TRUE, add marginal distribution line markers on x-axis |
show.marginal.y |
Logical: If TRUE, add marginal distribution line markers on y-axis |
marginal.x |
Numeric: Data whose distribution will be shown on x-axis. Only
specify if different from |
marginal.y |
Numeric: Data whose distribution will be shown on y-axis. Only
specify if different from |
marginal.x.y |
Numeric: Y position of marginal markers on x-axis |
marginal.y.x |
Numeric: X position of marginal markers on y-axis |
marginal.col |
Color for marginal markers |
marginal.alpha |
Numeric: Alpha for marginal markers |
marginal.size |
Numeric: Size of marginal markers |
legend |
Logical: If TRUE, draw legend. Default = NULL, which will be set to
TRUE if there are more than 1 groups, or |
legend.xy |
Numeric, vector, length 2: x and y for plotly's legend |
legend.xanchor |
Character: Legend's x anchor: "left", "center", "right", "auto" |
legend.yanchor |
Character: Legend's y anchor: "top", "middle", "bottom", "auto" |
legend.orientation |
"v" or "h" for vertical or horizontal |
legend.col |
Color: Legend text color. Default = NULL, determined by theme |
legend.bg |
Color: Background color for legend |
legend.border.col |
Color: Border color for legend |
legend.borderwidth |
Numeric: Border width for legend |
legend.group.gap |
Numeric: Gap between legend groups |
x.showspikes |
Logical: If TRUE, show spikes on x-axis |
y.showspikes |
Logical: If TRUE, show spikes on y-axis |
spikedash |
Character: Dash type for spikes |
spikemode |
Character: "across", "toaxis", "marker", or any combination of those
joined by |
spikesnap |
Character: "data", "cursor", "hovered data" |
spikecolor |
Color for spikes |
spikethickness |
Numeric: Thickness of spikes |
margin |
Named list: plot margins. |
main.y |
Numeric: Y position of main title |
main.yanchor |
Character: "top", "middle", "bottom" |
subtitle.x |
Numeric: X position of subtitle relative to paper |
subtitle.y |
Numeric: Y position of subtitle relative to paper |
subtitle.xref |
Character: "paper", "x", "y" |
subtitle.yref |
Character: "paper", "x", "y" |
subtitle.xanchor |
Character: "left", "center", "right" |
subtitle.yanchor |
Character: "top", "middle", "bottom" |
automargin.x |
Logical: If TRUE, automatically set x-axis amrgins |
automargin.y |
Logical: If TRUE, automatically set y-axis amrgins |
xlim |
Float vector, length 2: x-axis limits |
ylim |
Float, vector, length 2: y-axis limits. |
axes.equal |
Logical: Should axes be equal? Defaults to FALSE |
diagonal |
Logical: If TRUE, draw diagonal line. |
diagonal.col |
Color: Color for |
diagonal.alpha |
Float: Alpha for |
fit.params |
List: Arguments for learner defined by |
vline |
Float, vector: If defined, draw a vertical line at this x value(s). Default = NULL |
vline.col |
Color for |
vline.width |
Float: Width for |
vline.dash |
Character: Type of line to draw: "solid", "dot", "dash", "longdash", "dashdot", or "longdashdot" |
hline |
Float: If defined, draw a horizontal line at this y value. |
hline.col |
Color for |
hline.width |
Float: Width for |
hline.dash |
Character: Type of line to draw: "solid", "dot", "dash", "longdash", "dashdot", or "longdashdot" |
hovertext |
List of character vectors with hovertext to include for each group of markers |
width |
Numeric: Force plot size to this width. Default = NULL, i.e. fill available space |
height |
Numeric: Force plot size to this height. Default = NULL, i.e. fill available space |
displayModeBar |
Logical: If TRUE, show plotly's modebar |
modeBar.file.format |
Character: "svg", "png", "jpeg", "pdf" / any output file type supported by plotly and your system |
scrollZoom |
Logical: If TRUE, enable scroll zoom |
filename |
Character: Path to file to save static plot. Default = NULL |
file.width |
Integer: File width in pixels for when |
file.height |
Integer: File height in pixels for when |
file.scale |
Numeric: If saving to file, scale plot by this number |
trace |
Integer: The height the number the more diagnostic info is printed to the console |
... |
Additional arguments passed to theme |
use theme$tick.labels.col for both tick color and tick label color - this may change
E.D. Gennatas
## Not run:
dplot3_xy(iris$Sepal.Length, iris$Petal.Length,
fit = "gam", se.fit = TRUE, group = iris$Species
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.