annotate_quo | R Documentation |
A wrapper for ggplot2::annotate()
that sets the font to Lato.
annotate_quo(
geom,
x = NULL,
y = NULL,
xmin = NULL,
xmax = NULL,
ymin = NULL,
ymax = NULL,
xend = NULL,
yend = NULL,
family = "Lato",
...,
na.rm = FALSE
)
geom |
name of geom to use for annotation |
x , y , xmin , ymin , xmax , ymax , xend , yend |
positioning aesthetics - you must specify at least one of these. |
family |
Font family to use. Defaults to |
... |
Other arguments passed on to
|
na.rm |
If |
library(ggplot2)
library(showtext)
font_add_google("Lato", "Lato")
showtext_auto()
# workaround for https://github.com/yixuan/showtext/issues/51
showtext_opts(dpi = 192)
ggplot(mpg, aes(displ, hwy)) +
geom_point() +
geom_rlm(method = "loess") +
annotate_quo(
"label",
x = 5.5, y = 30,
label = "hwy increases for displ greater than 5.5"
) +
theme_quo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.