Generates a combination
geom_eyeh) representing the density, point summary, and uncertainty intervals
for draws from a distribution. Useful for representing posteriors from Bayesian models;
in that context this is variously called an eye plot, a raindrop plot, or a violin plot
(though violin plot is also applied to plots of data, hence its use is not
geom_eye(mapping = NULL, data = NULL, position = "identity", trim = TRUE, scale = "area", relative_scale = 1, fill = NULL, violin.color = NA, ..., point_interval = median_qi, fun.data = NULL, fun.args = list(), .width = c(0.66, 0.95), .prob, color = NULL, size = NULL, size_domain = NULL, size_range = NULL, fatten_point = NULL) geom_eyeh(mapping = NULL, data = NULL, position = "identity", trim = TRUE, scale = "area", relative_scale = 1, fill = NULL, violin.color = NA, ..., point_interval = median_qi, fun.data = NULL, fun.args = list(), .width = c(0.66, 0.95), .prob, color = NULL, size = NULL, size_domain = NULL, size_range = NULL, fatten_point = NULL)
The aesthetic mapping, usually constructed with
A layer specific dataset - only needed if you want to override the plot defaults.
A relative scaling factor to determine how much of the available
space densities are scaled to fill: if
Passed as the
A function that when given a vector should
return a data frame with variables
Optional arguments passed to
The minimum and maximum of the values of the size aesthetic that will be translated into actual
sizes drawn according to
This geom scales the raw size aesthetic values, as they tend to be too thick when using the default
A multiplicative factor used to adjust the size of the point relative to the size of the thickest line.
An eye plot is a compact visual summary of the distribution of a sample, used (under various names and with subtle variations) to visualize posterior distributions in Bayesian inference. This instantiation is a combination of a violin plot, point summary, and one or more uncertainty intervals.
The vertical form,
geom_eye, is equivalent to
geom_violin() + stat_pointinterval()
with some reasonable defaults, including color choices and the use of median with 95%
and 66% quantile intervals.
The horizontal form,
geom_eyeh(), is equivalent to
geom_violinh() + stat_pointintervalh().
library(magrittr) library(ggplot2) data(RankCorr, package = "tidybayes") RankCorr %>% spread_draws(u_tau[i]) %>% ggplot(aes(y = i, x = u_tau)) + geom_eyeh()