diff --git a/DESCRIPTION b/DESCRIPTION index a2194d56..3c36e5d0 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -85,6 +85,7 @@ Collate: "geom.R" "geom_slabinterval.R" "geom_dotsinterval.R" + "geom_blurdots.R" "geom_interval.R" "geom_lineribbon.R" "geom_pointinterval.R" diff --git a/NAMESPACE b/NAMESPACE index 881e318e..43228d8c 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -82,6 +82,7 @@ S3method(vec_ptype_full,ggdist_partial_colour_ramp) S3method(vec_ptype_full,ggdist_thickness) S3method(weights,ggdist__weighted_sample) export(AbstractStatSlabinterval) +export(GeomBlurdots) export(GeomDots) export(GeomDotsinterval) export(GeomInterval) @@ -133,6 +134,7 @@ export(facet_title_right_horizontal) export(find_dotplot_binwidth) export(from_broom_names) export(from_ggmcmc_names) +export(geom_blurdots) export(geom_dots) export(geom_dotsinterval) export(geom_interval) diff --git a/NEWS.md b/NEWS.md index 20a3dd96..ca4760c3 100755 --- a/NEWS.md +++ b/NEWS.md @@ -10,6 +10,8 @@ New features and enhancements: intervals, highest density intervals, and highest density continuous intervals), and all point summaries (mean, median, and mode) (#41). This includes support for the upcoming weighted random variable type in the *posterior* package. +* Blurry dotplots are now supported using `geom_blurdots()`, which accepts a + `blur` aesthetic to set the standard deviation of the blur on each dot (#63). * The `at` parameter to `stat_spike()` (or its names) now determines values of an `at` computed variable, which can be mapped onto aesthetics via `after_stat()` to more easily label spikes. (#203; thanks @mattansb for the suggestion). diff --git a/R/geom_blurdots.R b/R/geom_blurdots.R new file mode 100755 index 00000000..3836f9c3 --- /dev/null +++ b/R/geom_blurdots.R @@ -0,0 +1,143 @@ +# Geom for blurry dotplots +# +# Author: mjskay +############################################################################### + + +# blur functions --------------------------------------------------------------- + +blur_type_gaussian = function(x, r, sd) { + pnorm(x + r, 0, sd) - pnorm(x - r, 0, sd) +} + +blur_type_interval = function(x, r, sd) { + ifelse( + x < r, 1, + ifelse( + x < 2 * sd, 0.5, + 0 + ) + ) +} + + +# grob construction ------------------------------------------------------- + +make_blurry_points_grob = function( + x = 0.5, + y = 0.5, + ..., # ignored + col = "gray65", + fill = "gray65", + fontsize = 11, + lwd = 1, + lty = "solid", + axis = "x", + sd = 0, + n = 100, + blur_type = blur_type_gaussian +) { + # ensure r and sd are in the same units -- that way when we apply the blur function + # (which only takes numerics) everything will line up correctly + r = unit(fontsize / font_size_ratio / 2, "points") + sd = convertUnit(unit(sd %||% 0, "native"), unitTo = "points", axisFrom = axis, typeFrom = "dimension") + + grobs = .mapply(list(x, y, fill, sd, lwd, lty), NULL, FUN = function(x, y, fill, sd, lwd, lty) { + blur_width = 2 * sd + r + blur_x = seq(0, as.numeric(blur_width), length.out = n) + grad_colors = alpha(fill, c(blur_type(blur_x, as.numeric(r), as.numeric(sd)), 0)) + grad = radialGradient(grad_colors, r2 = blur_width) + + h = 2 * r + w = 2 * blur_width + blurry_fill = rectGrob( + x = x, y = y, + height = if (axis == "x") h else w, + width = if (axis == "x") w else h, + gp = gpar(fill = grad, col = NA) + ) + outline = circleGrob( + x = x, y = y, r = r, + gp = gpar(col = col, fill = NA, lwd = lwd, lty = lty) + ) + + grobTree(blurry_fill, outline) + }) + + do.call(grobTree, grobs) +} + +# geom_blurdots ---------------------------------------------------------- +#' @rdname ggdist-ggproto +#' @format NULL +#' @usage NULL +#' @import ggplot2 +#' @export +GeomBlurdots = ggproto("GeomBlurdots", GeomDots, + + ## aesthetics -------------------------------------------------------------- + + aes_docs = { + aes_docs = GeomDots$aes_docs + dots_aes_i = which(startsWith(names(aes_docs), "Dots-specific")) + aes_docs[[dots_aes_i]] = defaults(list( + blur = 'The blur associated with each dot, expressed as a standard deviation in data units.' + ), aes_docs[[dots_aes_i]]) + aes_docs + }, + + hidden_aes = union("shape", GeomDots$hidden_aes), + + default_aes = defaults(aes( + blur = 0 + ), GeomDots$default_aes), + + default_key_aes = defaults(aes( + colour = NA + ), GeomDots$default_key_aes), + + ## other methods ----------------------------------------------------------- + + setup_data = function(self, data, params) { + define_orientation_variables(params$orientation) + + data = ggproto_parent(GeomDots, self)$setup_data(data, params) + + # add an xmin/xmax to dots based on blur sd so that the full extent of + # blurred dots is drawn + data[["blur"]] = data[["blur"]] %||% params$blur + if (!is.null(data[["blur"]])) { + slab_i = which(data$datatype == "slab") + data[slab_i, xmin] = data[slab_i, x] - 2 * data[slab_i, "blur"] + data[slab_i, xmax] = data[slab_i, x] + 2 * data[slab_i, "blur"] + } + + data + }, + + draw_slabs = function(self, s_data, panel_params, coord, orientation, ...) { + define_orientation_variables(orientation) + + if (!is.null(s_data[["blur"]])) { + # blur is expressed in terms of data coordinates, need to translate + # into standardized space + xscale = max(panel_params[[x.range]]) - min(panel_params[[x.range]]) + s_data$blur = s_data$blur / xscale + s_data$blur[is.na(s_data$blur)] = 0 + } + + ggproto_parent(GeomDots, self)$draw_slabs(s_data, panel_params, coord, orientation, ...) + }, + + make_points_grob = make_blurry_points_grob +) + +#' @title Blurry dot plot (geom) +#' @description +#' Variant of [geom_dots()] for creating blurry dotplots. Accepts a `blur` +#' aesthetic that gives the standard deviation of the blur applied to the dots. +#' Requires a graphics engine supporting radial gradients. Unlike [geom_dots()], +#' all dots must be circular, so this geom does not support the `shape` aesthetic. +#' @eval rd_dotsinterval_shortcut_geom("blurdots", "blurry dot", title = FALSE, describe = FALSE) +#' @export +geom_blurdots = make_geom(GeomBlurdots) diff --git a/R/geom_dotsinterval.R b/R/geom_dotsinterval.R index 878c4e68..339c5bdf 100755 --- a/R/geom_dotsinterval.R +++ b/R/geom_dotsinterval.R @@ -15,7 +15,8 @@ dots_grob = function(data, x, y, xscale = 1, overlaps = "nudge", overflow = "keep", subguide = "none", verbose = FALSE, - orientation = "vertical" + orientation = "vertical", + make_points_grob = make_points_grob ) { # drop the dist columns because they can be expensive and we don't need them # after this point @@ -32,11 +33,15 @@ dots_grob = function(data, x, y, xscale = 1, subguide = subguide, verbose = verbose, orientation = orientation, + make_points_grob = make_points_grob, name = name, gp = gp, vp = vp, cl = "dots_grob" ) } +dot_size_ratio = 1.07 # historical fudge factor based on old stackratio +font_size_ratio = 1.43/dot_size_ratio # manual fudge factor for point size in ggplot + #' @export makeContent.dots_grob = function(x) { grob_ = x @@ -50,13 +55,11 @@ makeContent.dots_grob = function(x) { overlaps = grob_$overlaps overflow = grob_$overflow subguide = grob_$subguide + stackratio = grob_$stackratio + make_points_grob = grob_$make_points_grob define_orientation_variables(orientation) - dot_size_ratio = 1.07 # historical fudge factor based on old stackratio - font_size_ratio = 1.43/dot_size_ratio # manual fudge factor for point size in ggplot - stackratio = grob_$stackratio - # ratio between width of the bins (binwidth) # and the vertical spacing of dots (y_spacing) # this is a bit different from a raw stackratio since we want to account @@ -149,16 +152,18 @@ makeContent.dots_grob = function(x) { ) # generate grob for this dotplot - pointsGrob( - dot_positions$x, dot_positions$y, pch = d$shape, - gp = gpar( - col = alpha(d$colour, d$alpha), - fill = alpha(d$fill, d$alpha), - fontfamily = d$family, - fontsize = dot_fontsize, - lwd = lwd, - lty = d$linetype - ) + make_points_grob( + dot_positions$x, + dot_positions$y, + pch = d$shape, + col = alpha(d$colour, d$alpha), + fill = alpha(d$fill, d$alpha), + fontfamily = d$family, + fontsize = dot_fontsize, + lwd = lwd, + lty = d$linetype, + sd = d[["blur"]], + axis = x ) }) @@ -210,6 +215,32 @@ makeContent.dots_grob = function(x) { setChildren(grob_, do.call(gList, c(dot_grobs, subguide_grobs))) } +make_points_grob = function( + x, + y, + pch, + col, + fill, + fontfamily, + fontsize, + lwd, + lty, + ... # ignored +) { + pointsGrob( + x = x, + y = y, + pch = pch, + gp = gpar( + col = col, + fill = fill, + fontfamily = fontfamily, + fontsize = fontsize, + lwd = lwd, + lty = lty + ) + ) +} # panel drawing function ------------------------------------------------------- @@ -283,7 +314,8 @@ draw_slabs_dots = function(self, s_data, panel_params, coord, overflow = overflow, subguide = subguide, verbose = verbose, - orientation = orientation + orientation = orientation, + make_points_grob = self$make_points_grob )) } @@ -537,8 +569,9 @@ GeomDotsinterval = ggproto("GeomDotsinterval", GeomSlabinterval, # apply smooths --- must do this here in case resulting data exceeds boundaries of # original data, meaning scales must be adjusted smooth = match_function(params$smooth %||% "none", prefix = "smooth_") - s_data = data[data$datatype == "slab", c("group", x, y)] - data[data$datatype == "slab", x] = ave(s_data[[x]], s_data[, c("group", y)], FUN = smooth) + slab_i = which(data$datatype == "slab") + s_data = data[slab_i, c("group", x, y)] + data[slab_i, x] = ave(s_data[[x]], s_data[, c("group", y)], FUN = smooth) data }, @@ -565,7 +598,9 @@ GeomDotsinterval = ggproto("GeomDotsinterval", GeomSlabinterval, s_key_data$size = 2 draw_key_point(s_key_data, params, size) } - } + }, + + make_points_grob = make_points_grob ) #' @rdname geom_dotsinterval diff --git a/R/rd_dotsinterval.R b/R/rd_dotsinterval.R index bfeb138c..bd046e81 100755 --- a/R/rd_dotsinterval.R +++ b/R/rd_dotsinterval.R @@ -7,12 +7,18 @@ # shortcut stats/geoms ---------------------------------------------------- -rd_dotsinterval_shortcut_geom = function(geom_name, chart_type, from_name = "dotsinterval") { +rd_dotsinterval_shortcut_geom = function( + geom_name, + chart_type, + from_name = "dotsinterval", + title = TRUE, + describe = TRUE +) { geom = get(paste0("Geom", title_case(geom_name))) c( - glue_doc('@title <> plot (shortcut geom)'), - glue_doc(' + if (title) glue_doc('@title <> plot (shortcut geom)'), + if (describe) glue_doc(' @description Shortcut version of [geom_dotsinterval()] for creating <> plots. Geoms based on [geom_dotsinterval()] create dotplots that automatically @@ -20,7 +26,7 @@ rd_dotsinterval_shortcut_geom = function(geom_name, chart_type, from_name = "dot Roughly equivalent to: '), - rd_shortcut_geom(geom_name, from_name), + if (describe) rd_shortcut_geom(geom_name, from_name), '@inheritParams geom_dotsinterval', glue_doc(' @return A [ggplot2::Geom] representing a <> geometry which can diff --git a/man-roxygen/details-dotsinterval-family.R b/man-roxygen/details-dotsinterval-family.R index 0ec57eef..818c69ae 100755 --- a/man-roxygen/details-dotsinterval-family.R +++ b/man-roxygen/details-dotsinterval-family.R @@ -13,7 +13,7 @@ #' `dotsinterval` family) or the `shape` or `slab_shape` aesthetic (when using the `dots` family) #' } #' -#' Stat and geoms include in this family include: +#' Stats and geoms in this family include: #' #' - [geom_dots()]: dotplots on raw data. Ensures the dotplot fits within available space by reducing the size #' of the dots automatically (may result in very small dots). @@ -22,9 +22,11 @@ #' (`binwidth = unit(1.5, "mm")`), allowing dots to overlap instead of getting very small. #' - [stat_dots()]: dotplots on raw data, \pkg{distributional} objects, and [posterior::rvar()]s #' - [geom_dotsinterval()]: dotplot + interval plots on raw data with already-calculated -#' intervals (rarely useful directly) +#' intervals (rarely useful directly). #' - [stat_dotsinterval()]: dotplot + interval plots on raw data, \pkg{distributional} objects, -#' and [posterior::rvar()]s (will calculate intervals for you) +#' and [posterior::rvar()]s (will calculate intervals for you). +#' - [geom_blurdots()]: blurry dotplots that allow the standard deviation of a blur applied to +#' each dot to be specified using the `blur` aesthetic. #' #' [stat_dots()] and [stat_dotsinterval()], when used with the `quantiles` argument, #' are particularly useful for constructing quantile dotplots, which can be an effective way to communicate uncertainty diff --git a/man/geom_blurdots.Rd b/man/geom_blurdots.Rd new file mode 100755 index 00000000..a14be467 --- /dev/null +++ b/man/geom_blurdots.Rd @@ -0,0 +1,435 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/geom_blurdots.R +\name{geom_blurdots} +\alias{geom_blurdots} +\title{Blurry dot plot (geom)} +\usage{ +geom_blurdots( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + binwidth = NA, + dotsize = 1.07, + stackratio = 1, + layout = "bin", + overlaps = "nudge", + smooth = "none", + overflow = "keep", + verbose = FALSE, + orientation = NA, + subguide = "none", + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) +} +\arguments{ +\item{mapping}{Set of aesthetic mappings created by \code{\link[ggplot2:aes]{aes()}}. If specified and +\code{inherit.aes = TRUE} (the default), it is combined with the default mapping +at the top level of the plot. You must supply \code{mapping} if there is no plot +mapping.} + +\item{data}{The data to be displayed in this layer. There are three +options: + +If \code{NULL}, the default, the data is inherited from the plot +data as specified in the call to \code{\link[ggplot2:ggplot]{ggplot()}}. + +A \code{data.frame}, or other object, will override the plot +data. All objects will be fortified to produce a data frame. See +\code{\link[ggplot2:fortify]{fortify()}} for which variables will be created. + +A \code{function} will be called with a single argument, +the plot data. The return value must be a \code{data.frame}, and +will be used as the layer data. A \code{function} can be created +from a \code{formula} (e.g. \code{~ head(.x, 10)}).} + +\item{stat}{The statistical transformation to use on the data for this +layer, either as a \code{ggproto} \code{Geom} subclass or as a string naming the +stat stripped of the \code{stat_} prefix (e.g. \code{"count"} rather than +\code{"stat_count"})} + +\item{position}{Position adjustment, either as a string, or the result of a call to a position adjustment function. +Setting this equal to \code{"dodge"} (\code{\link[=position_dodge]{position_dodge()}}) or \code{"dodgejust"} (\code{\link[=position_dodgejust]{position_dodgejust()}}) can be useful if +you have overlapping geometries.} + +\item{...}{Other arguments passed to \code{\link[=layer]{layer()}}. These are often aesthetics, used to set an aesthetic +to a fixed value, like \code{colour = "red"} or \code{linewidth = 3} (see \strong{Aesthetics}, below). They may also be +parameters to the paired geom/stat.} + +\item{binwidth}{The bin width to use for laying out the dots. +One of: +\itemize{ +\item \code{NA} (the default): Dynamically select the bin width based on the +size of the plot when drawn. This will pick a \code{binwidth} such that the +tallest stack of dots is at most \code{scale} in height (ideally exactly \code{scale} +in height, though this is not guaranteed). +\item A length-1 (scalar) numeric or \link{unit} object giving the exact bin width. +\item A length-2 (vector) numeric or \link{unit} object giving the minimum and maximum +desired bin width. The bin width will be dynamically selected within +these bounds. +} + +If the value is numeric, it is assumed to be in units of data. The bin width +(or its bounds) can also be specified using \code{\link[=unit]{unit()}}, which may be useful if +it is desired that the dots be a certain point size or a certain percentage of +the width/height of the viewport. For example, \code{unit(0.1, "npc")} would make +dots that are \emph{exactly} 10\% of the viewport size along whichever dimension the +dotplot is drawn; \code{unit(c(0, 0.1), "npc")} would make dots that are \emph{at most} +10\% of the viewport size (while still ensuring the tallest stack is less than +or equal to \code{scale}).} + +\item{dotsize}{The width of the dots relative to the \code{binwidth}. The default, +\code{1.07}, makes dots be just a bit wider than the bin width, which is a +manually-tuned parameter that tends to work well with the default circular +shape, preventing gaps between bins from appearing to be too large visually +(as might arise from dots being \emph{precisely} the \code{binwidth}). If it is desired +to have dots be precisely the \code{binwidth}, set \code{dotsize = 1}.} + +\item{stackratio}{The distance between the center of the dots in the same +stack relative to the dot height. The default, \code{1}, makes dots in the same +stack just touch each other.} + +\item{layout}{The layout method used +for the dots: \itemize{ +\item \code{"bin"} (default): places dots on the off-axis at the midpoint of +their bins as in the classic Wilkinson dotplot. This maintains the +alignment of rows and columns in the dotplot. This layout is slightly +different from the classic Wilkinson algorithm in that: (1) it nudges +bins slightly to avoid overlapping bins and (2) if the input data are +symmetrical it will return a symmetrical layout. +\item \code{"weave"}: uses the same basic binning approach of \code{"bin"}, but +places dots in the off-axis at their actual positions (unless +\code{overlaps = "nudge"}, in which case overlaps may be nudged out of the +way). This maintains the alignment of rows but does not align dots +within columns. +\item \code{"hex"}: uses the same basic binning approach of \code{"bin"}, but +alternates placing dots \code{+ binwidth/4} or \code{- binwidth/4} in the +off-axis from the bin center. This allows hexagonal packing by setting +a \code{stackratio} less than 1 (something like \code{0.9} tends to work). +\item \code{"swarm"}: uses the \code{"compactswarm"} layout from +\code{\link[beeswarm:beeswarm]{beeswarm::beeswarm()}}. Does not maintain alignment of rows or columns, +but can be more compact and neat looking, especially for sample data +(as opposed to quantile dotplots of theoretical distributions, which +may look better with \code{"bin"}, \code{"weave"}, or \code{"hex"}). +\item \code{"bar"}: for discrete distributions, lays out duplicate values in +rectangular bars. +}} + +\item{overlaps}{How to handle overlapping dots or bins in the \code{"bin"}, +\code{"weave"}, and \code{"hex"} layouts (dots never overlap in the \code{"swarm"} or \code{"bar"} layouts). +For the purposes of this argument, dots are only considered to be overlapping +if they would be overlapping when \code{dotsize = 1} and \code{stackratio = 1}; i.e. +if you set those arguments to other values, overlaps may still occur. +One of: \itemize{ +\item \code{"keep"}: leave overlapping dots as they are. Dots may overlap +(usually only slightly) in the \code{"bin"}, \code{"weave"}, and \code{"hex"} layouts. +\item \code{"nudge"}: nudge overlapping dots out of the way. Overlaps are avoided +using a constrained optimization which minimizes the squared distance of +dots to their desired positions, subject to the constraint that adjacent +dots do not overlap. +}} + +\item{smooth}{Smoother to apply to dot positions. +One of: +\itemize{ +\item A function that takes a numeric vector of dot positions and returns a +smoothed version of that vector, such as \code{smooth_bounded()}, +\code{smooth_unbounded()}, smooth_discrete()\verb{, or }smooth_bar()`. +\item A string indicating what smoother to use, as the suffix to a function +name starting with \code{smooth_}; e.g. \code{"none"} (the default) applies +\code{smooth_none()}, which simply returns the given vector without +applying smoothing. +} + +Smoothing is most effective when the smoother is matched to the support of +the distribution; e.g. using \code{smooth_bounded(bounds = ...)}.} + +\item{overflow}{How to handle overflow of dots beyond the extent of the geom +when a minimum \code{binwidth} (or an exact \code{binwidth}) is supplied. +One of: +\itemize{ +\item \code{"keep"}: Keep the overflow, drawing dots outside the geom bounds. +\item \code{"compress"}: Compress the layout. Reduces the \code{binwidth} to the size necessary +to keep the dots within bounds, then adjusts \code{stackratio} and \code{dotsize} so that +the apparent dot size is the user-specified minimum \code{binwidth} times the +user-specified \code{dotsize}. +} + +If you find the default layout has dots that are too small, and you are okay +with dots overlapping, consider setting \code{overflow = "compress"} and supplying +an exact or minimum dot size using \code{binwidth}.} + +\item{verbose}{If \code{TRUE}, print out the bin width of the dotplot. Can be useful +if you want to start from an automatically-selected bin width and then adjust it +manually. Bin width is printed both as data units and as normalized parent +coordinates or \code{"npc"}s (see \code{\link[=unit]{unit()}}). Note that if you just want to scale the +selected bin width to fit within a desired area, it is probably easier to use +\code{scale} than to copy and scale \code{binwidth} manually, and if you just want to +provide constraints on the bin width, you can pass a length-2 vector to \code{binwidth}.} + +\item{orientation}{Whether this geom is drawn horizontally or vertically. One of: +\itemize{ +\item \code{NA} (default): automatically detect the orientation based on how the aesthetics +are assigned. Automatic detection works most of the time. +\item \code{"horizontal"} (or \code{"y"}): draw horizontally, using the \code{y} aesthetic to identify different +groups. For each group, uses the \code{x}, \code{xmin}, \code{xmax}, and \code{thickness} aesthetics to +draw points, intervals, and slabs. +\item \code{"vertical"} (or \code{"x"}): draw vertically, using the \code{x} aesthetic to identify different +groups. For each group, uses the \code{y}, \code{ymin}, \code{ymax}, and \code{thickness} aesthetics to +draw points, intervals, and slabs. +} +For compatibility with the base ggplot naming scheme for \code{orientation}, \code{"x"} can be used as an alias +for \code{"vertical"} and \code{"y"} as an alias for \code{"horizontal"} (\pkg{ggdist} had an \code{orientation} parameter +before base ggplot did, hence the discrepancy).} + +\item{subguide}{Sub-guide used to annotate the \code{thickness} scale. One of: +\itemize{ +\item A function that takes a \code{scale} argument giving a \link[ggplot2:ggplot2-ggproto]{ggplot2::Scale} +object and an \code{orientation} argument giving the orientation of the +geometry and then returns a \link[grid:grid.grob]{grid::grob} that will draw the axis +annotation, such as \code{\link[=subguide_axis]{subguide_axis()}} (to draw a traditional axis) or +\code{\link[=subguide_none]{subguide_none()}} (to draw no annotation). See \code{\link[=subguide_axis]{subguide_axis()}} +for a list of possibilities and examples. +\item A string giving the name of such a function when prefixed +with \code{"subguide"}; e.g. \code{"axis"} or \code{"none"}. +}} + +\item{na.rm}{If \code{FALSE}, the default, missing values are removed with a warning. If \code{TRUE}, missing +values are silently removed.} + +\item{show.legend}{logical. Should this layer be included in the legends? +\code{NA}, the default, includes if any aesthetics are mapped. +\code{FALSE} never includes, and \code{TRUE} always includes. +It can also be a named logical vector to finely select the aesthetics to +display.} + +\item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, +rather than combining with them. This is most useful for helper functions +that define both data and aesthetics and shouldn't inherit behaviour from +the default plot specification, e.g. \code{\link[ggplot2:borders]{borders()}}.} +} +\value{ +A \link[ggplot2:ggplot2-ggproto]{ggplot2::Geom} representing a blurry dot geometry which can +be added to a \code{\link[=ggplot]{ggplot()}} object. +} +\description{ +Variant of \code{\link[=geom_dots]{geom_dots()}} for creating blurry dotplots. Accepts a \code{blur} +aesthetic that gives the standard deviation of the blur applied to the dots. +Requires a graphics engine supporting radial gradients. Unlike \code{\link[=geom_dots]{geom_dots()}}, +all dots must be circular, so this geom does not support the \code{shape} aesthetic. +} +\details{ +The \emph{dots} family of stats and geoms are similar to \code{\link[=geom_dotplot]{geom_dotplot()}} but with a number of differences: + +\itemize{ +\item Dots geoms act like slabs in \code{\link[=geom_slabinterval]{geom_slabinterval()}} and can be given x positions (or y positions when +in a horizontal orientation). +\item Given the available space to lay out dots, the dots geoms will automatically determine how many bins to +use to fit the available space. +\item Dots geoms use a dynamic layout algorithm that lays out dots from the center out if the input data are +symmetrical, guaranteeing that symmetrical data results in a symmetrical plot. The layout algorithm also prevents +dots from overlapping each other. +\item The shape of the dots in these geoms can be changed using the \code{slab_shape} aesthetic (when using the +\code{dotsinterval} family) or the \code{shape} or \code{slab_shape} aesthetic (when using the \code{dots} family) +} + +Stats and geoms in this family include: +\itemize{ +\item \code{\link[=geom_dots]{geom_dots()}}: dotplots on raw data. Ensures the dotplot fits within available space by reducing the size +of the dots automatically (may result in very small dots). +\item \code{\link[=geom_swarm]{geom_swarm()}} and \code{\link[=geom_weave]{geom_weave()}}: dotplots on raw data with defaults intended to create "beeswarm" plots. +Used \code{side = "both"} by default, and sets the default dot size to the same size as \code{\link[=geom_point]{geom_point()}} +(\code{binwidth = unit(1.5, "mm")}), allowing dots to overlap instead of getting very small. +\item \code{\link[=stat_dots]{stat_dots()}}: dotplots on raw data, \pkg{distributional} objects, and \code{\link[posterior:rvar]{posterior::rvar()}}s +\item \code{\link[=geom_dotsinterval]{geom_dotsinterval()}}: dotplot + interval plots on raw data with already-calculated +intervals (rarely useful directly). +\item \code{\link[=stat_dotsinterval]{stat_dotsinterval()}}: dotplot + interval plots on raw data, \pkg{distributional} objects, +and \code{\link[posterior:rvar]{posterior::rvar()}}s (will calculate intervals for you). +\item \code{\link[=geom_blurdots]{geom_blurdots()}}: blurry dotplots that allow the standard deviation of a blur applied to +each dot to be specified using the \code{blur} aesthetic. +} + +\code{\link[=stat_dots]{stat_dots()}} and \code{\link[=stat_dotsinterval]{stat_dotsinterval()}}, when used with the \code{quantiles} argument, +are particularly useful for constructing quantile dotplots, which can be an effective way to communicate uncertainty +using a frequency framing that may be easier for laypeople to understand (Kay et al. 2016, Fernandes et al. 2018). +} +\section{Aesthetics}{ + +The dots+interval \code{stat}s and \code{geom}s have a wide variety of aesthetics that control +the appearance of their three sub-geometries: the \strong{dots} (aka the \strong{slab}), the +\strong{point}, and the \strong{interval}. + +\strong{Positional aesthetics} + +\itemize{ +\item{\code{x}: x position of the geometry} +\item{\code{y}: y position of the geometry} +} + +\strong{Dots-specific (aka Slab-specific) aesthetics} + +\itemize{ +\item{\code{blur}: The blur associated with each dot, expressed as a standard deviation in data units.} +\item{\code{family}: The font family used to draw the dots.} +\item{\code{order}: The order in which data points are stacked within bins. Can be used to create the effect of +"stacked" dots by ordering dots according to a discrete variable. If omitted (\code{NULL}), the +value of the data points themselves are used to determine stacking order. Only applies when +\code{layout} is \code{"bin"} or \code{"hex"}, as the other layout methods fully determine both \emph{x} and \emph{y} positions.} +\item{\code{side}: Which side to place the slab on. \code{"topright"}, \code{"top"}, and \code{"right"} are synonyms +which cause the slab to be drawn on the top or the right depending on if \code{orientation} is \code{"horizontal"} +or \code{"vertical"}. \code{"bottomleft"}, \code{"bottom"}, and \code{"left"} are synonyms which cause the slab +to be drawn on the bottom or the left depending on if \code{orientation} is \code{"horizontal"} or +\code{"vertical"}. \code{"topleft"} causes the slab to be drawn on the top or the left, and \code{"bottomright"} +causes the slab to be drawn on the bottom or the right. \code{"both"} draws the slab mirrored on both +sides (as in a violin plot).} +\item{\code{scale}: What proportion of the region allocated to this geom to use to draw the slab. If \code{scale = 1}, +slabs that use the maximum range will just touch each other. Default is \code{0.9} to leave some space +between adjacent slabs. For a comprehensive discussion and examples of slab scaling and normalization, +see the \href{https://mjskay.github.io/ggdist/articles/thickness.html}{\code{thickness} scale article}.} +\item{\code{justification}: Justification of the interval relative to the slab, where \code{0} indicates bottom/left +justification and \code{1} indicates top/right justification (depending on \code{orientation}). If \code{justification} +is \code{NULL} (the default), then it is set automatically based on the value of \code{side}: when \code{side} is +\code{"top"}/\code{"right"} \code{justification} is set to \code{0}, when \code{side} is \code{"bottom"}/\code{"left"} +\code{justification} is set to \code{1}, and when \code{side} is \code{"both"} \code{justification} is set to 0.5.} +\item{\code{datatype}: When using composite geoms directly without a \code{stat} (e.g. \code{\link[=geom_slabinterval]{geom_slabinterval()}}), \code{datatype} is used to +indicate which part of the geom a row in the data targets: rows with \code{datatype = "slab"} target the +slab portion of the geometry and rows with \code{datatype = "interval"} target the interval portion of +the geometry. This is set automatically when using ggdist \code{stat}s.} +} + +\strong{Interval-specific aesthetics} + +\itemize{ +\item{\code{xmin}: Left end of the interval sub-geometry (if \code{orientation = "horizontal"}).} +\item{\code{xmax}: Right end of the interval sub-geometry (if \code{orientation = "horizontal"}).} +\item{\code{ymin}: Lower end of the interval sub-geometry (if \code{orientation = "vertical"}).} +\item{\code{ymax}: Upper end of the interval sub-geometry (if \code{orientation = "vertical"}).} +} + +\strong{Color aesthetics} + +\itemize{ +\item{\code{colour}: (or \code{color}) The color of the \strong{interval} and \strong{point} sub-geometries. +Use the \code{slab_color}, \code{interval_color}, or \code{point_color} aesthetics (below) to +set sub-geometry colors separately.} +\item{\code{fill}: The fill color of the \strong{slab} and \strong{point} sub-geometries. Use the \code{slab_fill} +or \code{point_fill} aesthetics (below) to set sub-geometry colors separately.} +\item{\code{alpha}: The opacity of the \strong{slab}, \strong{interval}, and \strong{point} sub-geometries. Use the \code{slab_alpha}, +\code{interval_alpha}, or \code{point_alpha} aesthetics (below) to set sub-geometry colors separately.} +\item{\code{colour_ramp}: (or \code{color_ramp}) A secondary scale that modifies the \code{color} +scale to "ramp" to another color. See \code{\link[=scale_colour_ramp]{scale_colour_ramp()}} for examples.} +\item{\code{fill_ramp}: A secondary scale that modifies the \code{fill} +scale to "ramp" to another color. See \code{\link[=scale_fill_ramp]{scale_fill_ramp()}} for examples.} +} + +\strong{Line aesthetics} + +\itemize{ +\item{\code{linewidth}: Width of the line used to draw the \strong{interval} (except with \code{\link[=geom_slab]{geom_slab()}}: then +it is the width of the \strong{slab}). With composite geometries including an interval and slab, +use \code{slab_linewidth} to set the line width of the \strong{slab} (see below). For \strong{interval}, raw +\code{linewidth} values are transformed according to the \code{interval_size_domain} and \code{interval_size_range} +parameters of the \code{geom} (see above).} +\item{\code{size}: Determines the size of the \strong{point}. If \code{linewidth} is not provided, \code{size} will +also determines the width of the line used to draw the \strong{interval} (this allows line width and +point size to be modified together by setting only \code{size} and not \code{linewidth}). Raw +\code{size} values are transformed according to the \code{interval_size_domain}, \code{interval_size_range}, +and \code{fatten_point} parameters of the \code{geom} (see above). Use the \code{point_size} aesthetic +(below) to set sub-geometry size directly without applying the effects of +\code{interval_size_domain}, \code{interval_size_range}, and \code{fatten_point}.} +\item{\code{stroke}: Width of the outline around the \strong{point} sub-geometry.} +\item{\code{linetype}: Type of line (e.g., \code{"solid"}, \code{"dashed"}, etc) used to draw the \strong{interval} +and the outline of the \strong{slab} (if it is visible). Use the \code{slab_linetype} or +\code{interval_linetype} aesthetics (below) to set sub-geometry line types separately.} +} + +\strong{Slab-specific color and line override aesthetics} + +\itemize{ +\item{\code{slab_fill}: Override for \code{fill}: the fill color of the slab.} +\item{\code{slab_colour}: (or \code{slab_color}) Override for \code{colour}/\code{color}: the outline color of the slab.} +\item{\code{slab_alpha}: Override for \code{alpha}: the opacity of the slab.} +\item{\code{slab_linewidth}: Override for \code{linwidth}: the width of the outline of the slab.} +\item{\code{slab_linetype}: Override for \code{linetype}: the line type of the outline of the slab.} +\item{\code{slab_shape}: Override for \code{shape}: the shape of the dots used to draw the dotplot slab.} +} + +\strong{Interval-specific color and line override aesthetics} + +\itemize{ +\item{\code{interval_colour}: (or \code{interval_color}) Override for \code{colour}/\code{color}: the color of the interval.} +\item{\code{interval_alpha}: Override for \code{alpha}: the opacity of the interval.} +\item{\code{interval_linetype}: Override for \code{linetype}: the line type of the interval.} +} + +\strong{Point-specific color and line override aesthetics} + +\itemize{ +\item{\code{point_fill}: Override for \code{fill}: the fill color of the point.} +\item{\code{point_colour}: (or \code{point_color}) Override for \code{colour}/\code{color}: the outline color of the point.} +\item{\code{point_alpha}: Override for \code{alpha}: the opacity of the point.} +\item{\code{point_size}: Override for \code{size}: the size of the point.} +} + +\strong{Deprecated aesthetics} + +\itemize{ +\item{\code{slab_size}: Use \code{slab_linewidth}.} +\item{\code{interval_size}: Use \code{interval_linewidth}.} +} + +\strong{Other aesthetics} (these work as in standard \code{geom}s) + +\itemize{ +\item{\code{width}} +\item{\code{height}} +\item{\code{group}} +} + +See examples of some of these aesthetics in action in \code{vignette("dotsinterval")}. +Learn more about the sub-geom override aesthetics (like \code{interval_color}) in the +\link[ggdist]{scales} documentation. Learn more about basic ggplot aesthetics in +\code{vignette("ggplot2-specs")}. +} + +\examples{ +library(dplyr) +library(ggplot2) + +data(RankCorr_u_tau, package = "ggdist") + +# orientation is detected automatically based on +# which axis is discrete + +RankCorr_u_tau \%>\% + ggplot(aes(x = u_tau)) + + geom_blurdots() + +RankCorr_u_tau \%>\% + ggplot(aes(y = u_tau)) + + geom_blurdots() +} +\references{ +Kay, M., Kola, T., Hullman, J. R., & Munson, S. A. (2016). When (ish) is My Bus? User-centered Visualizations +of Uncertainty in Everyday, Mobile Predictive Systems. \emph{Conference on Human Factors +in Computing Systems - CHI '16}, 5092--5103. \doi{10.1145/2858036.2858558}. + +Fernandes, M., Walls, L., Munson, S., Hullman, J., & Kay, M. (2018). Uncertainty Displays Using Quantile Dotplots +or CDFs Improve Transit Decision-Making. \emph{Conference on Human Factors in Computing Systems - CHI '18}. +\doi{10.1145/3173574.3173718}. +} +\seealso{ +See \code{\link[=geom_dotsinterval]{geom_dotsinterval()}} for the geometry this shortcut is based on. + +See \code{vignette("dotsinterval")} for a variety of examples of use. + +Other dotsinterval geoms: +\code{\link{geom_dots}()}, +\code{\link{geom_dotsinterval}()}, +\code{\link{geom_swarm}()}, +\code{\link{geom_weave}()} +} +\concept{dotsinterval geoms} diff --git a/man/geom_dots.Rd b/man/geom_dots.Rd index 2853fbde..ed59f653 100755 --- a/man/geom_dots.Rd +++ b/man/geom_dots.Rd @@ -242,7 +242,7 @@ dots from overlapping each other. \code{dotsinterval} family) or the \code{shape} or \code{slab_shape} aesthetic (when using the \code{dots} family) } -Stat and geoms include in this family include: +Stats and geoms in this family include: \itemize{ \item \code{\link[=geom_dots]{geom_dots()}}: dotplots on raw data. Ensures the dotplot fits within available space by reducing the size of the dots automatically (may result in very small dots). @@ -251,9 +251,11 @@ Used \code{side = "both"} by default, and sets the default dot size to the same (\code{binwidth = unit(1.5, "mm")}), allowing dots to overlap instead of getting very small. \item \code{\link[=stat_dots]{stat_dots()}}: dotplots on raw data, \pkg{distributional} objects, and \code{\link[posterior:rvar]{posterior::rvar()}}s \item \code{\link[=geom_dotsinterval]{geom_dotsinterval()}}: dotplot + interval plots on raw data with already-calculated -intervals (rarely useful directly) +intervals (rarely useful directly). \item \code{\link[=stat_dotsinterval]{stat_dotsinterval()}}: dotplot + interval plots on raw data, \pkg{distributional} objects, -and \code{\link[posterior:rvar]{posterior::rvar()}}s (will calculate intervals for you) +and \code{\link[posterior:rvar]{posterior::rvar()}}s (will calculate intervals for you). +\item \code{\link[=geom_blurdots]{geom_blurdots()}}: blurry dotplots that allow the standard deviation of a blur applied to +each dot to be specified using the \code{blur} aesthetic. } \code{\link[=stat_dots]{stat_dots()}} and \code{\link[=stat_dotsinterval]{stat_dotsinterval()}}, when used with the \code{quantiles} argument, @@ -439,6 +441,7 @@ See \code{\link[=geom_dotsinterval]{geom_dotsinterval()}} for the geometry this See \code{vignette("dotsinterval")} for a variety of examples of use. Other dotsinterval geoms: +\code{\link{geom_blurdots}()}, \code{\link{geom_dotsinterval}()}, \code{\link{geom_swarm}()}, \code{\link{geom_weave}()} diff --git a/man/geom_dotsinterval.Rd b/man/geom_dotsinterval.Rd index 7f908ca5..a8dfe000 100644 --- a/man/geom_dotsinterval.Rd +++ b/man/geom_dotsinterval.Rd @@ -274,7 +274,7 @@ dots from overlapping each other. \code{dotsinterval} family) or the \code{shape} or \code{slab_shape} aesthetic (when using the \code{dots} family) } -Stat and geoms include in this family include: +Stats and geoms in this family include: \itemize{ \item \code{\link[=geom_dots]{geom_dots()}}: dotplots on raw data. Ensures the dotplot fits within available space by reducing the size of the dots automatically (may result in very small dots). @@ -283,9 +283,11 @@ Used \code{side = "both"} by default, and sets the default dot size to the same (\code{binwidth = unit(1.5, "mm")}), allowing dots to overlap instead of getting very small. \item \code{\link[=stat_dots]{stat_dots()}}: dotplots on raw data, \pkg{distributional} objects, and \code{\link[posterior:rvar]{posterior::rvar()}}s \item \code{\link[=geom_dotsinterval]{geom_dotsinterval()}}: dotplot + interval plots on raw data with already-calculated -intervals (rarely useful directly) +intervals (rarely useful directly). \item \code{\link[=stat_dotsinterval]{stat_dotsinterval()}}: dotplot + interval plots on raw data, \pkg{distributional} objects, -and \code{\link[posterior:rvar]{posterior::rvar()}}s (will calculate intervals for you) +and \code{\link[posterior:rvar]{posterior::rvar()}}s (will calculate intervals for you). +\item \code{\link[=geom_blurdots]{geom_blurdots()}}: blurry dotplots that allow the standard deviation of a blur applied to +each dot to be specified using the \code{blur} aesthetic. } \code{\link[=stat_dots]{stat_dots()}} and \code{\link[=stat_dotsinterval]{stat_dotsinterval()}}, when used with the \code{quantiles} argument, @@ -511,6 +513,7 @@ stats built on top of \code{\link[=geom_slabinterval]{geom_slabinterval()}}. See \code{vignette("dotsinterval")} for a variety of examples of use. Other dotsinterval geoms: +\code{\link{geom_blurdots}()}, \code{\link{geom_dots}()}, \code{\link{geom_swarm}()}, \code{\link{geom_weave}()} diff --git a/man/geom_swarm.Rd b/man/geom_swarm.Rd index 3b7be27c..54610d32 100755 --- a/man/geom_swarm.Rd +++ b/man/geom_swarm.Rd @@ -243,7 +243,7 @@ dots from overlapping each other. \code{dotsinterval} family) or the \code{shape} or \code{slab_shape} aesthetic (when using the \code{dots} family) } -Stat and geoms include in this family include: +Stats and geoms in this family include: \itemize{ \item \code{\link[=geom_dots]{geom_dots()}}: dotplots on raw data. Ensures the dotplot fits within available space by reducing the size of the dots automatically (may result in very small dots). @@ -252,9 +252,11 @@ Used \code{side = "both"} by default, and sets the default dot size to the same (\code{binwidth = unit(1.5, "mm")}), allowing dots to overlap instead of getting very small. \item \code{\link[=stat_dots]{stat_dots()}}: dotplots on raw data, \pkg{distributional} objects, and \code{\link[posterior:rvar]{posterior::rvar()}}s \item \code{\link[=geom_dotsinterval]{geom_dotsinterval()}}: dotplot + interval plots on raw data with already-calculated -intervals (rarely useful directly) +intervals (rarely useful directly). \item \code{\link[=stat_dotsinterval]{stat_dotsinterval()}}: dotplot + interval plots on raw data, \pkg{distributional} objects, -and \code{\link[posterior:rvar]{posterior::rvar()}}s (will calculate intervals for you) +and \code{\link[posterior:rvar]{posterior::rvar()}}s (will calculate intervals for you). +\item \code{\link[=geom_blurdots]{geom_blurdots()}}: blurry dotplots that allow the standard deviation of a blur applied to +each dot to be specified using the \code{blur} aesthetic. } \code{\link[=stat_dots]{stat_dots()}} and \code{\link[=stat_dotsinterval]{stat_dotsinterval()}}, when used with the \code{quantiles} argument, @@ -437,6 +439,7 @@ See \code{\link[=geom_dotsinterval]{geom_dotsinterval()}} for the geometry this See \code{vignette("dotsinterval")} for a variety of examples of use. Other dotsinterval geoms: +\code{\link{geom_blurdots}()}, \code{\link{geom_dots}()}, \code{\link{geom_dotsinterval}()}, \code{\link{geom_weave}()} diff --git a/man/geom_weave.Rd b/man/geom_weave.Rd index d128dd98..b0692054 100755 --- a/man/geom_weave.Rd +++ b/man/geom_weave.Rd @@ -243,7 +243,7 @@ dots from overlapping each other. \code{dotsinterval} family) or the \code{shape} or \code{slab_shape} aesthetic (when using the \code{dots} family) } -Stat and geoms include in this family include: +Stats and geoms in this family include: \itemize{ \item \code{\link[=geom_dots]{geom_dots()}}: dotplots on raw data. Ensures the dotplot fits within available space by reducing the size of the dots automatically (may result in very small dots). @@ -252,9 +252,11 @@ Used \code{side = "both"} by default, and sets the default dot size to the same (\code{binwidth = unit(1.5, "mm")}), allowing dots to overlap instead of getting very small. \item \code{\link[=stat_dots]{stat_dots()}}: dotplots on raw data, \pkg{distributional} objects, and \code{\link[posterior:rvar]{posterior::rvar()}}s \item \code{\link[=geom_dotsinterval]{geom_dotsinterval()}}: dotplot + interval plots on raw data with already-calculated -intervals (rarely useful directly) +intervals (rarely useful directly). \item \code{\link[=stat_dotsinterval]{stat_dotsinterval()}}: dotplot + interval plots on raw data, \pkg{distributional} objects, -and \code{\link[posterior:rvar]{posterior::rvar()}}s (will calculate intervals for you) +and \code{\link[posterior:rvar]{posterior::rvar()}}s (will calculate intervals for you). +\item \code{\link[=geom_blurdots]{geom_blurdots()}}: blurry dotplots that allow the standard deviation of a blur applied to +each dot to be specified using the \code{blur} aesthetic. } \code{\link[=stat_dots]{stat_dots()}} and \code{\link[=stat_dotsinterval]{stat_dotsinterval()}}, when used with the \code{quantiles} argument, @@ -437,6 +439,7 @@ See \code{\link[=geom_dotsinterval]{geom_dotsinterval()}} for the geometry this See \code{vignette("dotsinterval")} for a variety of examples of use. Other dotsinterval geoms: +\code{\link{geom_blurdots}()}, \code{\link{geom_dots}()}, \code{\link{geom_dotsinterval}()}, \code{\link{geom_swarm}()} diff --git a/man/ggdist-ggproto.Rd b/man/ggdist-ggproto.Rd index 2e77ab52..276e9e64 100755 --- a/man/ggdist-ggproto.Rd +++ b/man/ggdist-ggproto.Rd @@ -1,9 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/abstract_stat_slabinterval.R, R/geom.R, -% R/geom_slabinterval.R, R/geom_dotsinterval.R, R/geom_interval.R, -% R/geom_lineribbon.R, R/geom_pointinterval.R, R/geom_slab.R, R/geom_spike.R, -% R/geom_swarm.R, R/position_dodgejust.R, R/stat_slabinterval.R, -% R/stat_pointinterval.R, R/stat_interval.R, R/stat_spike.R +% R/geom_slabinterval.R, R/geom_dotsinterval.R, R/geom_blurdots.R, +% R/geom_interval.R, R/geom_lineribbon.R, R/geom_pointinterval.R, +% R/geom_slab.R, R/geom_spike.R, R/geom_swarm.R, R/position_dodgejust.R, +% R/stat_slabinterval.R, R/stat_pointinterval.R, R/stat_interval.R, +% R/stat_spike.R \docType{data} \name{AbstractStatSlabinterval} \alias{AbstractStatSlabinterval} @@ -11,6 +12,7 @@ \alias{GeomSlabinterval} \alias{GeomDotsinterval} \alias{GeomDots} +\alias{GeomBlurdots} \alias{GeomInterval} \alias{GeomLineribbon} \alias{GeomPointinterval} diff --git a/man/stat_dots.Rd b/man/stat_dots.Rd index 2d38743d..7cc62213 100755 --- a/man/stat_dots.Rd +++ b/man/stat_dots.Rd @@ -240,7 +240,7 @@ dots from overlapping each other. \code{dotsinterval} family) or the \code{shape} or \code{slab_shape} aesthetic (when using the \code{dots} family) } -Stat and geoms include in this family include: +Stats and geoms in this family include: \itemize{ \item \code{\link[=geom_dots]{geom_dots()}}: dotplots on raw data. Ensures the dotplot fits within available space by reducing the size of the dots automatically (may result in very small dots). @@ -249,9 +249,11 @@ Used \code{side = "both"} by default, and sets the default dot size to the same (\code{binwidth = unit(1.5, "mm")}), allowing dots to overlap instead of getting very small. \item \code{\link[=stat_dots]{stat_dots()}}: dotplots on raw data, \pkg{distributional} objects, and \code{\link[posterior:rvar]{posterior::rvar()}}s \item \code{\link[=geom_dotsinterval]{geom_dotsinterval()}}: dotplot + interval plots on raw data with already-calculated -intervals (rarely useful directly) +intervals (rarely useful directly). \item \code{\link[=stat_dotsinterval]{stat_dotsinterval()}}: dotplot + interval plots on raw data, \pkg{distributional} objects, -and \code{\link[posterior:rvar]{posterior::rvar()}}s (will calculate intervals for you) +and \code{\link[posterior:rvar]{posterior::rvar()}}s (will calculate intervals for you). +\item \code{\link[=geom_blurdots]{geom_blurdots()}}: blurry dotplots that allow the standard deviation of a blur applied to +each dot to be specified using the \code{blur} aesthetic. } \code{\link[=stat_dots]{stat_dots()}} and \code{\link[=stat_dotsinterval]{stat_dotsinterval()}}, when used with the \code{quantiles} argument, diff --git a/man/stat_dotsinterval.Rd b/man/stat_dotsinterval.Rd index ff029cf5..a3a1af0e 100755 --- a/man/stat_dotsinterval.Rd +++ b/man/stat_dotsinterval.Rd @@ -264,7 +264,7 @@ dots from overlapping each other. \code{dotsinterval} family) or the \code{shape} or \code{slab_shape} aesthetic (when using the \code{dots} family) } -Stat and geoms include in this family include: +Stats and geoms in this family include: \itemize{ \item \code{\link[=geom_dots]{geom_dots()}}: dotplots on raw data. Ensures the dotplot fits within available space by reducing the size of the dots automatically (may result in very small dots). @@ -273,9 +273,11 @@ Used \code{side = "both"} by default, and sets the default dot size to the same (\code{binwidth = unit(1.5, "mm")}), allowing dots to overlap instead of getting very small. \item \code{\link[=stat_dots]{stat_dots()}}: dotplots on raw data, \pkg{distributional} objects, and \code{\link[posterior:rvar]{posterior::rvar()}}s \item \code{\link[=geom_dotsinterval]{geom_dotsinterval()}}: dotplot + interval plots on raw data with already-calculated -intervals (rarely useful directly) +intervals (rarely useful directly). \item \code{\link[=stat_dotsinterval]{stat_dotsinterval()}}: dotplot + interval plots on raw data, \pkg{distributional} objects, -and \code{\link[posterior:rvar]{posterior::rvar()}}s (will calculate intervals for you) +and \code{\link[posterior:rvar]{posterior::rvar()}}s (will calculate intervals for you). +\item \code{\link[=geom_blurdots]{geom_blurdots()}}: blurry dotplots that allow the standard deviation of a blur applied to +each dot to be specified using the \code{blur} aesthetic. } \code{\link[=stat_dots]{stat_dots()}} and \code{\link[=stat_dotsinterval]{stat_dotsinterval()}}, when used with the \code{quantiles} argument,