Multiple uncertainty interval plots (ggplot stat)
A combination of stat_sample_slabinterval()
and
geom_slabinterval()
with sensible defaults.
While the corresponding geom
s are intended for use on
data frames that have already been summarized using a point_interval()
function, these stat
s are intended for use directly on data frames of draws, and
will perform the summarization using a point_interval()
function.
stat_interval( mapping = NULL, data = NULL, geom = "interval", position = "identity", ..., orientation = NA, interval_function = NULL, interval_args = list(), point_interval = median_qi, .width = c(0.5, 0.8, 0.95), show_point = FALSE, show_slab = FALSE, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, .prob, fun.data, fun.args )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
geom |
Use to override the default connection between
|
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
... |
Other arguments passed to |
orientation |
Whether this geom is drawn horizontally ( |
interval_function |
Custom function for generating intervals (for most common use cases the |
interval_args |
Additional arguments passed to |
point_interval |
A function from the |
.width |
The |
show_point |
Should the point portion of the geom be drawn? Default |
show_slab |
Should the slab portion of the geom be drawn? Default |
na.rm |
If |
show.legend |
Should this layer be included in the legends? Default is |
inherit.aes |
If |
.prob |
Deprecated. Use |
fun.data |
Deprecated. Use |
fun.args |
Deprecated. Use |
A ggplot2::Stat representing a multiple interval geometry which can
be added to a ggplot()
object.
These stats support the following aesthetics:
colour
datatype
x
y
thickness
group
In addition, in their default configuration (paired with geom_interval()
) the following aesthetics are supported by the underlying geom:
x
y
datatype
alpha
colour
colour_ramp
linetype
fill
shape
stroke
point_colour
point_fill
point_alpha
point_size
size
interval_colour
interval_alpha
interval_size
interval_linetype
slab_size
slab_colour
slab_fill
slab_alpha
slab_linetype
fill_ramp
ymin
ymax
xmin
xmax
width
height
thickness
group
See examples of some of these aesthetics in action in vignette("slabinterval")
.
Learn more about the sub-geom aesthetics (like interval_color
) in the scales documentation.
Learn more about basic ggplot aesthetics in vignette("ggplot2-specs")
.
See geom_interval()
for the geom versions, intended
for use on points and intervals that have already been summarized using a point_interval()
function.
See stat_pointinterval()
for a similar stat intended for
point summaries and intervals.
See stat_sample_slabinterval()
for a variety of other
stats that combine intervals with densities and CDFs.
See geom_slabinterval()
for the geom that these geoms wrap. All parameters of that geom are
available to these geoms.
library(dplyr) library(ggplot2) theme_set(theme_ggdist()) data(RankCorr_u_tau, package = "ggdist") RankCorr_u_tau %>% group_by(i) %>% ggplot(aes(y = factor(i), x = u_tau)) + stat_interval() + scale_color_brewer() RankCorr_u_tau %>% group_by(i) %>% ggplot(aes(x = factor(i), y = u_tau)) + stat_interval() + scale_color_brewer()
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.