insperplot

June 2, 2026 · View on GitHub

R-CMD-check Lifecycle:
stable

insperplot extends ggplot2 with Insper Instituto de Ensino e Pesquisa visual identity, providing custom themes, color palettes, and specialized plotting functions for academic and institutional use. Insper is a non-profit institution dedicated to teaching and research.

Installation

Install insperplot from CRAN:

install.packages("insperplot")

Or install the development version from GitHub:

# install.packages("remotes")
remotes::install_github("portalcidados/insperplot")

Quick Start

insperplot is built upon Insper’s brand colors. To improve functionality, additional palettes were created based on these basic colors.

To use insperplot we recommend using ggplot2. The basic functions of the package are theme_insper() and the scale_*_insper_*() functions.

library(insperplot)
library(ggplot2)
library(ragg)

# Create a basic plot with Insper theme
ggplot(mtcars, aes(x = wt, y = mpg, fill = factor(cyl))) +
  geom_point(color = "#ffffff", size = 4, shape = 21, alpha = 0.9) +
  scale_fill_insper_d(name = NULL) +
  theme_insper() +
  labs(
    title = "Fuel Efficiency vs Weight",
    subtitle = "Motor Trend Car Road Tests",
    x = "Weight (1000 lbs)",
    y = "Miles per Gallon"
  )

The package is based on Insper’s brand colors.

# View available colors
show_insper_colors()

insperplot includes several pre-defined palettes:

  • main: Primary Insper colors
  • reds, oranges, teals, grays: Sequential single-color gradients
  • diverging, red_teal, red_teal_ext: Diverging palettes for data with a meaningful center
  • bright, contrast: Qualitative palettes for categorical data
  • categorical, accent: Additional color options

Use list_palettes() to see all available palettes with detailed information. To visualize the colors in each palette, use show_insper_palette():

show_insper_palette()

Main Functions

  • theme_insper(): Apply Insper’s visual identity to ggplot2 plots.
  • scale_color_insper_d() / scale_fill_insper_d(): Discrete color scales.
  • scale_color_insper_c() / scale_fill_insper_c(): Continuous color scales.
  • show_insper_palette(): Visualize available color palettes.
  • insper_*(): Specialized plotting functions.

Fonts and Rendering

insperplot bundles the Inter, EB Garamond, and Playfair Display font families (all licensed under the SIL Open Font License). These fonts are registered automatically when the package is loaded — no manual download or setup required.

The default title font is Georgia, a system serif font pre-installed on most operating systems. If Georgia is unavailable, the theme falls back to the bundled serif fonts.

For the best rendering quality, install the ragg graphics device:

install.packages(“ragg”)

If you use RStudio, set the graphics backend to AGG: Tools > Global Options > General > Graphics > Backend > AGG. Positron users can skip this step since it uses ragg by default.

Documentation

For detailed documentation and examples, visit the package website.

License

MIT ©