<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content='Shortcut version of stat_slabinterval() with geom_pointinterval() for
creating point + multiple-interval plots.
Roughly equivalent to:
stat_slabinterval(
  geom = "pointinterval",
  show_slab = FALSE
)
'><title>Point + multiple-interval plot (shortcut stat) — stat_pointinterval • ggdist</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/Source_Sans_Pro-0.4.8/font.css" rel="stylesheet"><link href="../deps/Source_Code_Pro-0.4.8/font.css" rel="stylesheet"><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- bootstrap-toc --><script src="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@v1.0.1/dist/bootstrap-toc.min.js" integrity="sha256-4veVQbu7//Lk5TSmc7YV48MxtMy98e26cf5MrgZYnwo=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- search --><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Point + multiple-interval plot (shortcut stat) — stat_pointinterval"><meta property="og:description" content='Shortcut version of stat_slabinterval() with geom_pointinterval() for
creating point + multiple-interval plots.
Roughly equivalent to:
stat_slabinterval(
  geom = "pointinterval",
  show_slab = FALSE
)
'><meta property="og:image" content="http://mjskay.github.io/ggdist/logo.svg"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--><!-- Global site tag (gtag.js) - Google Analytics --><script async src="https://www.googletagmanager.com/gtag/js?id=UA-93322-5"></script><script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-93322-5');
</script></head><body>
    <a href="#main" class="visually-hidden-focusable">Skip to contents</a>
    

    <nav class="navbar fixed-top navbar-light navbar-expand-lg bg-light"><div class="container">
    
    <a class="navbar-brand me-2" href="../index.html">ggdist</a>

    <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.3.2</small>

    
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div id="navbar" class="collapse navbar-collapse ms-3">
      <ul class="navbar-nav me-auto"><li class="active nav-item">
  <a class="nav-link" href="../reference/index.html">Reference</a>
</li>
<li class="nav-item dropdown">
  <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true" id="dropdown-articles">Articles</a>
  <div class="dropdown-menu" aria-labelledby="dropdown-articles">
    <a class="dropdown-item" href="../articles/dotsinterval.html">Dots + interval stats and geoms</a>
    <a class="dropdown-item" href="../articles/freq-uncertainty-vis.html">Frequentist uncertainty visualization</a>
    <a class="dropdown-item" href="../articles/lineribbon.html">Lineribbon stats and geoms</a>
    <a class="dropdown-item" href="../articles/slabinterval.html">Slab + interval stats and geoms</a>
    <a class="dropdown-item" href="../articles/thickness.html">Thickness scale</a>
  </div>
</li>
<li class="nav-item">
  <a class="nav-link" href="../news/index.html">Changelog</a>
</li>
      </ul><form class="form-inline my-2 my-lg-0" role="search">
        <input type="search" class="form-control me-sm-2" aria-label="Toggle navigation" name="search-input" data-search-index="../search.json" id="search-input" placeholder="Search for" autocomplete="off"></form>

      <ul class="navbar-nav"><li class="nav-item">
  <a class="external-link nav-link" href="https://github.com/mjskay/ggdist/" aria-label="github">
    <span class="fab fa fab fa-github fa-lg"></span>
     
  </a>
</li>
      </ul></div>

    
  </div>
</nav><div class="container template-reference-topic">
<div class="row">
  <main id="main" class="col-md-9"><div class="page-header">
      <img src="../logo.svg" class="logo" alt=""><h1>Point + multiple-interval plot (shortcut stat)</h1>
      <small class="dont-index">Source: <a href="https://github.com/mjskay/ggdist/blob/HEAD/R/stat_pointinterval.R" class="external-link"><code>R/stat_pointinterval.R</code></a></small>
      <div class="d-none name"><code>stat_pointinterval.Rd</code></div>
    </div>

    <div class="ref-description section level2">
    <p>Shortcut version of <code><a href="stat_slabinterval.html">stat_slabinterval()</a></code> with <code><a href="geom_pointinterval.html">geom_pointinterval()</a></code> for
