themefurmanu
July 27, 2025 · View on GitHub
knitr::opts_chunk$set(echo = TRUE)
library(ggplot2)
library(themefurmanu)
# Note: Font checking happens automatically when package loads
themefurmanu
The themefurmanu package provides a custom ggplot2 theme and font registration functions using Furman University’s visual identity.
Note that this is not an official package from Furman University. It is a personal project to help with visual consistency in data visualizations across teams at Furman that use R.
Installation
# From GitHub
devtools::install_github("scottamoore/themefurmanu")
Optional: IBM Plex Fonts
For the authentic Furman University branding experience, install IBM Plex fonts:
- Download IBM Plex Sans and IBM Plex Sans Condensed from Google Fonts
- Install the fonts on your system
- Restart R/RStudio
- Use
theme_furmanu(base_family = "IBM Plex Sans")in your plots
The package works perfectly with system fonts (the default), but IBM Plex fonts provide the complete visual identity.
# Check what fonts are available (optional)
register_furmanu_fonts()
# Use IBM Plex fonts if installed
ggplot(data, aes(x, y)) +
geom_point() +
theme_furmanu(base_family = "IBM Plex Sans")
The themefurmanu Approach: One Function, Many Possibilities
Instead of learning multiple function names like scale_color_viridis_d(), scale_color_brewer(), etc., themefurmanu uses two main functions with parameters:
scale_color_furmanu(palette = "name", discrete = TRUE/FALSE, ...)scale_fill_furmanu(palette = "name", discrete = TRUE/FALSE, ...)
This approach is more intuitive and consistent across all use cases.
Quick Start
library(ggplot2)
library(themefurmanu)
# Basic scatter plot with categorical colors
ggplot(mtcars, aes(x = wt, y = mpg, color = factor(cyl))) +
geom_point(size = 3) +
scale_color_furmanu(palette = "main", discrete = TRUE) +
theme_furmanu() +
labs(
title = "Fuel Efficiency by Car Weight",
subtitle = "Colored by number of cylinders",
x = "Weight (1000 lbs)",
y = "Miles per Gallon",
color = "Cylinders",
caption = "Source: mtcars dataset"
)
Available Palettes
View all available palettes with their intended use cases:
show_furmanu_palettes()
# Get detailed information about palettes
list_palettes()
Palette Types and Usage Guide
Categorical Data (Discrete Groups)
For discrete categories like species, groups, or factors:
# Use the "main" palette for up to 6 categories
ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
geom_point(size = 3, alpha = 0.8) +
scale_color_furmanu(palette = "main", discrete = TRUE) +
theme_furmanu() +
labs(
title = "Iris Species Comparison",
subtitle = "Using categorical color palette",
x = "Sepal Length", y = "Sepal Width"
)
Sequential Data (Continuous, One Direction)
For continuous data that goes from low to high:
# Use sequential palettes for continuous data
ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
geom_tile() +
scale_fill_furmanu(palette = "sequential1", discrete = FALSE) +
theme_furmanu() +
labs(
title = "Old Faithful Eruption Patterns",
subtitle = "Using sequential color palette",
x = "Waiting Time (min)", y = "Eruption Duration (min)",
fill = "Density"
)
Divergent Data (Continuous, Two Directions)
For data that diverges from a meaningful center point:
# Create divergent data
mtcars$mpg_diff <- mtcars$mpg - mean(mtcars$mpg)
ggplot(mtcars, aes(x = wt, y = hp, color = mpg_diff)) +
geom_point(size = 4) +
scale_color_furmanu(
palette = "divergent1",
discrete = FALSE,
midpoint = 0 # This is key for divergent scales!
) +
theme_furmanu() +
labs(
title = "Car Performance vs Fuel Efficiency",
subtitle = "Color shows deviation from average MPG",
x = "Weight (1000 lbs)", y = "Horsepower",
color = "MPG\nDifference"
)
Theme Variants
Standard Theme
ggplot(mpg, aes(displ, hwy)) +
geom_point(color = furmanu_cols("purple"), alpha = 0.7) +
theme_furmanu() +
labs(title = "Standard Furman Theme")
Presentation Theme
ggplot(mpg, aes(displ, hwy)) +
geom_point(color = furmanu_cols("purple"), alpha = 0.7) +
theme_furmanu_presentation() +
labs(title = "Presentation Theme")
Minimal Theme
ggplot(mpg, aes(displ, hwy)) +
geom_point(color = furmanu_cols("purple"), alpha = 0.7) +
theme_furmanu_minimal() +
labs(title = "Minimal Theme")
Advanced Features
Color Accessibility
# Check contrast ratios
check_contrast("main")
# Find accessible combinations
head(accessible_combinations())
Palette Export
# Export as CSS variables
export_palette("main", format = "css")
# Export as JSON
export_palette("divergent1", format = "json")
Tips for Effective Use
- Start with palette exploration: Use
show_furmanu_palettes()to see all options - Choose the right type:
- Categorical → "main" or "cool"
- Sequential → "sequential1", "sequential2", "sequential3"
- Divergent → "divergent1", "divergent2", "divergent3"
- Use
discrete = FALSEfor continuous data - Add
midpoint = 0for divergent continuous scales - Check accessibility: Use
check_contrast()for important visualizations - Match theme to context: Use
theme_furmanu_presentation()for slides
Getting Help
# Complete function reference and examples
?themefurmanu_help
# Package overview with all functions
?themefurmanu-overview
# Visual palette overview
show_furmanu_palettes()
# Complete tutorial
open_furmanu_demo()
# Quick reference guide
open_furmanu_reference()
# Help for specific functions
?scale_color_furmanu
?theme_furmanu
?show_furmanu_palettes
# List all package functions
help(package = "themefurmanu")
# Get detailed palette information
palette_info("main")
See also open_furmanu_demo() to view the comprehensive example Quarto file with detailed tutorials and advanced techniques.