View source: R/theme_helpers.R
fix_bold | R Documentation |
Formatted math text ignores the face
argument of
element_text()
and is only styled in bold if the
plotmath
function bold()
is used. To work around that
limitation for the various titles in the plot, this function applies the font
family that is one step "more bold" to the titles.
fix_bold(font = "Roboto Regular", symbol = TRUE)
font |
Font family that was used in |
symbol |
Should the theme overwrite the system default Symbol font with
the theme default font? If |
The required font will be added to the current R session's font registry if
is had not been already (see
registry_fonts()
). The required font
must be included with the theme.
A list containing the theme properties.
library(ggplot2)
df <- data.frame(x = 1:5, y = 1:5, z = c("a", "b", "c", "b", "c"))
p <- ggplot(df, aes(x, y, color = z)) +
geom_point() +
labs(
x = bquote(Delta ~ log[10]("Parameter")),
y = "Y-Axis Label",
color = "Legend",
subtitle = "Subtitle Text",
caption = "Caption Text",
tag = "A",
title = bquote(alpha ~ "Regular Text" ~ 1/3)
)
## Not run:
p + theme_cr() # Uses default scaling and font
p + theme_cr(font = "Roboto Medium") # Bolder font
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.