| Title: | Color Palettes and 'ggplot2' Extensions for Data Visualization |
|---|---|
| Description: | Provides 'ggplot2' scale functions and a custom theme derived from the 'Benvi' visual identity of QuintoAndar Group (discontinued in 2024). Offers qualitative, sequential, and diverging color palettes with both discrete and continuous scale variants. |
| Authors: | Vinicius Oike [aut, cre, cph] |
| Maintainer: | Vinicius Oike <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.2.0 |
| Built: | 2026-06-19 16:35:32 UTC |
| Source: | https://github.com/viniciusoike/benviplot |
Construction of the package is inspired by the ghibli package.
benvi_palette( pal_name = "qual_2", n, direction = 1, type = c("discrete", "continuous") )benvi_palette( pal_name = "qual_2", n, direction = 1, type = c("discrete", "continuous") )
pal_name |
Name of the palette. Defaults to "qual_2". |
n |
Number of colors desired. Sets have 4 colors, Qual have 8 colors. |
direction |
Either |
type |
Either "continuous" or "discrete". Continuous automatically interpolates between the colors. |
A vector of characters with color attribute
# Use default palette benvi_palette() # Specify palette name benvi_palette("greens") benvi_palette("greens", n = 20, type = "continuous") benvi_palette("greens", n = 2, type = "discrete")# Use default palette benvi_palette() # Specify palette name benvi_palette("greens") benvi_palette("greens", n = 20, type = "continuous") benvi_palette("greens", n = 2, type = "discrete")
Reports whether Poppins is available and whether the ragg graphics device
is installed.
font_status()font_status()
Invisibly returns a list with poppins_available and ragg_available.
font_status()font_status()
Formats numbers using Brazilian locale conventions: period (.) as thousands
separator and comma (,) as decimal separator. This is a convenient wrapper
to both the format and round base functions to convert numeric vectors
into character labels for tables or plots.
format_num_br(x, digits = 1, percent = FALSE)format_num_br(x, digits = 1, percent = FALSE)
x |
A numeric vector |
digits |
Number of decimal places to include. Can be negative to round to tens, hundreds, etc. |
percent |
Logical indicating if % symbol should be appended |
Brazilian number formatting uses:
Thousands separator: . (period)
Decimal separator: , (comma)
For example, 1234567.89 becomes "1.234.567,9" (with digits = 1).
A character vector with formatted numbers
# Basic formatting x <- 1235134.123 format_num_br(x) # Different decimal places format_num_br(x, digits = 3) format_num_br(x, digits = 0) # With percentage format_num_br(12.5, digits = 1, percent = TRUE) # Negative digits round to tens, hundreds, etc. format_num_br(1234567, digits = -3) # Works with vectors format_num_br(c(100, 1000, 10000))# Basic formatting x <- 1235134.123 format_num_br(x) # Different decimal places format_num_br(x, digits = 3) format_num_br(x, digits = 0) # With percentage format_num_br(12.5, digits = 1, percent = TRUE) # Negative digits round to tens, hundreds, etc. format_num_br(1234567, digits = -3) # Works with vectors format_num_br(c(100, 1000, 10000))
These functions provide the option to use Benvi colors inside continuous
palettes with the ggplot2 package.
scale_colour_benvi_c(pal_name = "benvi_blue", direction = 1, ...) scale_color_benvi_c(pal_name = "benvi_blue", direction = 1, ...) scale_fill_benvi_c(pal_name = "benvi_blue", direction = 1, ...)scale_colour_benvi_c(pal_name = "benvi_blue", direction = 1, ...) scale_color_benvi_c(pal_name = "benvi_blue", direction = 1, ...) scale_fill_benvi_c(pal_name = "benvi_blue", direction = 1, ...)
pal_name |
Name of the palette. Defaults to "qual_2". |
direction |
Either |
... |
Arguments to pass on to |
A ScaleContinuous object that can be added to a ggplot object
library(ggplot2) ggplot(mtcars, aes(x = wt, y = mpg, color = hp)) + geom_point() + scale_color_benvi_c("benvi_blue")library(ggplot2) ggplot(mtcars, aes(x = wt, y = mpg, color = hp)) + geom_point() + scale_color_benvi_c("benvi_blue")
A wrapper around ggplot2::ggsave() with smart defaults optimized for
benviplot graphics. Automatically uses the ragg graphics device for PNG
output when available, ensuring high-quality rendering with proper font
support and no DPI issues.
If ragg is not installed, falls back to the default graphics device.
ggsave_benvi( filename, plot = ggplot2::last_plot(), device = NULL, width = 7, height = 5, units = "in", dpi = 300, ... )ggsave_benvi( filename, plot = ggplot2::last_plot(), device = NULL, width = 7, height = 5, units = "in", dpi = 300, ... )
filename |
File name to create on disk. The file extension determines the graphics device (e.g., ".png", ".pdf", ".svg"). |
plot |
Plot to save. Defaults to the last plot displayed. |
device |
Device to use. Defaults to "ragg" for PNG files if ragg package is installed, otherwise uses ggplot2's default device selection. |
width, height
|
Plot size in units. Defaults to 7 x 5 inches. |
units |
Units for width and height ("in", "cm", "mm", "px"). Default is "in". |
dpi |
DPI to use for raster graphics. Default is 300 for high quality. |
... |
Additional arguments passed to |
Invisibly returns the filename.
p <- ggplot2::ggplot(mtcars, ggplot2::aes(wt, mpg)) + ggplot2::geom_point() ggsave_benvi(tempfile(fileext = ".png"), plot = p)p <- ggplot2::ggplot(mtcars, ggplot2::aes(wt, mpg)) + ggplot2::geom_point() ggsave_benvi(tempfile(fileext = ".png"), plot = p)
Historical rental price index data from QuintoAndar. This is the legacy IQA
index, which has been superseded by the IQAIW (see iqaiw).
iqaiqa
A data frame with 96 observations and 6 variables:
Date of the observation (first day of month)
Name of the municipality (city)
Rental price index, normalized to 100 at first observation
Monthly percent variation of the index (decimal form)
12-month accumulated variation of the index (decimal form)
Estimated rental price per square meter (R$/m²)
QuintoAndar
# To visualize the dataset head(iqa) str(iqa) # Plot index over time for all cities library(ggplot2) ggplot(iqa, aes(x = date, y = index, color = name_muni)) + geom_line() + scale_color_benvi_d(pal_name = "qual_9", name = "City") + labs( title = "IQAIW: Rental Price Index", x = "Date", y = "Index (base = 100)" ) + theme_benvi(base_family = "sans")# To visualize the dataset head(iqa) str(iqa) # Plot index over time for all cities library(ggplot2) ggplot(iqa, aes(x = date, y = index, color = name_muni)) + geom_line() + scale_color_benvi_d(pal_name = "qual_9", name = "City") + labs( title = "IQAIW: Rental Price Index", x = "Date", y = "Index (base = 100)" ) + theme_benvi(base_family = "sans")
The IQAIW (Índice QuintoAndar ImovelWeb) is a rental index for major Brazilian cities. The index is based on both new rental contracts (managed by QuintoAndar) and online listings from QuintoAndar's listings (including ImovelWeb).
iqaiwiqaiw
A data frame with 1,660 observations across 6 cities and multiple time periods:
Date of the observation (first day of month)
Name of the municipality. One of: Belo Horizonte, Brasília, Curitiba, Porto Alegre, Rio de Janeiro, São Paulo
Number of rooms in the property, or "Total" for city-level aggregate
Rental price index, normalized to 100 at first observation per city
Monthly percent variation of the index (decimal form)
12-month accumulated variation of the index (decimal form)
Estimated rental price per square meter (R$/m²)
The IQAIW was developed in 2023 and replaced the former IQA index. Given the change in methodology and data sources, the IQAIW is not directly comparable to the IQA index.
Formally, the index is a hedonic double imputed index, controlling for quality changes using a flexible GAM specification with location variables. In this sense, the IQAIW is more theoretically sound than median stratified indices like FipeZap or the former IQA. The mixture of listings and contracts, however, lacks theoretical support and seems to be mainly driven by branding purposes.
The ImovelWeb brand was purchased by QuintoAndar in 2021-22 and the IQAIW symbolizes the merging of both brands. In other words, the original IQA could've been improved simply by adopting a hedonic methodology, without the need to mix data sources.
# To visualize the dataset head(iqaiw) str(iqaiw) # Plot index over time for all cities library(ggplot2) iqaiw_rooms <- subset(iqaiw, rooms != "Total" & !is.na(acum12m)) ggplot(iqaiw_rooms, aes(x = date, y = acum12m, color = rooms)) + geom_line(lwd = 0.5) + geom_hline(yintercept = 0) + scale_color_benvi_d(pal_name = "qual_6", name = "Rooms") + facet_wrap(vars(name_muni), ncol = 3, scales = "free") + labs( title = "IQAIW: Rental Price Index", x = "Date", y = "Index (base = 100)" ) + theme_benvi(base_family = "sans")# To visualize the dataset head(iqaiw) str(iqaiw) # Plot index over time for all cities library(ggplot2) iqaiw_rooms <- subset(iqaiw, rooms != "Total" & !is.na(acum12m)) ggplot(iqaiw_rooms, aes(x = date, y = acum12m, color = rooms)) + geom_line(lwd = 0.5) + geom_hline(yintercept = 0) + scale_color_benvi_d(pal_name = "qual_6", name = "Rooms") + facet_wrap(vars(name_muni), ncol = 3, scales = "free") + labs( title = "IQAIW: Rental Price Index", x = "Date", y = "Index (base = 100)" ) + theme_benvi(base_family = "sans")
Plot an area chart
plot_area( data, x, y, fill = NULL, zero = TRUE, order = TRUE, pal_name = "qual_benvi", scale_name = "", scale_label = ggplot2::waiver(), text = FALSE, text_color = "gray20", text_family = getOption("theme_benvi.font_family", "sans"), text_size = 3, position = "stack", position_text = "identity" )plot_area( data, x, y, fill = NULL, zero = TRUE, order = TRUE, pal_name = "qual_benvi", scale_name = "", scale_label = ggplot2::waiver(), text = FALSE, text_color = "gray20", text_family = getOption("theme_benvi.font_family", "sans"), text_size = 3, position = "stack", position_text = "identity" )
data |
A data.frame type object |
x |
< |
y |
< |
fill |
Fill color for the area. Either a color string (e.g., |
zero |
Logical indicating whether a horizontal line crossing the y = 0 axis should be plotted. |
order |
Logical indicating if the stacked areas should be ordered.
Default behavior ( |
pal_name |
String indicating the name of which palette to use. |
scale_name |
String indicating fill legend title. |
scale_label |
String indicating fill legend labels. |
text |
Logical indicating if text labels should be plotted on column bars |
text_color |
Color of the text label. Default is |
text_family |
Font of the text label. Defaults to |
text_size |
Size of the text label. Default is |
position |
Argument passed to |
position_text |
Argument passed on to |
A ggplot2 plot
# Simple area chart sao_paulo <- subset(iqa, name_muni == "S\u00e3o Paulo") plot_area(data = sao_paulo, x = date, y = index) # Stacked area chart with fill mapping total <- subset(iqaiw, rooms == "Total") plot_area(data = total, x = date, y = index, fill = name_muni)# Simple area chart sao_paulo <- subset(iqa, name_muni == "S\u00e3o Paulo") plot_area(data = sao_paulo, x = date, y = index) # Stacked area chart with fill mapping total <- subset(iqaiw, rooms == "Total") plot_area(data = total, x = date, y = index, fill = name_muni)
Plot a column chart
plot_column( data, x, y, fill = NULL, zero = TRUE, text = FALSE, text_inside = FALSE, text_place = NULL, text_padding = NULL, pal_name = "qual_benvi", scale_name = "", scale_label = ggplot2::waiver(), digits = 0, percent = FALSE, text_color = "gray20", text_family = getOption("theme_benvi.font_family", "sans"), text_size = 3, position_col = "stack", position_text = position_col, ... )plot_column( data, x, y, fill = NULL, zero = TRUE, text = FALSE, text_inside = FALSE, text_place = NULL, text_padding = NULL, pal_name = "qual_benvi", scale_name = "", scale_label = ggplot2::waiver(), digits = 0, percent = FALSE, text_color = "gray20", text_family = getOption("theme_benvi.font_family", "sans"), text_size = 3, position_col = "stack", position_text = position_col, ... )
data |
A data.frame type object |
x |
< |
y |
< |
fill |
Fill color for the columns. Either a color string (e.g.,
|
zero |
Logical indicating whether a horizontal line crossing the y = 0 axis should be plotted. |
text |
Logical indicating if text labels should be plotted on column bars |
text_inside |
Logical indicating if text labels should be placed inside bars (using ggfittext). When TRUE, text is auto-sized to fit inside bars. When FALSE (default), text appears above/beside bars at fixed size. |
text_place |
Placement of inside text. One of "top", "bottom", "left", "right", "centre"/"center". Only used when text_inside = TRUE. Defaults to "centre". |
text_padding |
Padding around inside text as grid::unit(). Only used when text_inside = TRUE. Defaults to 1mm. |
pal_name |
String indicating the name of which palette to use. |
scale_name |
String indicating fill legend title. |
scale_label |
String indicating fill legend labels. |
digits |
Number of digits to show in text labels. |
percent |
Logical indicating if a % should be appended to text labels |
text_color |
Color of the text label. Default is |
text_family |
Font of the text label. Defaults to |
text_size |
Size of the text label. Default is |
position_col |
Argument passed on to |
position_text |
Argument passed on to |
... |
Further arguments for |
A ggplot2 plot
# Column chart by city at the latest date latest <- subset(iqa, date == max(iqa$date)) plot_column(data = latest, x = name_muni, y = index) # With text labels above bars plot_column(data = latest, x = name_muni, y = index, text = TRUE) # With text labels inside bars latest <- subset(iqa, date == max(iqa$date)) plot_column(data = latest, x = name_muni, y = index, text = TRUE, text_inside = TRUE)# Column chart by city at the latest date latest <- subset(iqa, date == max(iqa$date)) plot_column(data = latest, x = name_muni, y = index) # With text labels above bars plot_column(data = latest, x = name_muni, y = index, text = TRUE) # With text labels inside bars latest <- subset(iqa, date == max(iqa$date)) plot_column(data = latest, x = name_muni, y = index, text = TRUE, text_inside = TRUE)
Plot a histogram chart
plot_histogram( data, x, color = "#FFFFFF", fill = NULL, pal_name = "qual_benvi", scale_name = "", zero = TRUE, bins = NULL, method = "fd", density = FALSE, facet = FALSE, ... )plot_histogram( data, x, color = "#FFFFFF", fill = NULL, pal_name = "qual_benvi", scale_name = "", zero = TRUE, bins = NULL, method = "fd", density = FALSE, facet = FALSE, ... )
data |
A data.frame type object |
x |
< |
color |
Color of the column border. Defaults to |
fill |
Fill color for the columns. Either a color string (e.g., |
pal_name |
String indicating the name of which palette to use when
|
scale_name |
String indicating fill legend title. |
zero |
Logical indicating if a horizontal (y = 0) line should be drawn on the plot. |
bins |
Number of bins. When specified, overrides |
method |
Character specifying the binning algorithm. Must be one of:
|
density |
Logical indicating if density should be plotted on y-axis. |
facet |
< |
... |
Additional parameters to |
The method parameter controls which algorithm is used to compute the optimal
bin width. Available methods:
"fd" or "FD"
Freedman-Diaconis rule (default). Robust to
outliers, uses IQR. Formula: . Best for most
distributions.
"Scott"Scott's rule. Uses standard deviation. Formula:
. Works well for normal-like distributions.
"Sturges"Sturges' formula. Simple logarithmic rule. Formula:
bins. Good for roughly normal data.
"Rice"Rice rule. Cube root based. Formula:
bins. General purpose rule.
"sqrt"Square root rule. Formula:
bins. Simple, tends to oversmooth.
When in doubt, use the default "fd" (Freedman-Diaconis), which is robust
and works well across different distributions.
A ggplot2 object
set.seed(5) tbl <- data.frame(x = rnorm(n = 1000)) # Default parameters use Freedman-Diaconis plot_histogram(data = tbl, x = x) # Use bins to manually choose number of bins plot_histogram(data = tbl, x = x, bins = 50) # Example of alternative methods: square root and Rice plot_histogram(data = tbl, x = x, method = "sqrt") plot_histogram(data = tbl, x = x, method = "Rice") # Facet by rooms category spo <- subset(iqaiw, name_muni == "S\u00e3o Paulo" & rooms != "Total") plot_histogram(data = spo, x = index, facet = rooms)set.seed(5) tbl <- data.frame(x = rnorm(n = 1000)) # Default parameters use Freedman-Diaconis plot_histogram(data = tbl, x = x) # Use bins to manually choose number of bins plot_histogram(data = tbl, x = x, bins = 50) # Example of alternative methods: square root and Rice plot_histogram(data = tbl, x = x, method = "sqrt") plot_histogram(data = tbl, x = x, method = "Rice") # Facet by rooms category spo <- subset(iqaiw, name_muni == "S\u00e3o Paulo" & rooms != "Total") plot_histogram(data = spo, x = index, facet = rooms)
Title
plot_line( data, x, y, color = NULL, zero = TRUE, point = FALSE, pal_name, scale_name = "", scale_label = ggplot2::waiver(), ... )plot_line( data, x, y, color = NULL, zero = TRUE, point = FALSE, pal_name, scale_name = "", scale_label = ggplot2::waiver(), ... )
data |
A data.frame type object. |
x |
< |
y |
< |
color |
Color of the line. Either a color string (e.g., |
zero |
Logical indicating if a horizontal line (y = 0) should be drawn on the plot. |
point |
Logical indicating if points should be drawn on top of line. |
pal_name |
String indicating which color palette to use. |
scale_name |
String indicating color legend title. |
scale_label |
String indicating color legend labels. |
... |
Other arguments to ggplot2 function. |
A ggplot2 plot
# Single series sao_paulo <- subset(iqa, name_muni == "S\u00e3o Paulo") plot_line(data = sao_paulo, x = date, y = index) # Multiple series with color mapping total <- subset(iqaiw, rooms == "Total") plot_line(data = total, x = date, y = index, color = name_muni)# Single series sao_paulo <- subset(iqa, name_muni == "S\u00e3o Paulo") plot_line(data = sao_paulo, x = date, y = index) # Multiple series with color mapping total <- subset(iqaiw, rooms == "Total") plot_line(data = total, x = date, y = index, color = name_muni)
Plot a scatter chart
plot_scatter( data, x, y, color = NULL, fit = FALSE, fit_variable = FALSE, fit_method = "auto", fit_formula = NULL, fit_color = NULL, fit_ci = FALSE, zero = "none", pal_name = "qual_benvi", scale_name = "", scale_label = ggplot2::waiver(), ... )plot_scatter( data, x, y, color = NULL, fit = FALSE, fit_variable = FALSE, fit_method = "auto", fit_formula = NULL, fit_color = NULL, fit_ci = FALSE, zero = "none", pal_name = "qual_benvi", scale_name = "", scale_label = ggplot2::waiver(), ... )
data |
A data.frame type object |
x |
< |
y |
< |
color |
Color of the points. Either a color string (e.g., |
fit |
Logical indicating if a regression line should be plotted on top of the chart. |
fit_variable |
Logical indicating if regression should be grouped.
Defaults to |
fit_method |
Type of model to generate regression line. See |
fit_formula |
A formula for fit_method. See |
fit_color |
Color of the fitted regression line. Only applied when
|
fit_ci |
Logical indicating if confidence interval should be plotted.
Defaults to |
zero |
Draws axis lines. Must be one of |
pal_name |
String indicating the name of which palette to use. |
scale_name |
String indicating fill legend title. |
scale_label |
String indicating fill legend labels. |
... |
Further arguments to |
A ggplot2 plot.
plot_scatter(data = mtcars, x = wt, y = mpg) # With regression line plot_scatter(data = mtcars, x = wt, y = mpg, fit = TRUE)plot_scatter(data = mtcars, x = wt, y = mpg) # With regression line plot_scatter(data = mtcars, x = wt, y = mpg, fit = TRUE)
Sales price data at a region level for major Brazilian cities. Contains contract prices per square meter, allowing comparison across cities and zones.
sales_reportsales_report
A data frame with 272 observations across multiple cities and zones:
Date of the observation (first day of month)
Name of the municipality (city). Includes: Belo Horizonte, Rio de Janeiro, and São Paulo
Name of the zone within the city
Median contract price per square meter (R$/m²)
This dataset provides zone-level granularity, showing sales prices for specific regions within cities.
QuintoAndar (Sales Report 2020-Q1/2023-Q3). https://publicfiles.data.quintoandar.com.br/sale_report/RelatorioCV_4T_2022.pdf
# Compare contract prices across zones library(ggplot2) bhe_sales <- subset(sales_report, name_muni == "Belo Horizonte" & date == max(date)) bhe_sales$name_zone <- factor( bhe_sales$name_zone, levels = bhe_sales$name_zone[order(bhe_sales$price_m2)] ) ggplot(bhe_sales, aes(x = price_m2, y = name_zone)) + geom_col(fill = benvi_palette("benvi_blue")[3]) + theme_benvi(base_family = "sans")# Compare contract prices across zones library(ggplot2) bhe_sales <- subset(sales_report, name_muni == "Belo Horizonte" & date == max(date)) bhe_sales$name_zone <- factor( bhe_sales$name_zone, levels = bhe_sales$name_zone[order(bhe_sales$price_m2)] ) ggplot(bhe_sales, aes(x = price_m2, y = name_zone)) + geom_col(fill = benvi_palette("benvi_blue")[3]) + theme_benvi(base_family = "sans")
Functions to use ggplot2 scales with Benvi colors.
scale_colour_benvi_d(pal_name = "qual_benvi", direction = 1, ...) scale_color_benvi_d(pal_name = "qual_benvi", direction = 1, ...) scale_fill_benvi_d(pal_name = "qual_benvi", direction = 1, ...)scale_colour_benvi_d(pal_name = "qual_benvi", direction = 1, ...) scale_color_benvi_d(pal_name = "qual_benvi", direction = 1, ...) scale_fill_benvi_d(pal_name = "qual_benvi", direction = 1, ...)
pal_name |
Name of the palette. |
direction |
Either |
... |
additional arguments to pass to discrete_scale |
library(ggplot2) # Discrete color scale with rental index data iqaiw_total <- subset(iqaiw, rooms == "Total") ggplot(iqaiw_total, aes(x = date, y = index, colour = name_muni)) + geom_line() + scale_color_benvi_d("qual_benvi")library(ggplot2) # Discrete color scale with rental index data iqaiw_total <- subset(iqaiw, rooms == "Total") ggplot(iqaiw_total, aes(x = date, y = index, colour = name_muni)) + geom_line() + scale_color_benvi_d("qual_benvi")
Visually displays all available Benvi palettes in a grid layout, modeled on
RColorBrewer::display.brewer.all(). Optionally filter by palette type.
show_palettes(type = "all", n = NULL)show_palettes(type = "all", n = NULL)
type |
Character string specifying the palette type to display. One of:
|
n |
Number of colors to display from each palette. If |
Invisibly returns NULL. Called for its side effect of creating a plot.
# Display all palettes show_palettes() # Display only theme palettes show_palettes("theme") # Display sequential palettes show_palettes("sequential")# Display all palettes show_palettes() # Display only theme palettes show_palettes("theme") # Display sequential palettes show_palettes("sequential")
A ggplot2 base theme for Benvi styled plots.
The Poppins font is bundled with the package and registered automatically on
load when systemfonts is installed. When both systemfonts and ragg are
available, the theme uses Poppins by default. Otherwise it falls back to the
system's default sans-serif font.
Registered fonts only work with systemfonts-aware devices (e.g.
ragg::agg_png). Base R devices (PDF, PostScript) cannot render them. If you
see font warnings when saving to PDF, pass base_family = "sans" or set
options(theme_benvi.font_family = "sans"). See font_status() to check
your setup.
theme_benvi( base_family = getOption("theme_benvi.font_family", default_font_family()), base_size = 10, background = FALSE )theme_benvi( base_family = getOption("theme_benvi.font_family", default_font_family()), base_size = 10, background = FALSE )
base_family |
Argument passed to |
base_size |
Argument passed to |
background |
Logical. Adds an offwhite (creme) background to the plot. |
A ggplot2 theme object
library(ggplot2) series <- subset(iqaiw, name_muni == "S\u00e3o Paulo" & rooms == "Total") # Base theme (using "sans" for portability) ggplot(series, aes(date, index)) + geom_line(color = benvi_palette("benvi_blue")[1], lwd = 1) + labs(x = NULL, y = "Index (base = 100)", title = "IQAIW") + theme_benvi(base_family = "sans") # Optional offwhite (creme) background ggplot(series, aes(date, index)) + geom_line(color = benvi_palette("benvi_blue")[1], lwd = 1) + labs(x = NULL, y = "Index (base = 100)", title = "IQAIW") + theme_benvi(base_family = "sans", background = TRUE) ## Not run: # Use Poppins with a ragg device (requires systemfonts and ragg) ggplot(series, aes(date, index)) + geom_line(color = benvi_palette("benvi_blue")[1], lwd = 1) + labs(x = NULL, y = "Index (base = 100)", title = "IQAIW") + theme_benvi(base_family = "Poppins") ## End(Not run)library(ggplot2) series <- subset(iqaiw, name_muni == "S\u00e3o Paulo" & rooms == "Total") # Base theme (using "sans" for portability) ggplot(series, aes(date, index)) + geom_line(color = benvi_palette("benvi_blue")[1], lwd = 1) + labs(x = NULL, y = "Index (base = 100)", title = "IQAIW") + theme_benvi(base_family = "sans") # Optional offwhite (creme) background ggplot(series, aes(date, index)) + geom_line(color = benvi_palette("benvi_blue")[1], lwd = 1) + labs(x = NULL, y = "Index (base = 100)", title = "IQAIW") + theme_benvi(base_family = "sans", background = TRUE) ## Not run: # Use Poppins with a ragg device (requires systemfonts and ragg) ggplot(series, aes(date, index)) + geom_line(color = benvi_palette("benvi_blue")[1], lwd = 1) + labs(x = NULL, y = "Index (base = 100)", title = "IQAIW") + theme_benvi(base_family = "Poppins") ## End(Not run)