Skip to contents

This is an R Package for customizing the ggplot2 aesthetics. See also text2map.

Installation and Usage

library(remotes)
install_gitlab("culturalcartography/text2map.theme")

# Basic setup (uses viridis colors)
text2map.theme::set_theme()

Global Palette Options

text2map.theme includes three pre-defined palette options designed for both digital display and print:

# Default: Perceptually uniform (best for digital/accessibility)
text2map.theme::set_theme(palette = "viridis")

# Grayscale: Best for textbook printing
text2map.theme::set_theme(palette = "grayscale")

# Warm Gray: Softer alternative for print
text2map.theme::set_theme(palette = "warm_gray")

Note: This setting applies globally to all subsequent ggplot plots.

Viridis Grayscale Warm Gray

Font Configuration

The package bundles Open Sans and Lato fonts for offline use. To enable these, set set_font = TRUE.

# Use Lato instead of default Open Sans
text2map.theme::set_theme(set_font = TRUE, base_family = "Lato")

# Use 'extrafont' for legacy support (showtext is default/recommended)
text2map.theme::set_theme(set_font = TRUE, font_method = "extrafont")

Rendering Recommendation: We recommend font_method = "showtext" (default) for best cross-platform rendering.

There are four related packages hosted on GitLab:

The above packages can be installed using the following:

install.packages("text2map")

library(remotes)
install_gitlab("culturalcartography/text2map.corpora")
install_gitlab("culturalcartography/text2map.pretrained")
install_gitlab("culturalcartography/text2map.dictionaries")

Contributions and Support

If you have any suggestions to improve this theme – especially for accessibility – send us an email (maintainers [at] textmapping.com) or submit pull requests.

Please report any issues or bugs here: https://gitlab.com/culturalcartography/text2map.theme/-/issues