sf_set_inter | R Documentation |
These functions can be used to change the font of all text elements in any themes. Additionally, all font weights (or faces) of the given theme will be set appropriately to ensure readability, e.g., setting title font to be bold.
sf_set_inter(ret) sf_set_sf_pro(ret) sf_set_custom_font(ret, font_family_name)
ret |
A |
font_family_name |
The name of the font |
Due to limitation of extrafont
and the format of SF Pro, sf_set_sf_pro()
is not yet available, and SF Pro does not work as expected.
## Not run: library(ggplot2) ggplot(mtcars) + geom_point(aes(x = wt, y = mpg, colour = factor(gear))) + labs(title = "Fuel Economy", subtitle = "Fuel economy declines as weight increases, 1973-74", caption = "Data from the 1974 Motor Trend US magazine.", x = "Weight (1000 lbs)", y = "MPG", colour = "Gears") + facet_grid(vs ~ am) + sf_set_inter(theme_linedraw()) + scale_colour_ios_light() ## End(Not run) ## Not run: library(ggplot2) ggplot(mtcars) + geom_point(aes(x = wt, y = mpg, colour = factor(gear))) + labs(title = "Fuel Economy", subtitle = "Fuel economy declines as weight increases, 1973-74", caption = "Data from the 1974 Motor Trend US magazine.", x = "Weight (1000 lbs)", y = "MPG", colour = "Gears") + facet_grid(vs ~ am) + sf_set_custom_font(theme_linedraw(), "Gill Sans") + scale_colour_ios_light() ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.