### Using continuous color scales with a custom guide Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/sub-geometry-scales.html Illustrates how to use continuous color scales like `scale_color_distiller` with a custom guide (`guide = "colorbar2"`) when targeting aesthetics like `point_color`. This is necessary because the default guide may not work correctly with these scales. ```R scale_color_distiller(..., guide = "colorbar2", aesthetics = "point_color") ``` -------------------------------- ### Guide Functions Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/sub-geometry-scales.html Helper functions for creating guides. ```APIDOC ## Guide Functions ### Description Helper functions for creating guides. ### Usage ```r guide_colourbar2(...) guide_colorbar2(...) ``` ``` -------------------------------- ### Example Usage Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/sub-geometry-scales.html An example demonstrating how to set multiple specific aesthetics for points, intervals, and slabs. ```APIDOC ## Example Usage ```r library(dplyr) library(ggplot2) # This plot shows how to set multiple specific aesthetics # NB it is very ugly and is only for demo purposes. data.frame(distribution = "Normal(1,2)") %>% parse_dist(distribution) %>% ggplot(aes(y = distribution, xdist = .dist, args = .args)) + stat_halfeye( shape = 21, # this point shape has a fill and outline point_color = "red", point_fill = "black", point_alpha = .1, point_size = 6, stroke = 2, interval_color = "blue", # interval line widths are scaled from [1, 6] onto [0.6, 1.4] by default # see the interval_size_range parameter in help("geom_slabinterval") linewidth = 8, interval_linetype = "dashed", interval_alpha = .25, # fill sets the fill color of the slab (here the density) slab_color = "green" ) ``` ``` -------------------------------- ### Basic ggplot2 setup with ggdist data Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/Pr_.html Initializes ggplot2 and loads the distribution data frame. This is a common setup for examples using ggdist. ```r library(ggplot2) library(distributional) df = data.frame( d = c(dist_normal(2.7, 1), dist_lognormal(1, 1/3)), name = c("normal", "lognormal") ) ``` -------------------------------- ### Install ggdist Package Source: https://context7.com/mjskay/ggdist/llms.txt Install the stable CRAN version or the development version from GitHub. Ensure devtools is installed for GitHub installation. ```r install.packages("ggdist") ``` ```r # install.packages("devtools") devtools::install_github("mjskay/ggdist") ``` -------------------------------- ### guide_rampbar Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/guide_rampbar.html Creates a continuous color ramp bar guide. This guide is designed to be used with continuous color scales like scale_fill_ramp_continuous() and scale_colour_ramp_continuous(). ```APIDOC ## guide_rampbar() ### Description A colour ramp bar guide that shows continuous colour ramp scales mapped onto values as a smooth gradient. Designed for use with `scale_fill_ramp_continuous()` and `scale_colour_ramp_continuous()`. ### Usage ```r guide_rampbar( ..., to = "gray65", available_aes = c("fill_ramp", "colour_ramp") ) ``` ### Arguments * `...`: Arguments passed on to `ggplot2::guide_colourbar()`. * `title`: A character string or expression indicating a title of guide. If `NULL`, the title is not shown. By default (`waiver()`), the name of the scale object or the name specified in `labs()` is used for the title. * `theme`: A `theme` object to style the guide individually or differently from the plot's theme settings. * `nbin`: A numeric specifying the number of bins for drawing the colourbar. A smoother colourbar results from a larger value. * `display`: A string indicating a method to display the colourbar. Can be one of "raster", "rectangles", or "gradient". * `raster`: Deprecated. A logical. If `TRUE` then the colourbar is rendered as a raster object. If `FALSE` then the colourbar is rendered as a set of rectangles. * `alpha`: A numeric between 0 and 1 setting the colour transparency of the bar. * `draw.ulim`: A logical specifying if the upper limit tick marks should be visible. * `draw.llim`: A logical specifying if the lower limit tick marks should be visible. * `angle`: Overrules the theme settings to automatically apply appropriate `hjust` and `vjust` for angled legend text. * `position`: A character string indicating where the legend should be placed relative to the plot panels. One of "top", "right", "bottom", "left", or "inside". * `direction`: A character string indicating the direction of the guide. One of "horizontal" or "vertical." * `reverse`: logical. If `TRUE` the colourbar is reversed. * `order`: positive integer less than 99 that specifies the order of this guide among multiple guides. * `to` (`string`): The color to ramp to in the guide. Corresponds to `1` on the scale. * `available_aes` (`character`): Vector listing the aesthetics for which a `guide_rampbar()` can be drawn. ``` -------------------------------- ### Setup for ggdist Vignette Source: https://github.com/mjskay/ggdist/blob/master/docs/articles/dotsinterval.html Loads necessary libraries for using ggdist and related packages. Sets the default theme to theme_ggdist. ```R library(dplyr) library(tidyr) library(distributional) library(ggdist) library(ggplot2) library(patchwork) theme_set(theme_ggdist()) ``` -------------------------------- ### Install ggdist Development Version from GitHub Source: https://github.com/mjskay/ggdist/blob/master/README.md Install the latest development version of ggdist from GitHub using the devtools package. ```r install.packages("devtools") devtools::install_github("mjskay/ggdist") ``` -------------------------------- ### Setup ggdist and ggplot2 Source: https://github.com/mjskay/ggdist/blob/master/docs/articles/lineribbon.html Load necessary libraries for ggdist and ggplot2. Sets a default theme for ggdist plots. ```R library(dplyr) library(tidyr) library(ggdist) library(ggplot2) library(distributional) library(patchwork) theme_set(theme_ggdist()) ``` -------------------------------- ### Using guide_rampbar() with default 'to' color Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/guide_rampbar.html Demonstrates the use of guide_rampbar() to create a continuous guide. Without specifying the 'to' argument, it defaults to 'gray65'. ```R tibble(d = dist_uniform(0, 1)) %>% ggplot(aes(y = 0, xdist = d)) + stat_slab(aes(fill_ramp = after_stat(x)), fill = "blue") + scale_fill_ramp_continuous(from = "red", guide = guide_rampbar()) ``` -------------------------------- ### Guides and Sub-guides Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/index.html Guides for labeling scales and sub-guides for labeling axes and counts. ```APIDOC ## guide_rampbar() ### Description Continuous guide for colour ramp scales. ### Method N/A (R function) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` ```APIDOC ## subguide_axis() ### Description Axis sub-guide for thickness scales. ### Method N/A (R function) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` ```APIDOC ## subguide_inside() ### Description Axis sub-guide for thickness scales (inside). ### Method N/A (R function) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` ```APIDOC ## subguide_outside() ### Description Axis sub-guide for thickness scales (outside). ### Method N/A (R function) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` ```APIDOC ## subguide_integer() ### Description Axis sub-guide for thickness scales (integer). ### Method N/A (R function) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` ```APIDOC ## subguide_count() ### Description Axis sub-guide for dot counts. ### Method N/A (R function) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` ```APIDOC ## subguide_slab() ### Description Axis sub-guide for slab aesthetics. ### Method N/A (R function) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` ```APIDOC ## subguide_dots() ### Description Axis sub-guide for dot aesthetics. ### Method N/A (R function) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` ```APIDOC ## subguide_spike() ### Description Axis sub-guide for spike aesthetics. ### Method N/A (R function) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` ```APIDOC ## subguide_none() ### Description Empty sub-guide for thickness scales. ### Method N/A (R function) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### Example: Interval Widths with n=1 Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/interval_widths.html Demonstrates generating a single interval width using interval_widths(1). The output is approximately 0.9. ```R interval_widths(1) # 0.9 #> [1] 0.9 ``` -------------------------------- ### Compare dodge vs dodgejust Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/position_dodgejust.html Compares the default 'dodge' positioning with 'dodgejust' positioning. The 'dodge' example shows how slabs can be positioned outside their bounds. The 'dodgejust' example demonstrates how to use the justification parameter to align points appropriately, and notes that position_dodgejust automatically detects justification for slabinterval family geoms. ```R library(dplyr) library(ggplot2) library(distributional) dist_df = tribble( ~group, ~subgroup, ~mean, ~sd, 1, "h", 5, 1, 2, "h", 7, 1.5, 3, "h", 8, 1, 3, "i", 9, 1, 3, "j", 7, 1 ) # An example with normal "dodge" positioning # Notice how dodge points are placed in the center of their bounding boxes, # which can cause slabs to be positioned outside their bounds. dist_df %>% ggplot(aes( x = factor(group), ydist = dist_normal(mean, sd), fill = subgroup )) + stat_halfeye( position = "dodge" ) + geom_rect( aes(xmin = group, xmax = group + 1, ymin = 2, ymax = 13, color = subgroup), position = "dodge", data = . %>% filter(group == 3), alpha = 0.1 ) + geom_point( aes(x = group, y = 7.5, color = subgroup), position = position_dodge(width = 1), data = . %>% filter(group == 3), shape = 1, size = 4, stroke = 1.5 ) + scale_fill_brewer(palette = "Set2") + scale_color_brewer(palette = "Dark2") # This same example with "dodgejust" positioning. For the points we # supply a justification parameter to position_dodgejust which mimics the # justification parameter of stat_halfeye, ensuring that they are # placed appropriately. On slabinterval family geoms, position_dodgejust() # will automatically detect the appropriate justification. dist_df %>% ggplot(aes( x = factor(group), ydist = dist_normal(mean, sd), fill = subgroup )) + stat_halfeye( position = "dodgejust" ) + geom_rect( aes(xmin = group, xmax = group + 1, ymin = 2, ymax = 13, color = subgroup), position = "dodgejust", ``` -------------------------------- ### Example: Interval Widths with n=2 Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/interval_widths.html Demonstrates generating two interval widths using interval_widths(2). The output includes roughly +/- 1 SD and +/- 2 SD intervals. ```R # this is roughly +/- 1 SD and +/- 2 SD interval_widths(2) # 0.672..., 0.95 #> [1] 0.672905 0.950000 ``` -------------------------------- ### Example Usage of geom_blur_dots Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/geom_blur_dots.html Demonstrates how to use geom_blur_dots with custom interval widths and default settings. ```APIDOC ## Example Usage ### Description Illustrates creating plots with `geom_blur_dots`, including setting custom interval widths. ### Code ```r library(dplyr) library(ggplot2) theme_set(theme_ggdist()) set.seed(1234) x = rnorm(1000) # Manually calculate quantiles and their MCSE p = ppoints(100) df = data.frame( q = quantile(x, p), se = posterior::mcse_quantile(x, p) ) # Default geom_blur_dots usage df %>% ggplot(aes(x = q, sd = se)) + geom_blur_dots() # geom_blur_dots with specified interval width df %>% ggplot(aes(x = q, sd = se)) + # blur = blur_interval(.width = .95) to set the interval width geom_blur_dots(blur = "interval") ``` ``` -------------------------------- ### Example: Interval Widths with n=3 Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/interval_widths.html Demonstrates generating three interval widths using interval_widths(3). The output includes approximately 0.521, 0.844, and 0.966. ```R interval_widths(3) # 0.521..., 0.844..., 0.966... ``` -------------------------------- ### Basic stat_dots() on Sample Data Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/stat_dots.html This example demonstrates the basic usage of stat_dots() on a sample dataset. It requires the dplyr, ggplot2, and distributional packages. Ensure theme_ggdist() is set for proper styling. ```R library(dplyr) library(ggplot2) library(distributional) theme_set(theme_ggdist()) # ON SAMPLE DATA set.seed(12345) tibble( x = rep(1:10, 100), y = rnorm(1000, x) ) %>% ggplot(aes(x = x, y = y)) + stat_dots() ``` -------------------------------- ### Using guide_rampbar() with specified 'to' color Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/guide_rampbar.html Shows how to specify the end color for the ramp bar guide using the 'to' argument in guide_rampbar(). This creates a continuous color ramp from the 'from' color to the 'to' color. ```R tibble(d = dist_uniform(0, 1)) %>% ggplot(aes(y = 0, xdist = d)) + stat_slab(aes(fill_ramp = after_stat(x)), fill = "blue") + scale_fill_ramp_continuous(from = "red", guide = guide_rampbar(to = "blue")) ``` -------------------------------- ### stat_slab on Analytical Distributions Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/stat_slab.html This example shows how to use stat_slab() with analytical distributions by mapping a distribution object (created using distributional::dist_normal()) to the xdist aesthetic. This allows for plotting densities of theoretical distributions. ```R dist_df = data.frame( group = c("a", "b", "c"), mean = c( 5, 7, 8), sd = c( 1, 1.5, 1) ) # Vectorized distribution types, like distributional::dist_normal() # and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics dist_df %>% ggplot(aes(y = group, xdist = dist_normal(mean, sd))) + stat_slab() ``` -------------------------------- ### Default guide_legend() for ramp scales Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/guide_rampbar.html Illustrates the default behavior of ramp scales using guide_legend(), which results in a discrete style scale. This is the default when no specific guide is provided. ```R library(dplyr) library(ggplot2) library(distributional) # The default guide for ramp scales is guide_legend(), which creates a # discrete style scale: tibble(d = dist_uniform(0, 1)) %>% ggplot(aes(y = 0, xdist = d)) + stat_slab(aes(fill_ramp = after_stat(x)), fill = "blue") + scale_fill_ramp_continuous(from = "red") ``` -------------------------------- ### Install ggdist from CRAN Source: https://github.com/mjskay/ggdist/blob/master/README.md Use this command to install the latest stable version of the ggdist package from CRAN. ```r install.packages("ggdist") ``` -------------------------------- ### Inside Subguide with Normalization Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/subguide_axis.html Shows how subguides respect normalization settings, using `normalize = "groups"` with `stat_slabinterval`. ```r library(ggplot2) library(distributional) df = data.frame(d = dist_normal(2:3, 2:3), g = c("a", "b")) # they respect normalization and use of scale_thickness_shared() ggplot(df, aes(xdist = d, y = g)) + stat_slabinterval(subguide = "inside", normalize = "groups") ``` -------------------------------- ### Create and use partial colour ramps Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/ramp_colours.html Demonstrates creating a partial_colour_ramp and then using ramp_colours to transform a target colour based on the ramp's parameters. This shows how colours are interpolated. ```R pcr = partial_colour_ramp(c(0, 0.25, 0.75, 1), "red") pcr #> #> [1] [0 from red] [0.25 from red] [0.75 from red] [1 from red] ramp_colours("blue", pcr) #> [1] "#FF0000" "#E80050" "#9A00C3" "#0000FF" ``` -------------------------------- ### geom_dots() Example Source: https://github.com/mjskay/ggdist/blob/master/docs/articles/dotsinterval.html Illustrates the usage of geom_dots() for creating a dotplot without an interval. This is a standalone geometry. ```R ggplot(df, aes(y = value, x = stat(count), fill = stat(count))) + geom_dots() + scale_fill_distiller(palette = "Blues") + facet_wrap(~ group, ncol = 1) ``` -------------------------------- ### Using Named Distributions with stat_lineribbon Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/stat_lineribbon.html Shows how to specify distributions by name (e.g., "norm") and provide arguments via aesthetics like arg1, arg2, etc., or as a list column named 'args'. This method is convenient for common distributions. ```R aes(dist = "norm", arg1 = mu, arg2 = sigma) ``` -------------------------------- ### scale_thickness Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/scale_thickness.html Configures the thickness scale for aesthetics. Allows control over renormalization, out-of-bounds value handling, guides, and limit expansion. ```APIDOC ## scale_thickness() ### Description Configures the thickness scale for aesthetics. This scale controls how thickness values are mapped and can be adjusted for renormalization, out-of-bounds values, guides, and expansion. ### Arguments * `renormalize` (logical): When mapping values to the `thickness` scale, should those values be allowed to be renormalized by geoms? Default is `FALSE`. * `oob`: Function that handles limits outside of the scale limits (out of bounds). Defaults to `scales::censor()`. * `guide`: A function used to create a guide or its name. See `guides()` for more information. * `expand`: Vector of limit expansion constants. Defaults to not expanding the limits. * `...`: Arguments passed on to `ggplot2::continuous_scale()` including `aesthetics`, `scale_name`, `palette`, `minor_breaks`, `n.breaks`, `rescaler`, `na.value`, and `transform`. ``` -------------------------------- ### Customizing Unbounded Smooth Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/smooth_density.html Demonstrates how to adjust the kernel and bandwidth for the unbounded smooth density calculation. ```r # you can adjust the kernel and bandwidth... ggplot(data.frame(x), aes(x)) + geom_dots(smooth = smooth_unbounded(kernel = "triangular", adjust = 0.5)) ``` -------------------------------- ### Basic geom_dotsinterval() Example Source: https://github.com/mjskay/ggdist/blob/master/docs/articles/dotsinterval.html Demonstrates the basic usage of geom_dotsinterval() to create a dotplot with an interval. This geom is part of the slabinterval family. ```R ggplot(df, aes(y = value, x = stat(count), fill = stat(count))) + geom_dotsinterval() + scale_fill_distiller(palette = "Blues") + facet_wrap(~ group, ncol = 1) ``` -------------------------------- ### Demonstrate Partial Application of density_unbounded Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/auto_partial.html Shows how `density_unbounded()` can be called without arguments to return a partially applied function. It also demonstrates creating a new function with a modified bandwidth and overwriting previously applied arguments. ```R set.seed(1234) x = rnorm(100) # the first required argument, `x`, of the density_ family is the vector # to calculate a kernel density estimate from. If it is not provided, the # function is partially applied and returned as-is density_unbounded() #> : #> density_unbounded() # we could create a new function that uses half the default bandwidth density_half_bw = density_unbounded(adjust = 0.5) density_half_bw #> : #> density_unbounded(adjust = 0.5) # we can overwrite partially-applied arguments density_quarter_bw_trimmed = density_half_bw(adjust = 0.25, trim = TRUE) ``` -------------------------------- ### Plotting Distributions with stat_dotsinterval Source: https://github.com/mjskay/ggdist/blob/master/docs/articles/dotsinterval.html Use stat_dotsinterval to visualize distributions defined by xdist. This example uses 'integer' subguide for labeling dot counts. ```R dist_df = tibble( dist = c(dist_normal(1,0.25), dist_beta(3,3), dist_gamma(5,5)), dist_name = format(dist) ) dist_df %>% ggplot(aes(y = dist_name, xdist = dist)) + stat_dotsinterval(subguide = 'integer') + ggtitle( "stat_dotsinterval(subguide = 'integer')", "aes(y = dist_name, xdist = dist)" ) ``` -------------------------------- ### Separate Slab and Interval Positioning Source: https://github.com/mjskay/ggdist/blob/master/docs/articles/slabinterval.html Use `stat_slab` and `stat_pointinterval` separately to gain independent control over their positioning. This example applies `position_dodgejust` only to the intervals, not the slabs. ```R df %> ggplot(aes(fill = group, color = group, x = value)) + stat_slab(alpha = .3) + stat_pointinterval(position = position_dodgejust(width = .2), justification = 0.1) + labs( title = "stat_slab() and stat_pointinterval()", subtitle = "with position_dodgejust() applied to the intervals", y = NULL ) + scale_y_continuous(breaks = NULL) ``` -------------------------------- ### Basic Inside Subguide for Slabinterval Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/subguide_axis.html Demonstrates the use of `subguide = "inside"` with `stat_slabinterval` to draw density labels inside the plot area. ```r library(ggplot2) library(distributional) df = data.frame(d = dist_normal(2:3, 2:3), g = c("a", "b")) # subguides allow you to label thickness axes ggplot(df, aes(xdist = d, y = g)) + stat_slabinterval(subguide = "inside") ``` -------------------------------- ### Setup Libraries for ggdist Vignette Source: https://github.com/mjskay/ggdist/blob/master/docs/articles/thickness.html Required libraries for running ggdist vignettes, including ggplot2, dplyr, distributional, and ggdist. Sets a custom theme. ```R library(ggplot2) library(dplyr) library(distributional) library(ggdist) theme_set(theme_ggdist()) ``` -------------------------------- ### Enable PNG Compression for CRAN Source: https://github.com/mjskay/ggdist/blob/master/vignettes/children/chunk_options.txt Sets up a hook for PNG compression using 'pngquant' when not building for pkgdown. This optimizes PNG file sizes for CRAN submission. ```r if (!in_pkgdown) { knitr::knit_hooks$set(pngquant = knitr::hook_pngquant) knitr::opts_chunk$set(pngquant = "--speed=1 --quality=50") } ``` -------------------------------- ### Mirrored Side Scale Example Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/scale_side_mirrored.html Demonstrates the use of `scale_side_mirrored()` with a mirrored discrete scale. This is useful when you want to map a discrete variable to the 'side' aesthetic and have it mirrored. ```r library(dplyr) library(ggplot2) set.seed(1234) data.frame( x = rnorm(400, c(1,4)), g = c("a","b") ) %>% ggplot(aes(x, fill = g, side = g)) + geom_weave(linewidth = 0, scale = 0.5) + scale_side_mirrored() ``` -------------------------------- ### Basic Usage of density_histogram Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/density_histogram.html Demonstrates the basic usage of `density_histogram` with a sample dataset and prints the resulting density object. This output is compatible with `stats::density`. ```R library(distributional) library(dplyr) library(ggplot2) # For compatibility with existing code, the return type of density_unbounded() is# the same as stats::density(), ... set.seed(123) x = rbeta(5000, 1, 3) d = density_histogram(x) d ``` -------------------------------- ### Basic Vertical Eyes Plot Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/stat_slabinterval.html Generates a basic plot with vertical 'eyes' using stat_eye on sample data. This is a common starting point for visualizing distributions. ```R library(dplyr) library(ggplot2) library(distributional) theme_set(theme_ggdist()) # EXAMPLES ON SAMPLE DATA set.seed(1234) df = data.frame( group = c("a", "b", "c", "c", "c"), value = rnorm(2500, mean = c(5, 7, 9, 9, 9), sd = c(1, 1.5, 1, 1, 1)) ) # here are vertical eyes: df %>% ggplot(aes(x = group, y = value)) + stat_eye() ``` -------------------------------- ### subguide_none Source: https://github.com/mjskay/ggdist/blob/master/docs/reference/subguide_none.html A blank sub-guide that omits annotations for the thickness and dot-count sub-scales in ggdist. It can be used with the `subguide` parameter of `geom_slabinterval()` and `geom_dotsinterval()`. ```APIDOC ## subguide_none ### Description This is a blank sub-guide that omits annotations for the `thickness` and dot-count sub-scales in ggdist. It can be used with the `subguide` parameter of `[geom_slabinterval()](geom_slabinterval.html)` and `[geom_dotsinterval()](geom_dotsinterval.html)`. Supports [automatic partial function application](auto_partial.html) with [waived arguments](waiver.html). ### Usage ```r subguide_none(values, ...) ``` ### Arguments #### `values` <[numeric](https://rdrr.io/r/base/numeric.html)> Values used to construct the scale used for this guide. Typically provided automatically by `[geom_slabinterval()](geom_slabinterval.html)`. #### `...` Ignored. ### See Also Other sub-guides: `[subguide_axis](subguide_axis.html)()` ``` -------------------------------- ### Highlighting Sub-regions with stat_halfeye Source: https://github.com/mjskay/ggdist/blob/master/docs/articles/slabinterval.html Use the `fill` aesthetic with `after_stat` to highlight specific regions within a slab. This example highlights values where the absolute x-value is less than 1.5. ```R priors %>% ggplot(aes(y = format(dist), xdist = dist)) + stat_halfeye(aes(fill = after_stat(abs(x) < 1.5))) + ggtitle("stat_halfeye()", "aes(fill = after_stat(abs(x) < 1.5)))") + # we'll use a nicer palette than the default for highlighting: scale_fill_manual(values = c("gray85", "skyblue")) ```