creating point + multiple-interval plots.</p>
<p><strong>Roughly equivalent to:</strong></p>
<div class="sourceCode"><pre><code><span><span class="fu"><a href="../reference/stat_slabinterval.html">stat_slabinterval</a></span><span class="op">(</span></span>
<span>  geom <span class="op">=</span> <span class="st">"pointinterval"</span>,</span>
<span>  show_slab <span class="op">=</span> <span class="cn">FALSE</span></span>
<span><span class="op">)</span></span></code></pre></div>

    </div>

    <div class="section level2">
    <h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">stat_pointinterval</span><span class="op">(</span></span>
<span>  mapping <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  data <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  geom <span class="op">=</span> <span class="st">"pointinterval"</span>,</span>
<span>  position <span class="op">=</span> <span class="st">"identity"</span>,</span>
<span>  <span class="va">...</span>,</span>
<span>  point_interval <span class="op">=</span> <span class="st">"median_qi"</span>,</span>
<span>  .width <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">0.66</span>, <span class="fl">0.95</span><span class="op">)</span>,</span>
<span>  orientation <span class="op">=</span> <span class="cn">NA</span>,</span>
<span>  na.rm <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  show.legend <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>size <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>,</span>
<span>  inherit.aes <span class="op">=</span> <span class="cn">TRUE</span></span>
<span><span class="op">)</span></span></code></pre></div>
    </div>

    <div class="section level2">
    <h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>
    <dl><dt>mapping</dt>
<dd><p>Set of aesthetic mappings created by <code><a href="https://ggplot2.tidyverse.org/reference/aes.html" class="external-link">aes()</a></code>. If specified and
<code>inherit.aes = TRUE</code> (the default), it is combined with the default mapping
at the top level of the plot. You must supply <code>mapping</code> if there is no plot
mapping.</p></dd>


<dt>data</dt>
<dd><p>The data to be displayed in this layer. There are three
options:</p>
<p>If <code>NULL</code>, the default, the data is inherited from the plot
data as specified in the call to <code><a href="https://ggplot2.tidyverse.org/reference/ggplot.html" class="external-link">ggplot()</a></code>.</p>
<p>A <code>data.frame</code>, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
<code><a href="https://ggplot2.tidyverse.org/reference/fortify.html" class="external-link">fortify()</a></code> for which variables will be created.</p>
<p>A <code>function</code> will be called with a single argument,
the plot data. The return value must be a <code>data.frame</code>, and
will be used as the layer data. A <code>function</code> can be created
from a <code>formula</code> (e.g. <code>~ head(.x, 10)</code>).</p></dd>


<dt>geom</dt>
<dd><p>Use to override the default connection between
<code>stat_pointinterval()</code> and <code><a href="geom_pointinterval.html">geom_pointinterval()</a></code></p></dd>


<dt>position</dt>
<dd><p>Position adjustment, either as a string, or the result of a call to a position adjustment function.
Setting this equal to <code>"dodge"</code> (<code><a href="https://ggplot2.tidyverse.org/reference/position_dodge.html" class="external-link">position_dodge()</a></code>) or <code>"dodgejust"</code> (<code><a href="position_dodgejust.html">position_dodgejust()</a></code>) can be useful if
you have overlapping geometries.</p></dd>


<dt>...</dt>
<dd><p>Other arguments passed to <code><a href="https://ggplot2.tidyverse.org/reference/layer.html" class="external-link">layer()</a></code>. These are often aesthetics, used to set an aesthetic
to a fixed value, like <code>colour = "red"</code> or <code>linewidth = 3</code> (see <strong>Aesthetics</strong>, below). They may also be
parameters to the paired geom/stat. When paired with the default geom, <code><a href="geom_pointinterval.html">geom_pointinterval()</a></code>,
these include:</p><dl><dt><code>interval_size_domain</code></dt>
<dd><p>A length-2 numeric vector giving the minimum and maximum of the values of the <code>size</code> and <code>linewidth</code> aesthetics
that will be translated into actual sizes for intervals drawn according to <code>interval_size_range</code> (see the
documentation for that argument.)</p></dd>

