geom_bracket | R Documentation |
Add brackets with labeled annotations to a ggplot.
geom_bracket(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
arrow = NULL,
parse = FALSE,
bracket = TRUE,
inherit.aes = TRUE
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
... |
additional arguments passed on to layer(). |
arrow |
|
parse |
|
bracket |
|
inherit.aes |
If |
LayerInstance
, a layer that can be added to a ggplot.
required: xmin
, xmax
, ymin
, ymax
, label
optional: angle
, alpha
, hjust
, vjust
, colour
, family
, fontsize
, fontface
, linetype
, linewidth
, lineheight
HMU-WH
library(ggplot2)
ggplot(mpg, aes(class, displ)) +
geom_boxplot() +
annotate("bracket", xmin = 2, xmax = 4, ymin = 4.5, ymax = 5, label = "label",
arrow = grid::arrow(type = "closed", length = unit(0.1, "inches")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.