dense2d | R Documentation |
Uses base R's densCols
to
calculate local densities at each point in a scatterplot, and then
replaces them by a colored scheme, copied from Josh O'Brien posted
at
https://stackoverflow.com/questions/17093935/r-scatter-plot-symbol-color-represents-number-of-overlapping-points/17096661#17096661
dense2d(
x,
y,
pch = 20,
nbin = c(128, 128),
circular = FALSE,
x.circular = FALSE,
y.circular = FALSE,
xlim,
ylim,
colf = viridis::viridis,
...
)
x |
x-coordinates |
y |
y-coordinates |
pch |
|
nbin |
number of bins for both dimensions, can be a single.
number for both dimensions, or separate numbers, see argument
|
circular |
treat x and y as circular coordinates in radian. |
x.circular |
treat x as circular coordinates in radian. |
y.circular |
treat y as circular coordinates in radian. |
xlim |
numeric vectors of length 2, giving the x coordinate ranges. |
ylim |
as |
colf |
color map function used to create a color gradient,
eg. |
... |
arguments to plot (hint:cex can be useful). |
the plotted data.frame, including local densities.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.