<dt><code>interval_size_range</code></dt>
<dd><p>A length-2 numeric vector. This geom scales the raw size aesthetic values when drawing interval and point
sizes, as they tend to be too thick when using the default settings of <code><a href="https://ggplot2.tidyverse.org/reference/scale_size.html" class="external-link">scale_size_continuous()</a></code>, which give
sizes with a range of <code>c(1, 6)</code>. The <code>interval_size_domain</code> value indicates the input domain of raw size
values (typically this should be equal to the value of the <code>range</code> argument of the <code><a href="https://ggplot2.tidyverse.org/reference/scale_size.html" class="external-link">scale_size_continuous()</a></code>
function), and <code>interval_size_range</code> indicates the desired output range of the size values (the min and max of
the actual sizes used to draw intervals). Most of the time it is not recommended to change the value of this
argument, as it may result in strange scaling of legends; this argument is a holdover from earlier versions
that did not have size aesthetics targeting the point and interval separately. If you want to adjust the
size of the interval or points separately, you can also use the <code>linewidth</code> or <code>point_size</code>
aesthetics; see <a href="sub-geometry-scales.html">sub-geometry-scales</a>.</p></dd>

<dt><code>fatten_point</code></dt>
<dd><p>A multiplicative factor used to adjust the size of the point relative to the size of the
thickest interval line. If you wish to specify point sizes directly, you can also use the <code>point_size</code>
aesthetic and <code><a href="sub-geometry-scales.html">scale_point_size_continuous()</a></code> or <code><a href="sub-geometry-scales.html">scale_point_size_discrete()</a></code>; sizes
specified with that aesthetic will not be adjusted using <code>fatten_point</code>.</p></dd>

<dt><code>arrow</code></dt>
<dd><p><code><a href="https://rdrr.io/r/grid/arrow.html" class="external-link">grid::arrow()</a></code> giving the arrow heads to use on the interval, or <code>NULL</code> for no arrows.</p></dd>


</dl></dd>


<dt>point_interval</dt>
<dd><p>A function from the <code><a href="point_interval.html">point_interval()</a></code> family (e.g., <code>median_qi</code>,
<code>mean_qi</code>, <code>mode_hdi</code>, etc), or a string giving the name of a function from that family
(e.g., <code>"median_qi"</code>, <code>"mean_qi"</code>, <code>"mode_hdi"</code>, etc; if a string, the caller's environment is searched
for the function, followed by the <span class="pkg">ggdist</span> environment). This function determines the point summary
(typically mean, median, or mode) and interval type (quantile interval, <code>qi</code>;
highest-density interval, <code>hdi</code>; or highest-density continuous interval, <code>hdci</code>). Output will
be converted to the appropriate <code>x</code>- or <code>y</code>-based aesthetics depending on the value of <code>orientation</code>.
See the <code><a href="point_interval.html">point_interval()</a></code> family of functions for more information.</p></dd>


<dt>.width</dt>
<dd><p>The <code>.width</code> argument passed to <code>point_interval</code>: a vector of probabilities to use
that determine the widths of the resulting intervals. If multiple probabilities are provided,
multiple intervals per group are generated, each with a different probability interval (and
value of the corresponding <code>.width</code> and <code>level</code> generated variables).</p></dd>


