The draw()
function is humdrumR's goto plotting function.
draw()
can make a variety of graphs, depending on the type of data you give it.
For the most part, draw()
is simply a stylish, easy to use wrapper around
the base-R graphics functions plot()
, barplot()
, and hist()
.
Usage
draw(
x,
y,
col = 2,
facet = list(),
main = "",
sub = "",
xlab = NULL,
ylab = NULL,
...
)
# S4 method for numeric,numeric
draw(
x,
y,
col = 3,
log = "",
jitter = "xy",
xlim = NULL,
ylim = NULL,
xat = NULL,
yat = NULL,
cex = prep_cex(x),
...
)
# S4 method for numeric,missing
draw(
x,
y,
col = 3,
breaks = "Sturges",
jitter = "",
...,
cex = prep_cex(x) * 0.75,
xlim = NULL,
ylim = NULL
)
# S4 method for missing,numeric
draw(
x,
y,
col = 3,
log = "",
jitter = "",
...,
cex = prep_cex(y),
yat = NULL,
quantiles = c(0.025, 0.25, 0.5, 0.75, 0.975)
)
# S4 method for discrete,discrete
draw(
x,
y,
col = 2,
facet = list(),
main = "",
sub = "",
xlab = NULL,
ylab = NULL,
...
)
# S4 method for discrete,missing
draw(
x,
y,
col = 2,
facet = list(),
main = "",
sub = "",
xlab = NULL,
ylab = NULL,
...
)
# S4 method for token,missing
draw(
x,
y,
col = 2,
facet = list(),
main = "",
sub = "",
xlab = NULL,
ylab = NULL,
...
)
# S4 method for missing,token
draw(
x,
y,
col = 2,
facet = list(),
main = "",
sub = "",
xlab = NULL,
ylab = NULL,
...
)
# S4 method for token,token
draw(
x,
y,
col = 2,
facet = list(),
main = "",
sub = "",
xlab = NULL,
ylab = NULL,
...
)
# S4 method for count,ANY
draw(
x,
y,
col = 2,
facet = list(),
main = "",
sub = "",
xlab = NULL,
ylab = NULL,
...
)
# S4 method for table,ANY
draw(
x,
y,
col = 1:nrow(x),
log = "",
...,
ylim = NULL,
yat = NULL,
beside = TRUE
)
# S4 method for humdrumR.table,ANY
draw(
x,
y,
col = 2,
facet = list(),
main = "",
sub = "",
xlab = NULL,
ylab = NULL,
...
)
# S4 method for probability,ANY
draw(x, y, col = 1:nrow(x), log = "", ..., yat = NULL, beside = TRUE)
# S4 method for discrete,numeric
draw(x, y, col = 3, log = "", breaks = "Sturges", ..., yat = NULL)
# S4 method for list,numeric
draw(x, y, col = 3, log = "", breaks = "Sturges", ..., yat = NULL)
# S4 method for formula,ANY
draw(x, y, col = 2, xlab = NULL, ylab = NULL, data = NULL, ...)
# S4 method for humdrumR,ANY
draw(
x,
y,
col = 2,
facet = list(),
main = "",
sub = "",
xlab = NULL,
ylab = NULL,
...
)
Details
draw()
is a generic function, which does different plots depending on the data you pass to its
x
and y
arguments.
x
andy
both numeric: scatter plot.x
numeric by itself: histogram.y
numeric by itself: quantile plot.x
is a table: barplot.y
is numeric,x
ischaracter
orfactor
: a violin plot.
All the standard arguments to base-R plots can be used to customize plots.
See par()
for a full list.