View source: R/position-bluenoise.R
| position_bluenoisedodge | R Documentation |
This function dodges groups of points side-to-side and then scatters the
points that share a position across an elliptical field, spacing them evenly.
See the position_bluenoise() documentation for more information.
position_bluenoisedodge(
scatter.width = NULL,
scatter.height = NULL,
dodge.width = 1,
candidates = 10,
seed = NA,
orientation = "x"
)
scatter.width, scatter.height |
The dimensions of the elliptical field the points are spread across. |
dodge.width |
The dodging width, which defaults to 1. |
candidates |
The number of random draws considered for each point. |
seed |
A random seed for reproducibility. |
orientation |
The axis along which groups are separated, either
|
A ggproto object of class PositionBlueNoiseDodge.
Other Functions:
impute_extreme_values(),
position_bluenoise(),
position_circlepack(),
position_circlepackdodge(),
position_honeycomb(),
position_honeycombdodge(),
position_jitter_ellipse(),
position_jitterdodge_ellipse(),
position_sunflower(),
position_sunflowerdodge(),
sunflower()
library(ggplot2)
dat <- data.frame(x = rep(1, 400), y = rep(1, 400),
group = sample(LETTERS[1:2], 400, replace = TRUE))
ggplot(dat, aes(x, y, shape = group, color = group)) +
geom_point(position = position_bluenoisedodge(scatter.width = 0.4,
scatter.height = 0.4,
dodge.width = 1)) +
coord_cartesian(xlim = c(0, 2), ylim = c(0, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.