<dt>orientation</dt>
<dd><p>Whether this geom is drawn horizontally or vertically. One of:</p><ul><li><p><code>NA</code> (default): automatically detect the orientation based on how the aesthetics
are assigned. Automatic detection works most of the time.</p></li>
<li><p><code>"horizontal"</code> (or <code>"y"</code>): draw horizontally, using the <code>y</code> aesthetic to identify different
groups. For each group, uses the <code>x</code>, <code>xmin</code>, <code>xmax</code>, and <code>thickness</code> aesthetics to
draw points, intervals, and slabs.</p></li>
<li><p><code>"vertical"</code> (or <code>"x"</code>): draw vertically, using the <code>x</code> aesthetic to identify different
groups. For each group, uses the <code>y</code>, <code>ymin</code>, <code>ymax</code>, and <code>thickness</code> aesthetics to
draw points, intervals, and slabs.</p></li>
</ul><p>For compatibility with the base ggplot naming scheme for <code>orientation</code>, <code>"x"</code> can be used as an alias
for <code>"vertical"</code> and <code>"y"</code> as an alias for <code>"horizontal"</code> (<span class="pkg">ggdist</span> had an <code>orientation</code> parameter
before base ggplot did, hence the discrepancy).</p></dd>


<dt>na.rm</dt>
<dd><p>If <code>FALSE</code>, the default, missing values are removed with a warning. If <code>TRUE</code>, missing
values are silently removed.</p></dd>


<dt>show.legend</dt>
<dd><p>Should this layer be included in the legends? Default is <code>c(size = FALSE)</code>, unlike most geoms,
to match its common use cases. <code>FALSE</code> hides all legends, <code>TRUE</code> shows all legends, and <code>NA</code> shows only
those that are mapped (the default for most geoms).</p></dd>


<dt>inherit.aes</dt>
<dd><p>If <code>FALSE</code>, 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><a href="https://ggplot2.tidyverse.org/reference/borders.html" class="external-link">borders()</a></code>.</p></dd>

</dl></div>
    <div class="section level2">
    <h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
    

<p>A <a href="https://ggplot2.tidyverse.org/reference/ggplot2-ggproto.html" class="external-link">ggplot2::Stat</a> representing a point + multiple-interval geometry which can
be added to a <code><a href="https://ggplot2.tidyverse.org/reference/ggplot.html" class="external-link">ggplot()</a></code> object.</p>
    </div>
    <div class="section level2">
    <h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
    <p><strong>To visualize sample data</strong>, such as a data distribution, samples from a
bootstrap distribution, or a Bayesian posterior, you can supply samples to
the <code>x</code> or <code>y</code> aesthetic.</p>
<p><strong>To visualize analytical distributions</strong>, you can use the <code>xdist</code> or <code>ydist</code>
aesthetic. For historical reasons, you can also use <code>dist</code> to specify the distribution, though
this is not recommended as it does not work as well with orientation detection.
These aesthetics can be used as follows:</p><ul><li><p><code>xdist</code>, <code>ydist</code>, and <code>dist</code> can be any distribution object from the <a href="https://pkg.mitchelloharawild.com/distributional/" class="external-link">distributional</a>
package (<code><a href="https://pkg.mitchelloharawild.com/distributional/reference/dist_normal.html" class="external-link">dist_normal()</a></code>, <code><a href="https://pkg.mitchelloharawild.com/distributional/reference/dist_beta.html" class="external-link">dist_beta()</a></code>, etc) or can be a <code><a href="https://mc-stan.org/posterior/reference/rvar.html" class="external-link">posterior::rvar()</a></code> object.
Since these functions are vectorized,
other columns can be passed directly to them in an <code><a href="https://ggplot2.tidyverse.org/reference/aes.html" class="external-link">aes()</a></code> specification; e.g.
<code>aes(dist = dist_normal(mu, sigma))</code> will work if <code>mu</code> and <code>sigma</code> are columns in the
input data frame.</p></li>
<li><p><code>dist</code> can be a character vector giving the distribution name. Then the  <code>arg1</code>, ... <code>arg9</code>
aesthetics (or <code>args</code> as a list column) specify distribution arguments. Distribution names
should correspond to R functions that have <code>"p"</code>, <code>"q"</code>, and <code>"d"</code> functions; e.g. <code>"norm"</code>
is a valid distribution name because R defines the <code><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">pnorm()</a></code>, <code><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">qnorm()</a></code>, and <code><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">dnorm()</a></code>
functions for Normal distributions.</p>
<p>See the <code><a href="parse_dist.html">parse_dist()</a></code> function for a useful way to generate <code>dist</code> and <code>args</code>
values from human-readable distribution specs (like <code>"normal(0,1)"</code>). Such specs are also
produced by other packages (like the <code><a href="https://paul-buerkner.github.io/brms/reference/get_prior.html" class="external-link">brms::get_prior</a></code> function in brms); thus,
<code><a href="parse_dist.html">parse_dist()</a></code> combined with the stats described here can help you visualize the output
of those functions.</p></li>
</ul></div>
    <div class="section level2">
    <h2 id="computed-variables">Computed Variables<a class="anchor" aria-label="anchor" href="#computed-variables"></a></h2>
    

