| Title: | Additional Themes, Theme Components and Utilities for 'ggplot2' |
|---|---|
| Description: | A compilation of extra 'ggplot2' themes, scales and utilities, including a spell check function for plot label fields and an overall emphasis on typography. Copies of the 'Google' font 'Roboto Condensed' and the 'Vercel' font 'Geist' are also included. |
| Authors: | Bob Rudis [aut, cre] (ORCID: <https://orcid.org/0000-0001-5670-2640>), Patrick Kennedy [ctb], Philipp Reiner [ctb], Dan Wilson [ctb] (Secondary axis support), Xavier Adam [ctb], Google [cph] (Roboto Condensed), IBM [cph] (Plex Sans Font), Goldman Sachs [cph] (Goldman Sans Font), Impallari Type [cph] (Public Sans Font), Jacob Barnett [ctb], Thomas J. Leeper [ctb] (ORCID: <https://orcid.org/0000-0003-4097-6326>), Joris Meys [ctb], Steph Ango [ctb] (Flexoki creator), Vercel, Inc. [cph] (Geist Font) |
| Maintainer: | Bob Rudis <bob@rud.is> |
| License: | MIT + file LICENSE |
| Version: | 0.9.5 |
| Built: | 2026-10-17 05:01:58 UTC |
| Source: | https://github.com/hrbrmstr/hrbrthemes |
A vector of 12 colors in the Bit12 color scheme
bit12bit12
A named character vector of hex color codes
A list of 12 color palettes, each containing 9 shades for continuous color interpolation
bit12_extendedbit12_extended
A list of character vectors containing hex color codes
Color palettes and scales based on the Bit12 color scheme, a vibrant 12-color system designed for clear data visualization. The palette offers a complete spectrum of distinct colors that work well for categorical data while maintaining good contrast and accessibility.
scale_color_bit12(...) scale_fill_bit12(...) scale_color_bit12_continuous(palette = "azure", ...) scale_fill_bit12_continuous(palette = "azure", ...) scale_color_bit12_distiller(palette = "azure", direction = 1, ...) scale_fill_bit12_distiller(palette = "azure", direction = 1, ...) scale_color_bit12_spectrum(direction = 1, ...) scale_fill_bit12_spectrum(direction = 1, ...)scale_color_bit12(...) scale_fill_bit12(...) scale_color_bit12_continuous(palette = "azure", ...) scale_fill_bit12_continuous(palette = "azure", ...) scale_color_bit12_distiller(palette = "azure", direction = 1, ...) scale_fill_bit12_distiller(palette = "azure", direction = 1, ...) scale_color_bit12_spectrum(direction = 1, ...) scale_fill_bit12_spectrum(direction = 1, ...)
... |
Additional arguments passed to scale_color_manual(), scale_fill_manual(), scale_color_gradientn(), or scale_fill_gradientn() |
palette |
For continuous scales, the name of the color palette to use (one of "plum", "rose", "coral", "apricot", "lemon", "lime", "mint", "teal", "sky", "azure", "cobalt", "violet") |
direction |
Sets the direction of the color scale (1 = default, -1 = reversed) |
The package provides several types of scales:
Discrete scales for categorical data
Continuous scales with extended color ramps
The color palette includes:
Plum: Deep purple for emphasis
Rose: Rich pink-red for highlighting important elements
Coral: Soft reddish-orange for warm secondary elements
Apricot: Muted orange for highlighting
Lemon: Bright yellow for high visibility elements
Lime: Fresh green for positive values and growth
Mint: Cool green-blue for calm elements
Teal: Balanced blue-green for neutral data
Sky: Light blue for information elements
Azure: Clear blue for primary interactions
Cobalt: Deep blue for stability and reliability
Violet: Purple for creative and distinctive elements
A ggplot2 scale object
library(ggplot2) # Discrete color scale ggplot(mpg, aes(class, fill = class)) + geom_bar() + scale_fill_bit12() # Continuous color scale ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_bit12_continuous(palette = "azure")library(ggplot2) # Discrete color scale ggplot(mpg, aes(class, fill = class)) + geom_bar() + scale_fill_bit12() # Continuous color scale ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_bit12_continuous(palette = "azure")
Color palettes and scales based on the Flexoki color scheme, a warm and soft color system designed by Steph Ango. Flexoki emphasizes readability and natural color harmony, making it particularly suitable for data visualization and long-form reading. The palette includes both light and dark variants, with each offering 8 distinct colors.
The name "Flexoki" combines "flexible" and "karaoke", reflecting its adaptable nature and harmonious color relationships.
... |
Additional arguments passed to scale_color_manual() or scale_fill_manual() |
palette |
For continuous scales, the name of the color palette to use (one of "red", "orange", "yellow", "green", "cyan", "blue", "purple", "magenta") |
The package provides several types of scales:
Discrete scales for both light and dark variants
Continuous scales with extended color ramps
The color palette includes:
Red: For emphasis and warnings
Orange: For secondary emphasis
Yellow: For highlighting
Green: For success states and nature-related data
Cyan: For information and water-related data
Blue: For primary elements and cool tones
Purple: For luxury and depth
Magenta: For creative and feminine contexts
A ggplot2 scale object
Flexoki Color System: https://stephango.com/flexoki
library(ggplot2) # Discrete color scale (light variant) ggplot(mpg, aes(class, fill = class)) + geom_bar() + scale_fill_flexoki_light() # Continuous color scale ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_continuous(palette = "blue")library(ggplot2) # Discrete color scale (light variant) ggplot(mpg, aes(class, fill = class)) + geom_bar() + scale_fill_flexoki_light() # Continuous color scale ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_continuous(palette = "blue")
A vector of 8 colors in the dark variant of the Flexoki color scheme
flexoki_darkflexoki_dark
A named character vector of hex color codes
A list of 8 color palettes, each containing 13 shades for continuous color interpolation
flexoki_extendedflexoki_extended
A list of character vectors containing hex color codes
A vector of 8 colors in the light variant of the Flexoki color scheme
flexoki_lightflexoki_light
A named character vector of hex color codes
A covenience function intended for basic, fixed-scale plots only (i.e. does not handle
free scales in facets).
You need to pass in a ggplot2 object to this function. It can't be +'d in a chain
of geoms, coords, scales, themes, etc. It also builds the plot (but does not display
it) so if the plt takes a while (i.e. has lots of data or transforms) this will also
take a while.
flush_ticks(gg, flush = "XY", plot = TRUE, cat = TRUE)flush_ticks(gg, flush = "XY", plot = TRUE, cat = TRUE)
gg |
ggplot2 plot object |
flush |
either " |
plot |
if |
cat |
if |
ggplot2 object with theme() elements added
Intended for basic, fixed-scale plots only (i.e. does not handle free scales in facets).
font_an == "Arial Narrow"
font_anfont_an
length 1 character vector
font_ar == "Archivo SemiCondensed"
font_ar_bold == "Archivo SemiCondensed Bold"
font_ar_italic == "Archivo SemiCondensed Italic"
font_ar_sb == "Archivo SemiCondensed SemiBold"
font_ar_sb_italic == "Archivo SemiCondensed SemiBold Italic"
font_ar font_ar_bold font_ar_italic font_ar_sb font_ar_sb_italicfont_ar font_ar_bold font_ar_italic font_ar_sb font_ar_sb_italic
length 1 character vector
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
font_es == "EconSansCndLig"
font_es_bold == "EconSansCndBol"
font_es_light == "EconSansCndLig"
font_es font_es_bold font_es_lightfont_es font_es_bold font_es_light
length 1 character vector
An object of class character of length 1.
An object of class character of length 1.
font_es_bold (a.k.a. "EconSansCndBol") is not available on
Windows and will throw a warning if used in plots.
font_es_light (a.k.a. "EconSansCndLig") is not available on
Windows and will throw a warning if used in plots.
font_geist == "Geist"
font_geist_bold == "Geist Bold"
font_geist_italic == "Geist Italic"
font_geist_medium == "Geist Medium"
font_geist_medium_italic == "Geist Medium Italic"
font_geist_semibold == "Geist SemiBold"
font_geist font_geist_bold font_geist_italic font_geist_medium font_geist_medium_italic font_geist_semiboldfont_geist font_geist_bold font_geist_italic font_geist_medium font_geist_medium_italic font_geist_semibold
length 1 character vector
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
font_gs == "Goldman Sans Condensed"
font_gsfont_gs
length 1 character vector
font_inter_thin == "Inter-Thin"
font_inter_thin_italic == "Inter-ThinItalic"
font_inter_medium == "Inter-Medium"
font_inter_medium_italic == "Inter-MediumItalic"
font_inter_semibold == "Inter-SemiBold"
font_inter_bold == "Inter-Bold"
font_inter_italic == "Inter-Italic"
font_inter_thin font_inter_thin_italic font_inter_medium font_inter_medium_italic font_inter_semibold font_inter_bold font_inter_italicfont_inter_thin font_inter_thin_italic font_inter_medium font_inter_medium_italic font_inter_semibold font_inter_bold font_inter_italic
length 1 character vector
length 1 character vector
length 1 character vector
length 1 character vector
length 1 character vector
length 1 character vector
length 1 character vector
font_ps == "IBMPlexSans"
font_ps_light == "IBMPlexSans-Light"
font_ps font_ps_lightfont_ps font_ps_light
length 1 character vector
An object of class character of length 1.
font_ps_light (a.k.a. "IBMPlexSans-Light") is not available on
Windows and will throw a warning if used in plots.
font_pub == "Public Sans"
font_pub_bold == "Public Sans Bold"
font_pub_light == "Public Sans Light"
font_pub_thin == "Public Sans Thin"
font_pub font_pub_bold font_pub_light font_pub_thinfont_pub font_pub_bold font_pub_light font_pub_thin
length 1 character vector
An object of class character of length 1.
An object of class character of length 1.
An object of class character of length 1.
font_pub_bold (a.k.a. "Public Sans Bold") is not available on
Windows and will throw a warning if used in plots.
font_rc == "Roboto Condensed"
font_fc_light == "Roboto Condensed Light"
font_rc font_rc_lightfont_rc font_rc_light
length 1 character vector
An object of class character of length 1.
font_rc_light (a.k.a. "Roboto Condensed Light") is not available on
Windows and will throw a warning if used in plots.
FT color palette
ft_cols ft_text_colft_cols ft_text_col
An object of class list of length 9.
An object of class character of length 1.
don't forget you can use scales::alpha() with these colors
Change geom defaults from black to custom lights for the FT theme
ft_geom_defaults()ft_geom_defaults()
A bright qualitative color palette
ft_pal()ft_pal()
library(scales) scales::show_col(ft_pal()(8))library(scales) scales::show_col(ft_pal()(8))
Due to the way ggplot2 objects are created, this has to be used in a standalone context.
gg_check(gg, dict, ignore)gg_check(gg, dict, ignore)
gg |
ggplot2 object |
dict |
a dictionary object or string which can be passed to hunspell::dictionary.
Defaults to |
ignore |
character vector with additional approved words added to the dictionary.
Defaults to |
Current functionality only looks for misspelled words in the labels of ggplot2 objects. When misspelled words are found, a message is printed with the words and the label that they are in. No messages will be printed if there are no misspelled words.
the object that was passed in
library(ggplot2) df <- data.frame(x=c(20, 25, 30), y=c(4, 4, 4), txt=c("One", "Two", "Three")) # not piping ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="This is some txt", y="This is more text", title="Thisy is a titlle", subtitle="This is a subtitley", caption="This is a captien") -> gg gg_check(gg)library(ggplot2) df <- data.frame(x=c(20, 25, 30), y=c(4, 4, 4), txt=c("One", "Two", "Three")) # not piping ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="This is some txt", y="This is more text", title="Thisy is a titlle", subtitle="This is a subtitley", caption="This is a captien") -> gg gg_check(gg)
The following functions are imported and then re-exported from the hrbrthemes package to enable use of the magrittr pipe operator with no additional library calls
Takes a numeric value or a difftime object and converts it into a
natural language string (e.g., "2 hours and 15 minutes").
humanize_duration(x, units_max = 2L)humanize_duration(x, units_max = 2L)
x |
A numeric vector or |
units_max |
Integer. The maximum number of time units to display.
For example, if |
The function breaks down the total seconds into years, days, hours, minutes, and seconds, pluralizing units where necessary and applying English grammar rules (including the Oxford comma) for joining multiple units.
A character vector of the same length as x.
# Basic usage with numeric seconds; units_max defaults to 2 humanize_duration(3661) # "1 hour and 1 minute" humanize_duration(3661, units_max = 3) # "1 hour, 1 minute, and 1 second" # Usage with difftime time_diff <- as.difftime(86400 * 2 + 3600, units = "secs") humanize_duration(time_diff) # "2 days and 1 hour" # Handling edge cases humanize_duration(c(0, NA)) # "0 seconds" NA# Basic usage with numeric seconds; units_max defaults to 2 humanize_duration(3661) # "1 hour and 1 minute" humanize_duration(3661, units_max = 3) # "1 hour, 1 minute, and 1 second" # Usage with difftime time_diff <- as.difftime(86400 * 2 + 3600, units = "secs") humanize_duration(time_diff) # "2 days and 1 hour" # Handling edge cases humanize_duration(c(0, NA)) # "0 seconds" NA
Archivo is a grotesque font reminiscent of late nineteenth century. It is copyright 2019 Omnibus-Type and is licensed under the SIL Open Font License, 1.1;
import_archivo()import_archivo()
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
Roboto Condensed is a trademark of Google.
import_econ_sans()import_econ_sans()
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
Geist is Copyright (c) 2023 Vercel, Inc. and is licensed under the SIL Open
Font License, 1.1. It is the first family in omp's chart font stack and the
default for theme_tern().
import_geist()import_geist()
The package ships Geist TTFs in inst/fonts/geist; install them on your
system before using theme_tern().
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
Goldman Sans is a trademark of Goldman Sachs and distributed under the Goldman Sachs Restricted Font License
import_goldman_sans()import_goldman_sans()
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
Inter is Copyright (c) 2016-2024 The Inter Project Authors
import_inter()import_inter()
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
IBM Plex Sans is a trademark of IBM and distributed under the SIL Open Font License, Version 1.1.
import_plex_sans()import_plex_sans()
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
Public Sans is Copyright 2015 Impallari Type and licensed under the SIL Open Font License, Version 1.1
import_public_sans()import_public_sans()
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
Roboto Condensed is a trademark of Google.
import_roboto_condensed()import_roboto_condensed()
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
This will take care of ensuring PDF/PostScript usage. The location of the font directory is displayed after the base import is complete. It is highly recommended that you install them on your system the same way you would any other font you wish to use in other programs.
A muted, qualitative color palette
ipsum_pal()ipsum_pal()
library(scales) scales::show_col(ipsum_pal()(9))library(scales) scales::show_col(ipsum_pal()(9))
Change geom defaults from black to white for the modern theme
modern_geom_defaults()modern_geom_defaults()
Reproduces the --c1..--c6 palette omp derives for chart SVGs.
omp_chart_palette(accent = omp_titanium[["accent"]], light = FALSE, n = 6L)omp_chart_palette(accent = omp_titanium[["accent"]], light = FALSE, n = 6L)
accent |
Theme accent color (defaults to |
light |
|
n |
Number of series colors to return (omp uses at most 6) |
A character vector of hex colors
omp_chart_palette() omp_chart_palette("#5b4bb7") # Tern dark-cosmos accentomp_chart_palette() omp_chart_palette("#5b4bb7") # Tern dark-cosmos accent
titanium theme colorsomp titanium theme colors
omp_titaniumomp_titanium
A named character vector of hex color codes
Continuous Color Scale Using Flexoki Colors
scale_color_flexoki_continuous(palette = "red", ...)scale_color_flexoki_continuous(palette = "red", ...)
palette |
Name of the color palette to use ("red", "orange", "yellow", "green", "cyan", "blue", "purple", "magenta") |
... |
Additional arguments passed to scale_color_gradientn() |
A continuous ggplot2 color scale
library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_color_flexoki_continuous(palette = "blue")library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_color_flexoki_continuous(palette = "blue")
Discrete Color Scale Using Flexoki Dark Colors
scale_color_flexoki_dark(...)scale_color_flexoki_dark(...)
... |
Additional arguments passed to scale_color_manual() |
A discrete ggplot2 color scale
library(ggplot2) ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) + geom_point() + scale_color_flexoki_dark()library(ggplot2) ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) + geom_point() + scale_color_flexoki_dark()
Creates a sequential color gradient based on the Flexoki dark color palette
scale_color_flexoki_dark_distiller(palette = "blue", direction = 1, ...)scale_color_flexoki_dark_distiller(palette = "blue", direction = 1, ...)
palette |
Name of the color palette to use ("red", "orange", "yellow", "green", "cyan", "blue", "purple", "magenta") |
direction |
Sets the direction of the color scale (1 = default, -1 = reversed) |
... |
Additional arguments passed to scale_color_gradientn() |
A sequential ggplot2 color scale
library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_dark_distiller(palette = "blue")library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_dark_distiller(palette = "blue")
Creates a sequential color gradient using all colors from the Flexoki dark palette
scale_color_flexoki_dark_spectrum(direction = 1, ...)scale_color_flexoki_dark_spectrum(direction = 1, ...)
direction |
Sets the direction of the color scale (1 = default, -1 = reversed) |
... |
Additional arguments passed to scale_color_gradientn() |
A sequential ggplot2 color scale
library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_dark_spectrum()library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_dark_spectrum()
Discrete Color Scale Using Flexoki Light Colors
scale_color_flexoki_light(...)scale_color_flexoki_light(...)
... |
Additional arguments passed to scale_color_manual() |
A discrete ggplot2 color scale
library(ggplot2) ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) + geom_point() + scale_color_flexoki_light()library(ggplot2) ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) + geom_point() + scale_color_flexoki_light()
Creates a sequential color gradient based on the Flexoki light color palette
scale_color_flexoki_light_distiller(palette = "blue", direction = 1, ...)scale_color_flexoki_light_distiller(palette = "blue", direction = 1, ...)
palette |
Name of the color palette to use ("red", "orange", "yellow", "green", "cyan", "blue", "purple", "magenta") |
direction |
Sets the direction of the color scale (1 = default, -1 = reversed) |
... |
Additional arguments passed to scale_color_gradientn() |
A sequential ggplot2 color scale
library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_light_distiller(palette = "blue")library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_light_distiller(palette = "blue")
Creates a sequential color gradient using all colors from the Flexoki light palette
scale_color_flexoki_light_spectrum(direction = 1, ...)scale_color_flexoki_light_spectrum(direction = 1, ...)
direction |
Sets the direction of the color scale (1 = default, -1 = reversed) |
... |
Additional arguments passed to scale_color_gradientn() |
A sequential ggplot2 color scale
library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_light_spectrum()library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_light_spectrum()
See ft_pal().
scale_colour_ft(...) scale_color_ft(...) scale_fill_ft(...)scale_colour_ft(...) scale_color_ft(...) scale_fill_ft(...)
... |
Arguments passed on to
|
See ipsum_pal().
scale_colour_ipsum(...) scale_color_ipsum(...) scale_fill_ipsum(...)scale_colour_ipsum(...) scale_color_ipsum(...) scale_fill_ipsum(...)
... |
Arguments passed on to
|
Continuous Fill Scale Using Flexoki Colors
scale_fill_flexoki_continuous(palette = "red", ...)scale_fill_flexoki_continuous(palette = "red", ...)
palette |
Name of the color palette to use ("red", "orange", "yellow", "green", "cyan", "blue", "purple", "magenta") |
... |
Additional arguments passed to scale_fill_gradientn() |
A continuous ggplot2 fill scale
library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_continuous(palette = "blue")library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_continuous(palette = "blue")
Discrete Fill Scale Using Flexoki Dark Colors
scale_fill_flexoki_dark(...)scale_fill_flexoki_dark(...)
... |
Additional arguments passed to scale_fill_manual() |
A discrete ggplot2 fill scale
library(ggplot2) ggplot(mtcars, aes(factor(cyl), fill = factor(cyl))) + geom_bar() + scale_fill_flexoki_dark()library(ggplot2) ggplot(mtcars, aes(factor(cyl), fill = factor(cyl))) + geom_bar() + scale_fill_flexoki_dark()
Creates a sequential fill gradient based on the Flexoki dark color palette
scale_fill_flexoki_dark_distiller(palette = "blue", direction = 1, ...)scale_fill_flexoki_dark_distiller(palette = "blue", direction = 1, ...)
palette |
Name of the color palette to use ("red", "orange", "yellow", "green", "cyan", "blue", "purple", "magenta") |
direction |
Sets the direction of the color scale (1 = default, -1 = reversed) |
... |
Additional arguments passed to scale_fill_gradientn() |
A sequential ggplot2 fill scale
library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_dark_distiller(palette = "blue")library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_dark_distiller(palette = "blue")
Creates a sequential fill gradient using all colors from the Flexoki dark palette
scale_fill_flexoki_dark_spectrum(direction = 1, ...)scale_fill_flexoki_dark_spectrum(direction = 1, ...)
direction |
Sets the direction of the color scale (1 = default, -1 = reversed) |
... |
Additional arguments passed to scale_fill_gradientn() |
A sequential ggplot2 fill scale
library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_dark_spectrum()library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_dark_spectrum()
Discrete Fill Scale Using Flexoki Light Colors
scale_fill_flexoki_light(...)scale_fill_flexoki_light(...)
... |
Additional arguments passed to scale_fill_manual() |
A discrete ggplot2 fill scale
library(ggplot2) ggplot(mtcars, aes(factor(cyl), fill = factor(cyl))) + geom_bar() + scale_fill_flexoki_light()library(ggplot2) ggplot(mtcars, aes(factor(cyl), fill = factor(cyl))) + geom_bar() + scale_fill_flexoki_light()
Creates a sequential fill gradient based on the Flexoki light color palette
scale_fill_flexoki_light_distiller(palette = "blue", direction = 1, ...)scale_fill_flexoki_light_distiller(palette = "blue", direction = 1, ...)
palette |
Name of the color palette to use ("red", "orange", "yellow", "green", "cyan", "blue", "purple", "magenta") |
direction |
Sets the direction of the color scale (1 = default, -1 = reversed) |
... |
Additional arguments passed to scale_fill_gradientn() |
A sequential ggplot2 fill scale
library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_light_distiller(palette = "blue")library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_light_distiller(palette = "blue")
Creates a sequential fill gradient using all colors from the Flexoki light palette
scale_fill_flexoki_light_spectrum(direction = 1, ...)scale_fill_flexoki_light_spectrum(direction = 1, ...)
direction |
Sets the direction of the color scale (1 = default, -1 = reversed) |
... |
Additional arguments passed to scale_fill_gradientn() |
A sequential ggplot2 fill scale
library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_light_spectrum()library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_light_spectrum()
The _comma ones set comma format for axis text and expand=c(0,0) (you need to set limits).
scale_x_percent( name = waiver(), breaks = waiver(), minor_breaks = waiver(), guide = waiver(), n.breaks = NULL, labels, limits = NULL, expand = c(0.01, 0), oob = censor, na.value = NA_real_, trans = "identity", transform = "identity", position = "bottom", sec.axis = waiver(), accuracy = 1, scale = 100, prefix = "", suffix = "%", big.mark = " ", decimal.mark = ".", trim = TRUE, ... ) scale_y_percent( name = waiver(), breaks = waiver(), minor_breaks = waiver(), guide = waiver(), n.breaks = NULL, labels, limits = NULL, expand = c(0.01, 0), oob = censor, na.value = NA_real_, trans = "identity", transform = "identity", position = "left", sec.axis = waiver(), accuracy = 1, scale = 100, prefix = "", suffix = "%", big.mark = " ", decimal.mark = ".", trim = TRUE, ... ) scale_x_comma( name = waiver(), breaks = waiver(), minor_breaks = waiver(), guide = waiver(), n.breaks = NULL, labels, limits = NULL, expand = c(0.01, 0), oob = censor, na.value = NA_real_, trans = "identity", transform = "identity", position = "bottom", sec.axis = waiver(), accuracy = 1, scale = 1, prefix = "", suffix = "", big.mark = ",", decimal.mark = ".", trim = TRUE, ... ) scale_y_comma( name = waiver(), breaks = waiver(), minor_breaks = waiver(), guide = waiver(), n.breaks = NULL, labels, limits = NULL, expand = c(0.01, 0), oob = censor, na.value = NA_real_, trans = "identity", transform = "identity", position = "left", sec.axis = waiver(), accuracy = 1, scale = 1, prefix = "", suffix = "", big.mark = ",", decimal.mark = ".", trim = TRUE, ... )scale_x_percent( name = waiver(), breaks = waiver(), minor_breaks = waiver(), guide = waiver(), n.breaks = NULL, labels, limits = NULL, expand = c(0.01, 0), oob = censor, na.value = NA_real_, trans = "identity", transform = "identity", position = "bottom", sec.axis = waiver(), accuracy = 1, scale = 100, prefix = "", suffix = "%", big.mark = " ", decimal.mark = ".", trim = TRUE, ... ) scale_y_percent( name = waiver(), breaks = waiver(), minor_breaks = waiver(), guide = waiver(), n.breaks = NULL, labels, limits = NULL, expand = c(0.01, 0), oob = censor, na.value = NA_real_, trans = "identity", transform = "identity", position = "left", sec.axis = waiver(), accuracy = 1, scale = 100, prefix = "", suffix = "%", big.mark = " ", decimal.mark = ".", trim = TRUE, ... ) scale_x_comma( name = waiver(), breaks = waiver(), minor_breaks = waiver(), guide = waiver(), n.breaks = NULL, labels, limits = NULL, expand = c(0.01, 0), oob = censor, na.value = NA_real_, trans = "identity", transform = "identity", position = "bottom", sec.axis = waiver(), accuracy = 1, scale = 1, prefix = "", suffix = "", big.mark = ",", decimal.mark = ".", trim = TRUE, ... ) scale_y_comma( name = waiver(), breaks = waiver(), minor_breaks = waiver(), guide = waiver(), n.breaks = NULL, labels, limits = NULL, expand = c(0.01, 0), oob = censor, na.value = NA_real_, trans = "identity", transform = "identity", position = "left", sec.axis = waiver(), accuracy = 1, scale = 1, prefix = "", suffix = "", big.mark = ",", decimal.mark = ".", trim = TRUE, ... )
name |
The name of the scale. Used as axis or legend title. If
|
breaks |
One of:
|
minor_breaks |
One of:
|
guide |
guide A function used to create a guide or its name. See |
n.breaks |
An integer guiding the number of major breaks. The algorithm may choose a
slightly different number to ensure nice break labels. Will only have an effect if
|
labels |
Specifying overrides the default format (i.e. you really don't
want to do that). |
limits |
A numeric vector of length two providing limits of the scale.
Use |
expand |
same as in ggplot2 |
oob |
Function that handles limits outside of the scale limits (out of bounds). The default replaces out of bounds values with NA. |
na.value |
If |
trans |
(DEPRECATED) Either the name of a transformation object, or the object itself. Built-in transformations include "asn", "atanh", "boxcox", "exp", "identity", "log", "log10", "log1p", "log2", "logit", "probability", "probit", "reciprocal", "reverse" and "sqrt". |
transform |
Either the name of a transformation object, or the object itself. Built-in transformations include "asn", "atanh", "boxcox", "exp", "identity", "log", "log10", "log1p", "log2", "logit", "probability", "probit", "reciprocal", "reverse" and "sqrt". |
position |
The position of the axis. "left" or "right" for vertical scales, "top" or "bottom" for horizontal scales |
sec.axis |
specify a secondary axis |
accuracy, scale, prefix, suffix, big.mark, decimal.mark, trim
|
|
... |
passed on to |
The _percent ones set percent format for axis text and expand=c(0,0) (you need to set limits).
Colors and scales for charts that sit inside Tern and beside omp charts.
Two palettes are exposed:
tern_dark holds the dark-cosmos terminal theme Tern currently uses:
page, panel, ink, accent, and the semantic success/error/warning colors.
omp_titanium holds the titanium theme omp charts are drawn with.
omp_chart_palette() reproduces omp's series palette. omp does not ship a
fixed chart palette: it starts from the theme accent in OKLCH, then picks
six hues at least 30 degrees apart (packages/tui/src/chat/svg-figure.ts),
clamps lightness to [0.68, 0.82] in dark themes ([0.52, 0.66] in light
ones) and chroma to 0.19, and emits them as --c1..--c6. The function
follows the same steps, so a different omp theme accent yields the palette
omp would draw.
scale_color_tern( ..., accent = omp_titanium[["accent"]], light = FALSE, direction = 1 ) scale_fill_tern( ..., accent = omp_titanium[["accent"]], light = FALSE, direction = 1 ) scale_color_tern_continuous( ..., accent = omp_titanium[["accent"]], light = FALSE, direction = 1 ) scale_fill_tern_continuous( ..., accent = omp_titanium[["accent"]], light = FALSE, direction = 1 )scale_color_tern( ..., accent = omp_titanium[["accent"]], light = FALSE, direction = 1 ) scale_fill_tern( ..., accent = omp_titanium[["accent"]], light = FALSE, direction = 1 ) scale_color_tern_continuous( ..., accent = omp_titanium[["accent"]], light = FALSE, direction = 1 ) scale_fill_tern_continuous( ..., accent = omp_titanium[["accent"]], light = FALSE, direction = 1 )
... |
Additional arguments passed to |
accent |
Theme accent used to derive the series palette |
light |
|
direction |
|
A named character vector of hex colors, a palette vector, or a ggplot2 scale object.
omp_chart_palette() omp_chart_palette(light = TRUE) library(ggplot2) ggplot(mpg, aes(class, fill = class)) + geom_bar() + scale_fill_tern() ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_tern_continuous()omp_chart_palette() omp_chart_palette(light = TRUE) library(ggplot2) ggplot(mpg, aes(class, fill = class)) + geom_bar() + scale_fill_tern() ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_tern_continuous()
dark-cosmos theme colorsTern dark-cosmos theme colors
tern_darktern_dark
A named character vector of hex color codes
You should import_roboto_condensed() first and also install the fonts on your
system before trying to use this theme.
theme_ft_rc( base_family = "Roboto Condensed", base_size = 11.5, plot_title_family = base_family, plot_title_size = 18, plot_title_face = "bold", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else "Roboto Condensed Light", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else "Roboto Condensed Light", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = base_size, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid = TRUE, axis = FALSE, ticks = FALSE ) theme_modern_rc( base_family = "Roboto Condensed", base_size = 11.5, plot_title_family = base_family, plot_title_size = 18, plot_title_face = "bold", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else "Roboto Condensed Light", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else "Roboto Condensed Light", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = base_size, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid = TRUE, axis = FALSE, ticks = FALSE ) theme_ipsum_rc( base_family = "Roboto Condensed", base_size = 11.5, plot_title_family = base_family, plot_title_size = 18, plot_title_face = "bold", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else "Roboto Condensed Light", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else "Roboto Condensed Light", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = base_size, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), panel_spacing = grid::unit(2, "lines"), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )theme_ft_rc( base_family = "Roboto Condensed", base_size = 11.5, plot_title_family = base_family, plot_title_size = 18, plot_title_face = "bold", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else "Roboto Condensed Light", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else "Roboto Condensed Light", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = base_size, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid = TRUE, axis = FALSE, ticks = FALSE ) theme_modern_rc( base_family = "Roboto Condensed", base_size = 11.5, plot_title_family = base_family, plot_title_size = 18, plot_title_face = "bold", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else "Roboto Condensed Light", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else "Roboto Condensed Light", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = base_size, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid = TRUE, axis = FALSE, ticks = FALSE ) theme_ipsum_rc( base_family = "Roboto Condensed", base_size = 11.5, plot_title_family = base_family, plot_title_size = 18, plot_title_face = "bold", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else "Roboto Condensed Light", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else "Roboto Condensed Light", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = base_size, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), panel_spacing = grid::unit(2, "lines"), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )
base_family, base_size
|
base font family and size |
plot_title_family, plot_title_face, plot_title_size, plot_title_margin
|
plot tilte family, face, size and margin |
subtitle_family, subtitle_face, subtitle_size
|
plot subtitle family, face and size |
subtitle_margin |
plot subtitle margin bottom (single numeric value) |
strip_text_family, strip_text_face, strip_text_size
|
facet label font family, face and size |
caption_family, caption_face, caption_size, caption_margin
|
plot caption family, face, size and margin |
axis_text_size |
font size of axis text |
axis_title_family, axis_title_face, axis_title_size
|
axis title font family, face and size |
axis_title_just |
axis title font justification one of |
plot_margin |
plot margin (specify with ggplot2::margin) |
grid |
panel grid ( |
axis |
add x or y axes? |
ticks |
ticks if |
panel_spacing |
panel spacing (use |
grid_col |
grid color |
axis_col |
axis color |
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
It's free, has tolerable kerning pairs and multiple weights. It's also different than Arial Narrow and the fonts most folks use in ggplot2 charts.
## Not run: library(ggplot2) library(dplyr) # seminal scatterplot ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 scatterplot example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_rc() # seminal bar chart # note: make this font_rc on Windows update_geom_font_defaults(family=font_rc_light) count(mpg, class) %>% ggplot(aes(class, n)) + geom_col() + geom_text(aes(label=n), nudge_y=3) + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 bar chart example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_rc(grid="Y") + theme(axis.text.y=element_blank()) ## End(Not run)## Not run: library(ggplot2) library(dplyr) # seminal scatterplot ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 scatterplot example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_rc() # seminal bar chart # note: make this font_rc on Windows update_geom_font_defaults(family=font_rc_light) count(mpg, class) %>% ggplot(aes(class, n)) + geom_col() + geom_text(aes(label=n), nudge_y=3) + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 bar chart example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_rc(grid="Y") + theme(axis.text.y=element_blank()) ## End(Not run)
Also has a "dark" / "modern" version for the new RStudio theme
theme_ipsum( base_family = "Arial Narrow", base_size = 11.5, plot_title_family = base_family, plot_title_size = 18, plot_title_face = "bold", plot_title_margin = 10, subtitle_family = base_family, subtitle_size = 12, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = base_family, caption_size = 9, caption_face = "italic", caption_margin = 10, axis_text_size = base_size, axis_title_family = subtitle_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )theme_ipsum( base_family = "Arial Narrow", base_size = 11.5, plot_title_family = base_family, plot_title_size = 18, plot_title_face = "bold", plot_title_margin = 10, subtitle_family = base_family, subtitle_size = 12, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = base_family, caption_size = 9, caption_face = "italic", caption_margin = 10, axis_text_size = base_size, axis_title_family = subtitle_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )
base_family, base_size
|
base font family and size |
plot_title_family, plot_title_face, plot_title_size, plot_title_margin
|
plot title family, face, size and margi |
subtitle_family, subtitle_face, subtitle_size
|
plot subtitle family, face and size |
subtitle_margin |
plot subtitle margin bottom (single numeric value) |
strip_text_family, strip_text_face, strip_text_size
|
facet label font family, face and size |
caption_family, caption_face, caption_size, caption_margin
|
plot caption family, face, size and margin |
axis_text_size |
font size of axis text |
axis_title_family, axis_title_face, axis_title_size
|
axis title font family, face and size |
axis_title_just |
axis title font justification, one of |
plot_margin |
plot margin (specify with |
grid_col, axis_col
|
grid & axis colors; both default to |
grid |
panel grid ( |
axis |
add x or y axes? |
ticks |
ticks if |
First and foremost, Arial Narrow is generally installed by default or readily available on any modern system, so it's "free"-ish; plus, it is a condensed font with solid default kerning pairs and geometric numbers.
theme_ipsum
The function is setup in such a way that you can customize your own one by just wrapping the call and changing the parameters. See source for examples.
There are distinctions between font names and various devices. Names that work
for display graphics devices and bitmap ones such as png may not work well
for PostScript or PDF ones. You may need two versions of a font-based
theme function for them to work in a particular situation. This situation
usually only arises when using a newer font with many weights but somewhat
irregular internal font name patterns.
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
## Not run: library(ggplot2) library(dplyr) # seminal scatterplot ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 scatterplot example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum() # seminal bar chart update_geom_font_defaults() count(mpg, class) %>% ggplot(aes(class, n)) + geom_col() + geom_text(aes(label=n), nudge_y=3) + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 bar chart example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum(grid="Y") + theme(axis.text.y=element_blank()) ## End(Not run)## Not run: library(ggplot2) library(dplyr) # seminal scatterplot ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 scatterplot example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum() # seminal bar chart update_geom_font_defaults() count(mpg, class) %>% ggplot(aes(class, n)) + geom_col() + geom_text(aes(label=n), nudge_y=3) + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 bar chart example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum(grid="Y") + theme(axis.text.y=element_blank()) ## End(Not run)
You should import_archivo() first and install the fonts on your
system before trying to use this theme.
theme_ipsum_archivo( base_family = "Archivo SemiCondensed", base_size = 11.5, plot_title_family = "Archivo SemiCondensed Bold", plot_title_size = 18, plot_title_face = "plain", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "Archivo SemiCondensed" else "Archivo SemiCondensed", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = "Archivo SemiCondensed SemiBold", strip_text_size = 12, strip_text_face = "plain", caption_family = if (.Platform$OS.type == "windows") "Archivo SemiCondensed" else "Archivo SemiCondensed", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = 9, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )theme_ipsum_archivo( base_family = "Archivo SemiCondensed", base_size = 11.5, plot_title_family = "Archivo SemiCondensed Bold", plot_title_size = 18, plot_title_face = "plain", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "Archivo SemiCondensed" else "Archivo SemiCondensed", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = "Archivo SemiCondensed SemiBold", strip_text_size = 12, strip_text_face = "plain", caption_family = if (.Platform$OS.type == "windows") "Archivo SemiCondensed" else "Archivo SemiCondensed", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = 9, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )
base_family, base_size
|
base font family and size |
plot_title_family, plot_title_face, plot_title_size, plot_title_margin
|
plot tilte family, face, size and margin |
subtitle_family, subtitle_face, subtitle_size
|
plot subtitle family, face and size |
subtitle_margin |
plot subtitle margin bottom (single numeric value) |
strip_text_family, strip_text_face, strip_text_size
|
facet label font family, face and size |
caption_family, caption_face, caption_size, caption_margin
|
plot caption family, face, size and margin |
axis_text_size |
font size of axis text |
axis_title_family, axis_title_face, axis_title_size
|
axis title font family, face and size |
axis_title_just |
axis title font justification one of |
plot_margin |
plot margin (specify with ggplot2::margin) |
grid_col |
grid color |
grid |
panel grid ( |
axis_col |
axis color |
axis |
add x or y axes? |
ticks |
ticks if |
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
Archivo was designed to be used simultaneously in print and digital platforms. The technical and aesthetic characteristics of the font are both crafted for high performance typography. It was designed by Héctor Gatti to be used simultaneously in print and online platforms and supports over 200 world languages and has tabular numbers. Archivo is a grotesque sans serif typeface family from Omnibus-Type. It was originally designed for highlights and headlines. This family is reminiscent of late nineteenth century American typefaces.
You should import_econ_sans() first and install the fonts on your
system before trying to use this theme.
theme_ipsum_es( base_family = "EconSansCndReg", base_size = 11.5, plot_title_family = "EconSansCndBol", plot_title_size = 18, plot_title_face = "bold", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "EconSansCndLig" else "EconSansCndLig", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = if (.Platform$OS.type == "windows") "EconSansCndLig" else "EconSansCndLig", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = base_size, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), panel_spacing = grid::unit(2, "lines"), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )theme_ipsum_es( base_family = "EconSansCndReg", base_size = 11.5, plot_title_family = "EconSansCndBol", plot_title_size = 18, plot_title_face = "bold", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "EconSansCndLig" else "EconSansCndLig", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = if (.Platform$OS.type == "windows") "EconSansCndLig" else "EconSansCndLig", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = base_size, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), panel_spacing = grid::unit(2, "lines"), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )
base_family, base_size
|
base font family and size |
plot_title_family, plot_title_face, plot_title_size, plot_title_margin
|
plot tilte family, face, size and margin |
subtitle_family, subtitle_face, subtitle_size
|
plot subtitle family, face and size |
subtitle_margin |
plot subtitle margin bottom (single numeric value) |
strip_text_family, strip_text_face, strip_text_size
|
facet label font family, face and size |
caption_family, caption_face, caption_size, caption_margin
|
plot caption family, face, size and margin |
axis_text_size |
font size of axis text |
axis_title_family, axis_title_face, axis_title_size
|
axis title font family, face and size |
axis_title_just |
axis title font justification one of |
plot_margin |
plot margin (specify with ggplot2::margin) |
panel_spacing |
panel spacing (use |
grid_col |
grid color |
grid |
panel grid ( |
axis_col |
axis color |
axis |
add x or y axes? |
ticks |
ticks if |
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
It's free, has tolerable kerning pairs and multiple weights. It's also different than Arial Narrow and the fonts most folks use in ggplot2 charts.
## Not run: library(ggplot2) library(dplyr) # seminal scatterplot ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 scatterplot example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_es() # seminal bar chart # note: may need to make this font_es on Windows update_geom_font_defaults(family=font_es_light) count(mpg, class) %>% ggplot(aes(class, n)) + geom_col() + geom_text(aes(label=n), nudge_y=3) + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 bar chart example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_es(grid="Y") + theme(axis.text.y=element_blank()) ## End(Not run)## Not run: library(ggplot2) library(dplyr) # seminal scatterplot ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 scatterplot example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_es() # seminal bar chart # note: may need to make this font_es on Windows update_geom_font_defaults(family=font_es_light) count(mpg, class) %>% ggplot(aes(class, n)) + geom_col() + geom_text(aes(label=n), nudge_y=3) + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 bar chart example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_es(grid="Y") + theme(axis.text.y=element_blank()) ## End(Not run)
You should import_goldman_sans() first and install the fonts on your
system before trying to use this theme.
theme_ipsum_gs( base_family = "Goldman Sans Condensed", base_size = 11.5, plot_title_family = "Goldman Sans Condensed", plot_title_size = 18, plot_title_face = "bold", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "Goldman Sans Condensed" else "Goldman Sans Condensed", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = "Goldman Sans Condensed", strip_text_size = 12, strip_text_face = "bold", caption_family = if (.Platform$OS.type == "windows") "Goldman Sans Condensed" else "Goldman Sans Condensed", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = 9, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )theme_ipsum_gs( base_family = "Goldman Sans Condensed", base_size = 11.5, plot_title_family = "Goldman Sans Condensed", plot_title_size = 18, plot_title_face = "bold", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "Goldman Sans Condensed" else "Goldman Sans Condensed", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = "Goldman Sans Condensed", strip_text_size = 12, strip_text_face = "bold", caption_family = if (.Platform$OS.type == "windows") "Goldman Sans Condensed" else "Goldman Sans Condensed", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = 9, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )
base_family, base_size
|
base font family and size |
plot_title_family, plot_title_face, plot_title_size, plot_title_margin
|
plot tilte family, face, size and margin |
subtitle_family, subtitle_face, subtitle_size
|
plot subtitle family, face and size |
subtitle_margin |
plot subtitle margin bottom (single numeric value) |
strip_text_family, strip_text_face, strip_text_size
|
facet label font family, face and size |
caption_family, caption_face, caption_size, caption_margin
|
plot caption family, face, size and margin |
axis_text_size |
font size of axis text |
axis_title_family, axis_title_face, axis_title_size
|
axis title font family, face and size |
axis_title_just |
axis title font justification one of |
plot_margin |
plot margin (specify with ggplot2::margin) |
grid_col |
grid color |
grid |
panel grid ( |
axis_col |
axis color |
axis |
add x or y axes? |
ticks |
ticks if |
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
Google "goldman sans design system"
## Not run: library(ggplot2) library(dplyr) # seminal scatterplot ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 scatterplot example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_gs() # seminal bar chart update_geom_font_defaults(family=font_gs_light) count(mpg, class) %>% ggplot(aes(class, n)) + geom_col() + geom_text(aes(label=n), nudge_y=3) + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 bar chart example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_gs(grid="Y") + theme(axis.text.y=element_blank()) ## End(Not run)## Not run: library(ggplot2) library(dplyr) # seminal scatterplot ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 scatterplot example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_gs() # seminal bar chart update_geom_font_defaults(family=font_gs_light) count(mpg, class) %>% ggplot(aes(class, n)) + geom_col() + geom_text(aes(label=n), nudge_y=3) + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 bar chart example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_gs(grid="Y") + theme(axis.text.y=element_blank()) ## End(Not run)
You should import_inter() first and install the fonts on your
system before trying to use this theme.
theme_ipsum_inter( base_family = "Inter-Medium", base_size = 10, plot_title_family = "Inter-Bold", plot_title_size = 16, plot_title_face = "bold", plot_title_margin = 8, subtitle_family = "Inter-Light", subtitle_size = 12, subtitle_face = "plain", subtitle_margin = 13, strip_text_family = "Inter-SemiBold", strip_text_size = 12, strip_text_face = "bold", caption_family = "Inter-Thin", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_family = "Inter-Light", axis_text_face = "plain", axis_text_size = 9, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )theme_ipsum_inter( base_family = "Inter-Medium", base_size = 10, plot_title_family = "Inter-Bold", plot_title_size = 16, plot_title_face = "bold", plot_title_margin = 8, subtitle_family = "Inter-Light", subtitle_size = 12, subtitle_face = "plain", subtitle_margin = 13, strip_text_family = "Inter-SemiBold", strip_text_size = 12, strip_text_face = "bold", caption_family = "Inter-Thin", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_family = "Inter-Light", axis_text_face = "plain", axis_text_size = 9, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )
base_family, base_size
|
base font family and size |
plot_title_family, plot_title_face, plot_title_size, plot_title_margin
|
plot tilte family, face, size and margin |
subtitle_family, subtitle_face, subtitle_size
|
plot subtitle family, face and size |
subtitle_margin |
plot subtitle margin bottom (single numeric value) |
strip_text_family, strip_text_face, strip_text_size
|
facet label font family, face and size |
caption_family, caption_face, caption_size, caption_margin
|
plot caption family, face, size and margin |
axis_text_family, axis_text_face
|
axis text font family and face |
axis_text_size |
font size of axis text |
axis_title_family, axis_title_face, axis_title_size
|
axis title font family, face and size |
axis_title_just |
axis title font justification one of |
plot_margin |
plot margin (specify with ggplot2::margin) |
grid_col |
grid color |
grid |
panel grid ( |
axis_col |
axis color |
axis |
add x or y axes? |
ticks |
ticks if |
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
Google "inter font".
## Not run: library(ggplot2) library(dplyr) # seminal scatterplot ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 scatterplot example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_inter() # seminal bar chart update_geom_font_defaults(family=font_inter_medium) count(mpg, class) %>% ggplot(aes(class, n)) + geom_col() + geom_text(aes(label=n), nudge_y=3) + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 bar chart example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_inter(grid="Y") + theme(axis.text.y=element_blank()) ## End(Not run)## Not run: library(ggplot2) library(dplyr) # seminal scatterplot ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 scatterplot example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_inter() # seminal bar chart update_geom_font_defaults(family=font_inter_medium) count(mpg, class) %>% ggplot(aes(class, n)) + geom_col() + geom_text(aes(label=n), nudge_y=3) + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 bar chart example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_inter(grid="Y") + theme(axis.text.y=element_blank()) ## End(Not run)
You should import_plex_sans() first and install the fonts on your
system before trying to use this theme.
theme_ipsum_ps( base_family = "IBMPlexSans", base_size = 11.5, plot_title_family = "IBMPlexSans-Bold", plot_title_size = 18, plot_title_face = "plain", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "IBMPlexSans" else "IBMPlexSans-Light", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = "IBMPlexSans-Medium", strip_text_size = 12, strip_text_face = "plain", caption_family = if (.Platform$OS.type == "windows") "IBMPlexSans" else "IBMPlexSans-Thin", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = 9, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )theme_ipsum_ps( base_family = "IBMPlexSans", base_size = 11.5, plot_title_family = "IBMPlexSans-Bold", plot_title_size = 18, plot_title_face = "plain", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "IBMPlexSans" else "IBMPlexSans-Light", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = "IBMPlexSans-Medium", strip_text_size = 12, strip_text_face = "plain", caption_family = if (.Platform$OS.type == "windows") "IBMPlexSans" else "IBMPlexSans-Thin", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = 9, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )
base_family, base_size
|
base font family and size |
plot_title_family, plot_title_face, plot_title_size, plot_title_margin
|
plot tilte family, face, size and margin |
subtitle_family, subtitle_face, subtitle_size
|
plot subtitle family, face and size |
subtitle_margin |
plot subtitle margin bottom (single numeric value) |
strip_text_family, strip_text_face, strip_text_size
|
facet label font family, face and size |
caption_family, caption_face, caption_size, caption_margin
|
plot caption family, face, size and margin |
axis_text_size |
font size of axis text |
axis_title_family, axis_title_face, axis_title_size
|
axis title font family, face and size |
axis_title_just |
axis title font justification one of |
plot_margin |
plot margin (specify with ggplot2::margin) |
grid_col |
grid color |
grid |
panel grid ( |
axis_col |
axis color |
axis |
add x or y axes? |
ticks |
ticks if |
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
It's free, has tolerable kerning pairs and multiple weights. It's also different "not Helvetica".
## Not run: library(ggplot2) library(dplyr) # seminal scatterplot ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 scatterplot example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_rc() # seminal bar chart # note: make this font_rc on Windows update_geom_font_defaults(family=font_rc_light) count(mpg, class) %>% ggplot(aes(class, n)) + geom_col() + geom_text(aes(label=n), nudge_y=3) + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 bar chart example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_rc(grid="Y") + theme(axis.text.y=element_blank()) ## End(Not run)## Not run: library(ggplot2) library(dplyr) # seminal scatterplot ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 scatterplot example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_rc() # seminal bar chart # note: make this font_rc on Windows update_geom_font_defaults(family=font_rc_light) count(mpg, class) %>% ggplot(aes(class, n)) + geom_col() + geom_text(aes(label=n), nudge_y=3) + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 bar chart example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_rc(grid="Y") + theme(axis.text.y=element_blank()) ## End(Not run)
You should import_public_sans() first and install the fonts on your
system before trying to use this theme.
theme_ipsum_pub( base_family = "Public Sans", base_size = 10.5, plot_title_family = if (.Platform$OS.type == "windows") "Public Sans" else "Public Sans Bold", plot_title_size = 18, plot_title_face = "bold", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "Public Sans Thin" else "Public Sans Thin", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = if (.Platform$OS.type == "windows") "Public Sans Thin" else "Public Sans Thin", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = base_size, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )theme_ipsum_pub( base_family = "Public Sans", base_size = 10.5, plot_title_family = if (.Platform$OS.type == "windows") "Public Sans" else "Public Sans Bold", plot_title_size = 18, plot_title_face = "bold", plot_title_margin = 10, subtitle_family = if (.Platform$OS.type == "windows") "Public Sans Thin" else "Public Sans Thin", subtitle_size = 13, subtitle_face = "plain", subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = if (.Platform$OS.type == "windows") "Public Sans Thin" else "Public Sans Thin", caption_size = 9, caption_face = "plain", caption_margin = 10, axis_text_size = base_size, axis_title_family = base_family, axis_title_size = 9, axis_title_face = "plain", axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE )
base_family, base_size
|
base font family and size |
plot_title_family, plot_title_face, plot_title_size, plot_title_margin
|
plot tilte family, face, size and margin |
subtitle_family, subtitle_face, subtitle_size
|
plot subtitle family, face and size |
subtitle_margin |
plot subtitle margin bottom (single numeric value) |
strip_text_family, strip_text_face, strip_text_size
|
facet label font family, face and size |
caption_family, caption_face, caption_size, caption_margin
|
plot caption family, face, size and margin |
axis_text_size |
font size of axis text |
axis_title_family, axis_title_face, axis_title_size
|
axis title font family, face and size |
axis_title_just |
axis title font justification one of |
plot_margin |
plot margin (specify with ggplot2::margin) |
grid_col |
grid color |
grid |
panel grid ( |
axis_col |
axis color |
axis |
add x or y axes? |
ticks |
ticks if |
There is an option hrbrthemes.loadfonts which – if set to TRUE – will
call extrafont::loadfonts() to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
## Not run: library(ggplot2) library(dplyr) # seminal scatterplot ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 scatterplot example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_pub() # seminal bar chart update_geom_font_defaults(family=font_pub) count(mpg, class) %>% ggplot(aes(class, n)) + geom_col() + geom_text(aes(label=n), nudge_y=3) + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 bar chart example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_pub(grid="Y") + theme(axis.text.y=element_blank()) ## End(Not run)## Not run: library(ggplot2) library(dplyr) # seminal scatterplot ggplot(mtcars, aes(mpg, wt)) + geom_point() + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 scatterplot example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_pub() # seminal bar chart update_geom_font_defaults(family=font_pub) count(mpg, class) %>% ggplot(aes(class, n)) + geom_col() + geom_text(aes(label=n), nudge_y=3) + labs(x="Fuel efficiency (mpg)", y="Weight (tons)", title="Seminal ggplot2 bar chart example", subtitle="A plot that is only useful for demonstration purposes", caption="Brought to you by the letter 'g'") + theme_ipsum_pub(grid="Y") + theme(axis.text.y=element_blank()) ## End(Not run)
Matches Tern's dark-cosmos chrome and omp's chart styling: no axis lines
or ticks, one direction of quiet grid lines, a transparent legend background,
and no panel border. Text defaults to Geist, the first family in omp's chart
font stack; the package ships the TTFs and import_geist() points to them.
Install the fonts before using this theme, or pass a different base_family.
theme_tern( base_family = "Geist", base_size = 12, plot_title_family = "Geist SemiBold", plot_title_size = 16, plot_title_face = "plain", plot_title_margin = 8, subtitle_family = base_family, subtitle_size = 12, subtitle_face = "plain", subtitle_margin = 10, caption_family = base_family, caption_size = 9, caption_face = "plain", caption_margin = 8, axis_title_family = "Geist Medium", axis_title_size = 10, axis_title_face = "plain", axis_text_size = 10, strip_text_family = "Geist SemiBold", plot_margin = ggplot2::margin(16, 16, 12, 12), bg = tern_dark[["page"]], panel_bg = tern_dark[["page"]], ink = tern_dark[["fg"]], title_col = tern_dark[["starlight"]], muted_col = tern_dark[["muted"]], dim_col = tern_dark[["dim"]], grid_col = tern_dark[["shadow"]], axis_col = tern_dark[["sep"]], grid = "Y", axis = FALSE, ticks = FALSE, legend_position = "top" )theme_tern( base_family = "Geist", base_size = 12, plot_title_family = "Geist SemiBold", plot_title_size = 16, plot_title_face = "plain", plot_title_margin = 8, subtitle_family = base_family, subtitle_size = 12, subtitle_face = "plain", subtitle_margin = 10, caption_family = base_family, caption_size = 9, caption_face = "plain", caption_margin = 8, axis_title_family = "Geist Medium", axis_title_size = 10, axis_title_face = "plain", axis_text_size = 10, strip_text_family = "Geist SemiBold", plot_margin = ggplot2::margin(16, 16, 12, 12), bg = tern_dark[["page"]], panel_bg = tern_dark[["page"]], ink = tern_dark[["fg"]], title_col = tern_dark[["starlight"]], muted_col = tern_dark[["muted"]], dim_col = tern_dark[["dim"]], grid_col = tern_dark[["shadow"]], axis_col = tern_dark[["sep"]], grid = "Y", axis = FALSE, ticks = FALSE, legend_position = "top" )
base_family, base_size
|
base font family and size |
plot_title_family, plot_title_face, plot_title_size, plot_title_margin
|
plot title family, face, size and margin |
subtitle_family, subtitle_face, subtitle_size, subtitle_margin
|
plot subtitle family, face, size and margin |
caption_family, caption_face, caption_size, caption_margin
|
plot caption family, face, size and margin |
axis_title_family, axis_title_face, axis_title_size
|
axis title family, face and size |
axis_text_size |
axis text size |
strip_text_family |
facet strip text family |
plot_margin |
plot margin (specify with |
bg, panel_bg, ink, title_col, muted_col, dim_col
|
colors for the page, panel, text, title, muted text and dim text |
grid_col, axis_col
|
grid and axis line colors |
grid |
panel grid ( |
axis |
add x or y axes? |
ticks |
ticks if |
legend_position |
legend position |
A ggplot2 theme object
## Not run: library(ggplot2) ggplot(mtcars, aes(wt, mpg)) + geom_point(color = omp_chart_palette()[1]) + labs(x = "Weight", y = "Miles per gallon", title = "Tern-styled chart") + theme_tern() ## End(Not run)## Not run: library(ggplot2) ggplot(mtcars, aes(wt, mpg)) + geom_point(color = omp_chart_palette()[1]) + labs(x = "Weight", y = "Miles per gallon", title = "Tern-styled chart") + theme_tern() ## End(Not run)
Updates ggplot2::geom_label and ggplot2::geom_text font defaults
update_geom_font_defaults( family = "Arial Narrow", face = "plain", size = 3.5, color = "#2b2b2b" )update_geom_font_defaults( family = "Arial Narrow", face = "plain", size = 3.5, color = "#2b2b2b" )
family, face, size, color
|
font family name, face, size and color |