### Create a ggplot2 scatterplot with theme_ipsum_es Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html This example generates a scatterplot using ggplot2 and applies the theme_ipsum_es theme. It includes custom labels for x, y, title, subtitle, and caption. The 'hrbrthemes.loadfonts' option should be set to TRUE to register fonts. ```R 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() ``` -------------------------------- ### Create a scatterplot with theme_ipsum_pub Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Demonstrates applying the 'theme_ipsum_pub' to a ggplot scatterplot. This example includes setting custom labels for title, subtitle, and caption, and utilizes the 'dplyr' package for data manipulation. ```r 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 ggplot2 Scatterplot with Theme Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html A scatterplot example using ggplot2, demonstrating the application of the `theme_ipsum` function with default settings. ```R 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() ``` -------------------------------- ### Create a bar chart with theme_ipsum_pub Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Illustrates applying 'theme_ipsum_pub' to a ggplot bar chart. This example uses 'dplyr::count' to aggregate data and applies theme customizations, including hiding y-axis text. ```r 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()) ``` -------------------------------- ### Create a ggplot2 bar chart with theme_ipsum_es Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html This example creates a bar chart with ggplot2 and applies the theme_ipsum_es theme with grid='Y'. It also customizes axis text and labels. Note the use of update_geom_font_defaults for font consistency. ```R # 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()) ``` -------------------------------- ### Seminal ggplot2 Bar Chart with Theme Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html A bar chart example using ggplot2, demonstrating the application of theme_ipsum_rc with grid lines enabled and y-axis text removed. ```R 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()) ``` -------------------------------- ### Seminal ggplot2 Bar Chart with Theme (Grid Enabled) Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html A bar chart example using ggplot2, demonstrating the application of `theme_ipsum` with grid lines enabled and y-axis text removed. ```R 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()) ``` -------------------------------- ### Import Roboto Condensed Font for Charts Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Imports the Roboto Condensed font for charts. This function ensures PDF/PostScript usage and displays the font directory location. Install fonts on your system for use in other applications. ```r import_roboto_condensed() ``` -------------------------------- ### Spell Check ggplot2 Example Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Demonstrates using gg_check to find spelling errors in ggplot2 plot labels. Includes setup for a sample plot. ```r 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) ``` -------------------------------- ### Create Seminal Scatterplot with Theme Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Demonstrates how to create a scatterplot using ggplot2 and apply the theme_ipsum_gs() theme. Ensure the 'hrbrthemes' package is loaded. ```r 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() ``` -------------------------------- ### Distiller Fill Scale Using Flexoki Light Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Creates a sequential fill gradient based on the Flexoki light color palette. Suitable for continuous data visualization. ```APIDOC ## scale_fill_flexoki_light_distiller ### Description Creates a sequential fill gradient based on the Flexoki light color palette ### Usage ```R scale_fill_flexoki_light_distiller(palette = "blue", direction = 1, ...) ``` ### Arguments `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() ### Value A sequential ggplot2 fill scale ### Examples ```R library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_light_distiller(palette = "blue") ``` ``` -------------------------------- ### Distiller Color Scale Using Flexoki Light Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Creates a sequential color gradient based on a specified Flexoki light color palette. Supports palettes like 'blue', 'red', etc. Pass additional arguments to scale_color_gradientn(). ```r library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_light_distiller(palette = "blue") ``` -------------------------------- ### Distiller Color Scale Across All Flexoki Light Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Creates a sequential color gradient using all colors from the Flexoki light palette. Pass additional arguments to scale_color_gradientn(). ```r library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_light_spectrum() ``` -------------------------------- ### Discrete Color Scale with Flexoki Dark Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Provides a discrete color scale using Flexoki dark colors. Additional arguments are passed to scale_color_manual(). ```r scale_color_flexoki_dark(...) ``` ```r library(ggplot2) ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) + geom_point() + scale_color_flexoki_dark() ``` -------------------------------- ### Bit12 Distiller Color Scales Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Apply Bit12 distiller color scales for continuous data in ggplot2, providing specific color ramps with adjustable direction. The 'azure' palette is used as an example. ```r scale_color_bit12_distiller(palette = "azure", direction = 1, ...) ``` ```r scale_fill_bit12_distiller(palette = "azure", direction = 1, ...) ``` -------------------------------- ### Create Seminal Bar Chart with Theme and Customizations Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Illustrates creating a bar chart with theme_ipsum_gs() and further customizations like removing y-axis text. The update_geom_font_defaults function is used to set font defaults. ```r 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()) ``` -------------------------------- ### scale_color_flexoki_light Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Creates a discrete color scale using the light colors from the Flexoki palette. It accepts additional arguments for customization. ```APIDOC ## scale_color_flexoki_light ### Description Discrete Color Scale Using Flexoki Light Colors. ### Arguments - `...` - Additional arguments passed to scale_color_manual(). ### Value A discrete ggplot2 color scale. ### Example ```R library(ggplot2) ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) + geom_point() + scale_color_flexoki_light() ``` ``` -------------------------------- ### Theme Function Definition: theme_ipsum_inter Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html This is the function definition for theme_ipsum_inter, which applies the Inter font theme to ggplot2 plots. It allows extensive customization of font families, sizes, and plot elements. Ensure 'Inter' fonts are installed and loaded. ```r 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 ) ``` -------------------------------- ### ggplot2 Scatterplot with theme_ipsum_inter Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Demonstrates creating a scatterplot using ggplot2 and applying the theme_ipsum_inter theme. Requires loading ggplot2 and dplyr libraries. ```r 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() ``` -------------------------------- ### Apply theme_ipsum_gs to a ggplot2 plot Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html This snippet shows how to apply the theme_ipsum_gs theme, which uses 'Goldman Sans Condensed' fonts. It details parameters for plot titles, subtitles, captions, and axis elements. Ensure 'Goldman Sans Condensed' fonts are installed and imported. ```R 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 ) ``` -------------------------------- ### Discrete Fill Scale Using Flexoki Light Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Provides a discrete fill scale using the Flexoki light color palette. Ideal for categorical data where distinct colors are needed for each category. ```APIDOC ## scale_fill_flexoki_light ### Description Discrete Fill Scale Using Flexoki Light Colors ### Usage ```R scale_fill_flexoki_light(...) ``` ### Arguments `...` | Additional arguments passed to scale_fill_manual() ### Value A discrete ggplot2 fill scale ### Examples ```R library(ggplot2) ggplot(mtcars, aes(factor(cyl), fill = factor(cyl))) + geom_bar() + scale_fill_flexoki_light() ``` ``` -------------------------------- ### scale_color_flexoki_light_distiller Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Generates a sequential color gradient using the Flexoki light color palette, with options to select specific palettes and control direction. ```APIDOC ## scale_color_flexoki_light_distiller ### Description Creates a sequential color gradient based on the Flexoki light color palette. ### Arguments - `palette` (character) - Name of the color palette to use ("red", "orange", "yellow", "green", "cyan", "blue", "purple", "magenta"). - `direction` (numeric) - Sets the direction of the color scale (1 = default, -1 = reversed). - `...` - Additional arguments passed to scale_color_gradientn(). ### Value A sequential ggplot2 color scale. ### Example ```R library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_light_distiller(palette = "blue") ``` ``` -------------------------------- ### ggplot2 Bar Chart with theme_ipsum_rc Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Illustrates creating a bar chart with ggplot2, including data aggregation and text labels, and applying the theme_ipsum_rc theme with grid lines. Requires loading ggplot2 and dplyr libraries. ```r # 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()) ``` -------------------------------- ### ggplot2 Bar Chart with theme_ipsum_inter Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Illustrates creating a bar chart with ggplot2, including data aggregation and text labels, and applying the theme_ipsum_inter theme with grid lines. Requires loading ggplot2 and dplyr libraries. ```r 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()) ``` -------------------------------- ### Distiller Fill Scale with Flexoki Dark Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Creates a sequential fill gradient using the Flexoki dark color palette. The 'direction' argument can reverse the color scale. ```r scale_fill_flexoki_dark_distiller(palette = "blue", direction = 1, ...) ``` -------------------------------- ### Flexoki Light Spectrum Fill Scale Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Creates a sequential fill gradient using all colors from the Flexoki light palette. Useful when a comprehensive light sequential color range is required. ```r library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_light_spectrum() ``` -------------------------------- ### Discrete Color Scale Using Flexoki Light Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Creates a discrete ggplot2 color scale using Flexoki light colors. Pass additional arguments to scale_color_manual(). ```r library(ggplot2) ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) + geom_point() + scale_color_flexoki_light() ``` -------------------------------- ### Flexoki Light Distiller Fill Scale Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Generates a sequential fill gradient based on the Flexoki light color palette. Use for sequential data with a preference for light color schemes. ```r library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_light_distiller(palette = "blue") ``` -------------------------------- ### Distiller Fill Scale Across All Flexoki Light Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Generates a sequential fill gradient utilizing all colors from the Flexoki light palette. This is useful for extensive continuous data representation. ```APIDOC ## scale_fill_flexoki_light_spectrum ### Description Creates a sequential fill gradient using all colors from the Flexoki light palette ### Usage ```R scale_fill_flexoki_light_spectrum(direction = 1, ...) ``` ### Arguments `direction` | Sets the direction of the color scale (1 = default, -1 = reversed) `...` | Additional arguments passed to scale_fill_gradientn() ### Value A sequential ggplot2 fill scale ### Examples ```R library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_light_spectrum() ``` ``` -------------------------------- ### scale_color_flexoki_light_spectrum Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Applies a sequential color gradient using all available colors from the Flexoki light palette, with an option to reverse the direction. ```APIDOC ## scale_color_flexoki_light_spectrum ### Description Creates a sequential color gradient using all colors from the Flexoki light palette. ### Arguments - `direction` (numeric) - Sets the direction of the color scale (1 = default, -1 = reversed). - `...` - Additional arguments passed to scale_color_gradientn(). ### Value A sequential ggplot2 color scale. ### Example ```R library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_light_spectrum() ``` ``` -------------------------------- ### Continuous Color Scale with Flexoki Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Creates a continuous color scale using Flexoki color palettes. Accepts 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'magenta' palettes. ```r scale_color_flexoki_continuous(palette = "red", ...) ``` ```r library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_color_flexoki_continuous(palette = "blue") ``` -------------------------------- ### scale_fill_flexoki_dark_distiller Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Creates a sequential fill gradient based on the Flexoki dark color palette. This scale is appropriate for sequential data where a gradient is desired. ```APIDOC ## scale_fill_flexoki_dark_distiller ### Description Creates a sequential fill gradient based on the Flexoki dark color palette ### Usage ```R scale_fill_flexoki_dark_distiller(palette = "blue", direction = 1, ...) ``` ### Arguments `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() ### Value A sequential ggplot2 fill scale ``` -------------------------------- ### Discrete Color Scale with Flexoki Light Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Applies the discrete Flexoki light color scale to a ggplot. Requires the ggplot2 library. ```r ggplot(mpg, aes(class, fill = class)) + geom_bar() + scale_fill_flexoki_light() ``` -------------------------------- ### Import IBM Plex Sans Font for Charts Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Imports the IBM Plex Sans font for use in charts. The 'hrbrthemes.loadfonts' option should be TRUE for font registration. ```r import_plex_sans() ``` -------------------------------- ### Generate Bright Qualitative Palette Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Generates a bright qualitative color palette. Can be used with scales::show_col to visualize. ```r ft_pal() ``` -------------------------------- ### Spectrum Color Scale Across Flexoki Dark Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Creates a sequential color gradient using all colors from the Flexoki dark palette. The direction argument controls the scale orientation. ```r scale_color_flexoki_dark_spectrum(direction = 1, ...) ``` -------------------------------- ### Discrete Color and Fill Scales Based on FT Palette Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Provides discrete color and fill scales based on the FT palette. See `ft_pal()` for more details. ```r scale_colour_ft(...) ``` ```r scale_color_ft(...) ``` ```r scale_fill_ft(...) ``` -------------------------------- ### Import Roboto Condensed font for use in charts Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Imports the Roboto Condensed font for use in charts. It also ensures that the 'hrbrthemes.loadfonts' option is set to TRUE, which will call 'extrafont::loadfonts()' to register non-core fonts with R PDF & PostScript devices. If running under Windows, it calls the same function to register non-core fonts with the Windows graphics device. This function also handles ensuring PDF/PostScript usage and displays the location of the font directory after the base import is complete. ```APIDOC ## Import Roboto Condensed font for use in charts ### Description Roboto Condensed is a trademark of Google. ### Usage ```R import_roboto_condensed() ``` ### Details 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. ### Note 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. ``` -------------------------------- ### scale_colour_ft, scale_color_ft, scale_fill_ft Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Provides discrete color and fill scales based on the FT palette. Refer to `ft_pal()` for more details on the palette. ```APIDOC ## Discrete color & fill scales based on the FT palette ### Description See `ft_pal()`. ### Usage ```R scale_colour_ft(...) scale_color_ft(...) scale_fill_ft(...) ``` ### Arguments - `...` - Additional arguments passed to the respective scale functions. ``` -------------------------------- ### Flexoki Light Discrete Fill Scale Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Applies a discrete fill scale using the Flexoki light color palette. Ideal for categorical data where distinct, light colors are needed. ```r library(ggplot2) ggplot(mtcars, aes(factor(cyl), fill = factor(cyl))) + geom_bar() + scale_fill_flexoki_light() ``` -------------------------------- ### Continuous Fill Scale with Flexoki Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Use this scale for continuous fill gradients with Flexoki color palettes. Specify the desired palette name (e.g., 'blue'). ```r library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_continuous(palette = "blue") ``` -------------------------------- ### Sequential Color Scale Using Flexoki Dark Spectrum Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Use this for sequential color scales with the Flexoki dark spectrum. Requires the ggplot2 library. ```r library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_dark_spectrum() ``` -------------------------------- ### Extended Flexoki Color Palettes Variable Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html A list containing 8 color palettes, each with 13 shades for continuous color interpolation, based on the extended Flexoki scheme. ```r flexoki_extended ``` -------------------------------- ### Import IBM Plex Sans font for use in charts Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Imports the IBM Plex Sans font for use in charts. It also ensures that the 'hrbrthemes.loadfonts' option is set to TRUE, which will call 'extrafont::loadfonts()' to register non-core fonts with R PDF & PostScript devices. If running under Windows, it calls the same function to register non-core fonts with the Windows graphics device. ```APIDOC ## Import IBM Plex Sans font for use in charts ### Description IBM Plex Sans is a trademark of IBM and distributed under the SIL Open Font License, Version 1.1. ### Usage ```R import_plex_sans() ``` ### Details 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. ``` -------------------------------- ### Flexoki Dark Spectrum Fill Scale Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Creates a sequential fill gradient using all colors from the Flexoki dark palette. Suitable for visualizations requiring a broad range of sequential dark colors. ```r library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_dark_spectrum() ``` -------------------------------- ### Distiller Color Scale with Flexoki Dark Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Generates a sequential color gradient based on the Flexoki dark palette. Direction can be set to 1 (default) or -1 for reversed scale. ```r scale_color_flexoki_dark_distiller(palette = "blue", direction = 1, ...) ``` ```r library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_dark_distiller(palette = "blue") ``` -------------------------------- ### scale_fill_flexoki_dark Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Creates a discrete fill scale using the Flexoki dark color palette. This scale is useful for mapping discrete or categorical data to fill aesthetics. ```APIDOC ## scale_fill_flexoki_dark ### Description Discrete Fill Scale Using Flexoki Dark Colors ### Usage ```R scale_fill_flexoki_dark(...) ``` ### Arguments `...` | Additional arguments passed to scale_fill_manual() ### Value A discrete ggplot2 fill scale ### Examples ```R library(ggplot2) ggplot(mtcars, aes(factor(cyl), fill = factor(cyl))) + geom_bar() + scale_fill_flexoki_dark() ``` ``` -------------------------------- ### Import Public Sans Font for Charts Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Imports the Public Sans font for use in charts. Font registration with R devices is handled if 'hrbrthemes.loadfonts' is TRUE. ```r import_public_sans() ``` -------------------------------- ### Import Public Sans font for use in charts Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Imports the Public Sans font for use in charts. It also ensures that the 'hrbrthemes.loadfonts' option is set to TRUE, which will call 'extrafont::loadfonts()' to register non-core fonts with R PDF & PostScript devices. If running under Windows, it calls the same function to register non-core fonts with the Windows graphics device. ```APIDOC ## Import Public Sans font for use in charts ### Description Public Sans is Copyright 2015 Impallari Type and licensed under the SIL Open Font License, Version 1.1 ### Usage ```R import_public_sans() ``` ### Details 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. ``` -------------------------------- ### Distiller Fill Scale Across All Flexoki Dark Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Creates a sequential fill gradient using all colors from the Flexoki dark palette. This scale is useful for visualizing continuous data with a distinct color range. ```APIDOC ## scale_fill_flexoki_dark_spectrum ### Description Creates a sequential fill gradient using all colors from the Flexoki dark palette ### Usage ```R scale_fill_flexoki_dark_spectrum(direction = 1, ...) ``` ### Arguments `direction` | Sets the direction of the color scale (1 = default, -1 = reversed) `...` | Additional arguments passed to scale_fill_gradientn() ### Value A sequential ggplot2 fill scale ### Examples ```R library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_dark_spectrum() ``` ``` -------------------------------- ### Discrete Fill Scale with Flexoki Dark Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Applies a discrete fill scale using the Flexoki dark color palette. This is suitable for categorical data. ```r library(ggplot2) ggplot(mtcars, aes(factor(cyl), fill = factor(cyl))) + geom_bar() + scale_fill_flexoki_dark() ``` -------------------------------- ### Continuous Color Scale with Flexoki Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Applies a continuous color scale from the Flexoki palette to a ggplot. Requires the ggplot2 library. ```r ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_continuous(palette = "blue") ``` -------------------------------- ### scale_color_flexoki_dark_spectrum Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Applies a sequential color scale using the dark spectrum of the Flexoki palette. It accepts additional arguments for customization. ```APIDOC ## scale_color_flexoki_dark_spectrum ### Description Sets the direction of the color scale (1 = default, -1 = reversed). ### Arguments - `direction` (numeric) - Sets the direction of the color scale (1 = default, -1 = reversed). - `...` - Additional arguments passed to scale_color_gradientn(). ### Value A sequential ggplot2 color scale. ### Example ```R library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_dark_spectrum() ``` ``` -------------------------------- ### theme_ipsum_ps Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html A precise & pristine ggplot2 theme with opinionated defaults and an emphasis on typography. Requires importing 'IBMPlexSans' fonts. ```APIDOC ## theme_ipsum_ps ### Description A precise & pristine ggplot2 theme with opinionated defaults and an emphasis on typography. You should `import_plex_sans()` first and install the fonts on your system before trying to use this theme. ### Usage ```r 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 ) ``` ### Arguments `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 `⁠[blmcrt]⁠` `plot_margin` | plot margin (specify with ggplot2::margin) `grid_col` | grid color `grid` | panel grid (`TRUE`, `FALSE`, or a combination of `X`, `x`, `Y`, `y`) `axis_col` | axis color `axis` | add x or y axes? `TRUE`, `FALSE`, "`xy`" `ticks` | ticks if `TRUE` add ticks ### Details 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. ### Why IBM Plex Sans? It's free, has tolerable kerning pairs and multiple weights. It's also different "not Helvetica". ### Examples ```r ## 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) ``` ``` -------------------------------- ### Flexoki Dark Distiller Fill Scale Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Applies a sequential fill gradient using the Flexoki dark palette. Use when a dark, sequential color scheme is desired. ```r library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_flexoki_dark_distiller(palette = "blue") ``` -------------------------------- ### FT Color Palette Variables Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Character vector for text color and a list for the FT color palette. ```r ft_cols ft_text_col ``` -------------------------------- ### Set FT Theme Geom Defaults Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Applies custom light colors to default geoms for the FT theme. ```r ft_geom_defaults() ``` -------------------------------- ### ggplot2 Scatterplot with theme_ipsum_rc Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Demonstrates applying the theme_ipsum_rc theme to a ggplot2 scatterplot. Requires loading the ggplot2 and dplyr libraries. The plot includes custom labels for title, subtitle, and caption. ```R 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() ``` -------------------------------- ### Distiller Color Scale Using Flexoki Dark Colors Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Creates a sequential color gradient based on the Flexoki dark color palette. This is useful for continuous data visualization in ggplot2. ```APIDOC ## Distiller Color Scale Using Flexoki Dark Colors ### Description Creates a sequential color gradient based on the Flexoki dark color palette ### Usage ```R scale_color_flexoki_dark_distiller(palette = "blue", direction = 1, ...) ``` ### Arguments `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() ### Value A sequential ggplot2 color scale ### Examples ```R library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, color = density)) + geom_point() + scale_color_flexoki_dark_distiller(palette = "blue") ``` ``` -------------------------------- ### Import Inter font for use in charts Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Imports the Inter font for use in charts. It also ensures that the 'hrbrthemes.loadfonts' option is set to TRUE, which will call 'extrafont::loadfonts()' to register non-core fonts with R PDF & PostScript devices. If running under Windows, it calls the same function to register non-core fonts with the Windows graphics device. ```APIDOC ## Import Inter font for use in charts ### Description Inter is Copyright (c) 2016-2024 The Inter Project Authors ### Usage ```R import_inter() ``` ### Details 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. ``` -------------------------------- ### theme_ipsum_rc Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html A precise & pristine ggplot2 theme with opinionated defaults and an emphasis on typography. Requires importing 'Public Sans' fonts. ```APIDOC ## theme_ipsum_rc ### Description A precise & pristine ggplot2 theme with opinionated defaults and an emphasis on typography. You should `import_public_sans()` first and install the fonts on your system before trying to use this theme. ``` -------------------------------- ### Roboto Condensed Font Aliases Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html R variable aliases for Roboto Condensed font faces. Note that 'Roboto Condensed Light' may cause warnings on Windows. ```r font_rc font_rc_light ``` -------------------------------- ### Change geom defaults from black to white for the modern theme Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Changes geom defaults from black to white for the modern theme. ```APIDOC ## Change geom defaults from black to white for the modern theme ### Description Change geom defaults from black to white for the modern theme ### Usage ```R modern_geom_defaults() ``` ``` -------------------------------- ### Import Roboto Condensed Font Source: https://cran.r-project.org/web/packages/hrbrthemes/refman/hrbrthemes.html Imports the Roboto Condensed font for use in R charts. May load additional fonts via extrafont::loadfonts() based on an option. ```r import_econ_sans() ```