<p>The following variables are computed by this stat and made available for
use in aesthetic specifications (<code><a href="https://ggplot2.tidyverse.org/reference/aes.html" class="external-link">aes()</a></code>) using the <code><a href="https://ggplot2.tidyverse.org/reference/aes_eval.html" class="external-link">after_stat()</a></code>
function or the <code>after_stat</code> argument of <code><a href="https://ggplot2.tidyverse.org/reference/aes_eval.html" class="external-link">stage()</a></code>:</p><ul><li><p><code>x</code> or <code>y</code>: For slabs, the input values to the slab function.
For intervals, the point summary from the interval function. Whether it is <code>x</code> or <code>y</code> depends on <code>orientation</code></p></li>
<li><p><code>xmin</code> or <code>ymin</code>: For intervals, the lower end of the interval from the interval function.</p></li>
<li><p><code>xmax</code> or <code>ymax</code>: For intervals, the upper end of the interval from the interval function.</p></li>
<li><p><code>.width</code>: For intervals, the interval width as a numeric value in <code>[0, 1]</code>.
For slabs, the width of the smallest interval containing that value of the slab.</p></li>
<li><p><code>level</code>: For intervals, the interval width as an ordered factor.
For slabs, the level of the smallest interval containing that value of the slab.</p></li>
<li><p><code>pdf</code>: For slabs, the probability density function (PDF).
If <code>options("ggdist.experimental.slab_data_in_intervals")</code> is <code>TRUE</code>:
For intervals, the PDF at the point summary; intervals also have <code>pdf_min</code> and <code>pdf_max</code>
for the PDF at the lower and upper ends of the interval.</p></li>
<li><p><code>cdf</code>: For slabs, the cumulative distribution function.
If <code>options("ggdist.experimental.slab_data_in_intervals")</code> is <code>TRUE</code>:
For intervals, the CDF at the point summary; intervals also have <code>cdf_min</code> and <code>cdf_max</code>
for the CDF at the lower and upper ends of the interval.</p></li>
</ul></div>
    <div class="section level2">
    <h2 id="aesthetics">Aesthetics<a class="anchor" aria-label="anchor" href="#aesthetics"></a></h2>
    

