add_data_points | R Documentation |
Add data points
add_data_points(
plot,
data = all_rows(),
shape = 19,
size = 1,
white_border = FALSE,
dodge_width = NULL,
preserve = "total",
rasterize = FALSE,
rasterize_dpi = 300,
...
)
add_data_points_jitter(
plot,
data = all_rows(),
shape = 19,
size = 1,
white_border = FALSE,
dodge_width = NULL,
jitter_width = 0.2,
jitter_height = 0,
preserve = "total",
rasterize = FALSE,
rasterize_dpi = 300,
...
)
add_data_points_beeswarm(
plot,
data = all_rows(),
shape = 19,
size = 1,
white_border = FALSE,
cex = 3,
corral = "wrap",
corral.width = 0.5,
dodge_width = NULL,
preserve = "total",
rasterize = FALSE,
rasterize_dpi = 300,
...
)
plot |
A |
data |
The data to be displayed in this layer. There are three options:
|
shape |
An |
size |
A |
white_border |
Whether to include a white border around data points. Defaults to |
dodge_width |
For adjusting the distance between grouped objects. Defaults
to |
preserve |
Should dodging preserve the |
rasterize |
If |
rasterize_dpi |
The resolution in dots per inch (dpi) used for rastering
the layer if |
... |
Arguments passed on to the |
jitter_width |
Amount of random noise to be added to the
horizontal position of the of the data points. This can be useful to deal
with overplotting. Typical values range between |
jitter_height |
Amount of random noise to be added to the
vertical position of the of the data points. This can be useful to deal
with overplotting. Typical values range between |
cex |
Scaling for adjusting point spacing (see |
corral |
|
corral.width |
|
add_data_points_beeswarm()
is based on ggbeeswarm::geom_beeswarm()
.
Check there for additional arguments.
add_data_points()
and friends support rasterization. See examples and Advanced plotting.
add_data_points()
and friends support data subsetting. See examples and Advanced plotting.
A tidyplot
object.
study |>
tidyplot(x = treatment, y = score, color = treatment) |>
add_data_points()
study |>
tidyplot(x = treatment, y = score, color = treatment) |>
add_data_points_jitter()
study |>
tidyplot(x = treatment, y = score, color = treatment) |>
add_data_points_beeswarm()
# Changing arguments
study |>
tidyplot(x = treatment, y = score, color = treatment) |>
add_data_points_jitter(jitter_width = 1)
animals |>
tidyplot(x = weight, y = size) |>
add_data_points(white_border = TRUE)
animals |>
tidyplot(x = weight, y = size) |>
add_data_points(alpha = 0.4)
# Rasterization
animals |>
tidyplot(x = weight, y = size) |>
add_data_points(rasterize = TRUE, rasterize_dpi = 50)
# Data subsetting
animals |>
tidyplot(x = weight, y = size) |>
add_data_points() |>
add_data_points(data = filter_rows(size > 300), color = "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.