Plot a scatter (xy-plot) of binned elements with binning information.
Usage
plotBinScatter(
x,
y,
b,
cols = getColsByBin(b),
xlab = deparse(substitute(x, env = as.environment(-1))),
ylab = deparse(substitute(y, env = as.environment(-1))),
main = "",
legend = "topright",
legend.cex = 1,
...
)
Arguments
- x
A numerical vector with x values.
- y
A numerical vector with y values (the values used for binning).
- b
A factor that groups elements of
x,y
into bins (typically the output ofbin(y)
).- cols
A color vector (will be computed based on
b
by default usinggetColsByBin(b)
).- xlab
Label for x-axis.
- ylab
Label for y-axis.
- main
Main title.
- legend
If not
NULL
, draw a legend with binning information (will be passed tolegend(x=legend)
to control legend position).- legend.cex
A scalar that controls the text size in the legend relative to the current
par("cex")
(seelegend
).- ...
Further arguments passed to
plot(x, y, ...)
.