<p>The slab+interval <code>stat</code>s and <code>geom</code>s have a wide variety of aesthetics that control
the appearance of their three sub-geometries: the <strong>slab</strong>, the <strong>point</strong>, and
the <strong>interval</strong>.</p>
<p>These <code>stat</code>s support the following aesthetics:</p>
<ul><li><p><code>x</code>: x position of the geometry (when orientation = <code>"vertical"</code>); or sample data to be summarized
(when <code>orientation = "horizontal"</code> with sample data).</p></li>
<li><p><code>y</code>: y position of the geometry (when orientation = <code>"horizontal"</code>); or sample data to be summarized
(when <code>orientation = "vertical"</code> with sample data).</p></li>
<li><p><code>weight</code>: When using samples (i.e. the <code>x</code> and <code>y</code> aesthetics, not <code>xdist</code> or <code>ydist</code>), optional
weights to be applied to each draw.</p></li>
<li><p><code>xdist</code>: When using analytical distributions, distribution to map on the x axis: a <span class="pkg">distributional</span>
object (e.g. <code><a href="https://pkg.mitchelloharawild.com/distributional/reference/dist_normal.html" class="external-link">dist_normal()</a></code>) or a <code><a href="https://mc-stan.org/posterior/reference/rvar.html" class="external-link">posterior::rvar()</a></code> object.</p></li>
<li><p><code>ydist</code>: When using analytical distributions, distribution to map on the y axis: a <span class="pkg">distributional</span>
object (e.g. <code><a href="https://pkg.mitchelloharawild.com/distributional/reference/dist_normal.html" class="external-link">dist_normal()</a></code>) or a <code><a href="https://mc-stan.org/posterior/reference/rvar.html" class="external-link">posterior::rvar()</a></code> object.</p></li>
<li><p><code>dist</code>: When using analytical distributions, a name of a distribution (e.g. <code>"norm"</code>), a
<span class="pkg">distributional</span> object (e.g. <code><a href="https://pkg.mitchelloharawild.com/distributional/reference/dist_normal.html" class="external-link">dist_normal()</a></code>), or a <code><a href="https://mc-stan.org/posterior/reference/rvar.html" class="external-link">posterior::rvar()</a></code> object. See <strong>Details</strong>.</p></li>
<li><p><code>args</code>: Distribution arguments (<code>args</code> or <code>arg1</code>, ... <code>arg9</code>). See <strong>Details</strong>.</p></li>
</ul><p>In addition, in their default configuration (paired with <code><a href="geom_pointinterval.html">geom_pointinterval()</a></code>)
the following aesthetics are supported by the underlying geom:</p>
<p><strong>Interval-specific aesthetics</strong></p>
<ul><li><p><code>xmin</code>: Left end of the interval sub-geometry (if <code>orientation = "horizontal"</code>).</p></li>
<li><p><code>xmax</code>: Right end of the interval sub-geometry (if <code>orientation = "horizontal"</code>).</p></li>
<li><p><code>ymin</code>: Lower end of the interval sub-geometry (if <code>orientation = "vertical"</code>).</p></li>
<li><p><code>ymax</code>: Upper end of the interval sub-geometry (if <code>orientation = "vertical"</code>).</p></li>
</ul><p><strong>Point-specific aesthetics</strong></p>
<ul><li><p><code>shape</code>: Shape type used to draw the <strong>point</strong> sub-geometry.</p></li>
</ul><p><strong>Color aesthetics</strong></p>
<ul><li><p><code>colour</code>: (or <code>color</code>) The color of the <strong>interval</strong> and <strong>point</strong> sub-geometries.
Use the <code>slab_color</code>, <code>interval_color</code>, or <code>point_color</code> aesthetics (below) to
set sub-geometry colors separately.</p></li>
<li><p><code>fill</code>: The fill color of the <strong>slab</strong> and <strong>point</strong> sub-geometries. Use the <code>slab_fill</code>
or <code>point_fill</code> aesthetics (below) to set sub-geometry colors separately.</p></li>
<li><p><code>alpha</code>: The opacity of the <strong>slab</strong>, <strong>interval</strong>, and <strong>point</strong> sub-geometries. Use the <code>slab_alpha</code>,
<code>interval_alpha</code>, or <code>point_alpha</code> aesthetics (below) to set sub-geometry colors separately.</p></li>
<li><p><code>colour_ramp</code>: (or <code>color_ramp</code>) A secondary scale that modifies the <code>color</code>
scale to "ramp" to another color. See <code><a href="scale_colour_ramp.html">scale_colour_ramp()</a></code> for examples.</p></li>
<li><p><code>fill_ramp</code>: A secondary scale that modifies the <code>fill</code>
scale to "ramp" to another color. See <code><a href="scale_colour_ramp.html">scale_fill_ramp()</a></code> for examples.</p></li>
</ul><p><strong>Line aesthetics</strong></p>
<ul><li><p><code>linewidth</code>: Width of the line used to draw the <strong>interval</strong> (except with <code><a href="geom_slab.html">geom_slab()</a></code>: then
it is the width of the <strong>slab</strong>). With composite geometries including an interval and slab,
use <code>slab_linewidth</code> to set the line width of the <strong>slab</strong> (see below). For <strong>interval</strong>, raw
<code>linewidth</code> values are transformed according to the <code>interval_size_domain</code> and <code>interval_size_range</code>
parameters of the <code>geom</code> (see above).</p></li>
<li><p><code>size</code>: Determines the size of the <strong>point</strong>. If <code>linewidth</code> is not provided, <code>size</code> will
also determines the width of the line used to draw the <strong>interval</strong> (this allows line width and
point size to be modified together by setting only <code>size</code> and not <code>linewidth</code>). Raw
<code>size</code> values are transformed according to the <code>interval_size_domain</code>, <code>interval_size_range</code>,
and <code>fatten_point</code> parameters of the <code>geom</code> (see above). Use the <code>point_size</code> aesthetic
(below) to set sub-geometry size directly without applying the effects of
<code>interval_size_domain</code>, <code>interval_size_range</code>, and <code>fatten_point</code>.</p></li>
<li><p><code>stroke</code>: Width of the outline around the <strong>point</strong> sub-geometry.</p></li>
<li><p><code>linetype</code>: Type of line (e.g., <code>"solid"</code>, <code>"dashed"</code>, etc) used to draw the <strong>interval</strong>
and the outline of the <strong>slab</strong> (if it is visible). Use the <code>slab_linetype</code> or
<code>interval_linetype</code> aesthetics (below) to set sub-geometry line types separately.</p></li>
</ul><p><strong>Interval-specific color and line override aesthetics</strong></p>
<ul><li><p><code>interval_colour</code>: (or <code>interval_color</code>) Override for <code>colour</code>/<code>color</code>: the color of the interval.</p></li>
<li><p><code>interval_alpha</code>: Override for <code>alpha</code>: the opacity of the interval.</p></li>
<li><p><code>interval_linetype</code>: Override for <code>linetype</code>: the line type of the interval.</p></li>
</ul><p><strong>Point-specific color and line override aesthetics</strong></p>
<ul><li><p><code>point_fill</code>: Override for <code>fill</code>: the fill color of the point.</p></li>
<li><p><code>point_colour</code>: (or <code>point_color</code>) Override for <code>colour</code>/<code>color</code>: the outline color of the point.</p></li>
<li><p><code>point_alpha</code>: Override for <code>alpha</code>: the opacity of the point.</p></li>
<li><p><code>point_size</code>: Override for <code>size</code>: the size of the point.</p></li>
</ul><p><strong>Deprecated aesthetics</strong></p>
<ul><li><p><code>interval_size</code>: Use <code>interval_linewidth</code>.</p></li>
</ul><p><strong>Other aesthetics</strong> (these work as in standard <code>geom</code>s)</p>
<ul><li><p><code>width</code></p></li>
<li><p><code>height</code></p></li>
<li><p><code>group</code></p></li>
</ul><p>See examples of some of these aesthetics in action in <code><a href="../articles/slabinterval.html">vignette("slabinterval")</a></code>.
Learn more about the sub-geom override aesthetics (like <code>interval_color</code>) in the
<a href="sub-geometry-scales.html">scales</a> documentation. Learn more about basic ggplot aesthetics in
<code><a href="https://ggplot2.tidyverse.org/articles/ggplot2-specs.html" class="external-link">vignette("ggplot2-specs")</a></code>.</p>
    </div>
    <div class="section level2">
    <h2 id="see-also">See also<a class="anchor" aria-label="anchor" href="#see-also"></a></h2>
    <div class="dont-index"><p>See <code><a href="geom_pointinterval.html">geom_pointinterval()</a></code> for the geom underlying this stat.
See <code><a href="stat_slabinterval.html">stat_slabinterval()</a></code> for the stat this shortcut is based on.</p>
<p>Other slabinterval stats: 
<code><a href="stat_ccdfinterval.html">stat_ccdfinterval</a>()</code>,
<code><a href="stat_cdfinterval.html">stat_cdfinterval</a>()</code>,
<code><a href="stat_eye.html">stat_eye</a>()</code>,
<code><a href="stat_gradientinterval.html">stat_gradientinterval</a>()</code>,
<code><a href="stat_halfeye.html">stat_halfeye</a>()</code>,
<code><a href="stat_histinterval.html">stat_histinterval</a>()</code>,
<code><a href="stat_interval.html">stat_interval</a>()</code>,
<code><a href="stat_slab.html">stat_slab</a>()</code>,
<code><a href="stat_spike.html">stat_spike</a>()</code></p></div>
    </div>

    <div class="section level2">
    <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org" class="external-link">dplyr</a></span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://ggplot2.tidyverse.org" class="external-link">ggplot2</a></span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://pkg.mitchelloharawild.com/distributional/" class="external-link">distributional</a></span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/theme_get.html" class="external-link">theme_set</a></span><span class="op">(</span><span class="fu"><a href="theme_ggdist.html">theme_ggdist</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># ON SAMPLE DATA</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/Random.html" class="external-link">set.seed</a></span><span class="op">(</span><span class="fl">1234</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">df</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span></span></span>
<span class="r-in"><span>  group <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"a"</span>, <span class="st">"b"</span>, <span class="st">"c"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span>  value <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">1500</span>, mean <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">5</span>, <span class="fl">7</span>, <span class="fl">9</span><span class="op">)</span>, sd <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">1</span>, <span class="fl">1.5</span>, <span class="fl">1</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">df</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>
<span class="r-in"><span>  <span class="fu"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html" class="external-link">ggplot</a></span><span class="op">(</span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/aes.html" class="external-link">aes</a></span><span class="op">(</span>x <span class="op">=</span> <span class="va">value</span>, y <span class="op">=</span> <span class="va">group</span><span class="op">)</span><span class="op">)</span> <span class="op">+</span></span></span>
<span class="r-in"><span>  <span class="fu">stat_pointinterval</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="stat_pointinterval-1.png" alt="" width="700" height="433"></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># ON ANALYTICAL DISTRIBUTIONS</span></span></span>
<span class="r-in"><span><span class="va">dist_df</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span></span></span>
<span class="r-in"><span>  group <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"a"</span>, <span class="st">"b"</span>, <span class="st">"c"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span>  mean <span class="op">=</span>  <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>  <span class="fl">5</span>,   <span class="fl">7</span>,   <span class="fl">8</span><span class="op">)</span>,</span></span>
<span class="r-in"><span>  sd <span class="op">=</span>    <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>  <span class="fl">1</span>, <span class="fl">1.5</span>,   <span class="fl">1</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="co"># Vectorized distribution types, like distributional::dist_normal()</span></span></span>
<span class="r-in"><span><span class="co"># and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics</span></span></span>
<span class="r-in"><span><span class="va">dist_df</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>
<span class="r-in"><span>  <span class="fu"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html" class="external-link">ggplot</a></span><span class="op">(</span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/aes.html" class="external-link">aes</a></span><span class="op">(</span>y <span class="op">=</span> <span class="va">group</span>, xdist <span class="op">=</span> <span class="fu"><a href="https://pkg.mitchelloharawild.com/distributional/reference/dist_normal.html" class="external-link">dist_normal</a></span><span class="op">(</span><span class="va">mean</span>, <span class="va">sd</span><span class="op">)</span><span class="op">)</span><span class="op">)</span> <span class="op">+</span></span></span>
<span class="r-in"><span>  <span class="fu">stat_pointinterval</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="stat_pointinterval-2.png" alt="" width="700" height="433"></span>
</code></pre></div>
    </div>
  </main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
    </nav></aside></div>


    <footer><div class="pkgdown-footer-left">
  <p></p><p>Developed by <a href="https://www.mjskay.com" class="external-link">Matthew Kay</a>.</p>
</div>

<div class="pkgdown-footer-right">
  <p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.7.</p>
</div>

    </footer></div>

  

  

  </body></html>

