Skip to contents

Add the component with p + locale_forma(...). Complete Mosaic and Pie charts localize their own layers, original category scales and facet strips. Radar uses the standard ggplot label registration described below. The spoke names, raw ticks and value labels remain as supplied to the Radar plot. Statistical calculations, data keys, coordinates and facet membership use the original data. An author-supplied scale or facet keeps its own labels. Additional layers and theme overrides are carried into the returned plot.

Usage

locale_forma(lang, dictionary = NULL, region = NULL, ..., labels = NULL)

Arguments

lang

Display language tag passed to locale_info().

dictionary

Local dictionary accepted by forma_translate(). Omitting this argument reuses the plot's dictionary. Explicit NULL clears it.

region

Optional region override for locale_info().

...

Additional settings for locale_info(), including number, percent, date and break locales, text direction and font family.

labels

Optional named character vector of literal dictionary IDs. Names can be title, subtitle, caption, tag, x, y, colour or fill.

Value

A ggplot2 addition. Adding it returns a standard ggplot.

Details

On any standard ggplot you can register literal title or axis-label IDs with labels. For example, labels = c(title = "visits") looks up the ID visits in dictionary context plot.title. Later locale switches use that ID. A subsequent labs() override takes precedence until the field is explicitly registered again. Third-party layer text, custom label callbacks and mathematical expressions remain under the author's control.

Examples

d <- data.frame(site = c("N", "S"), n = c(16, 24))
dict <- data.frame(variable = "site", id = c("N", "S"), lang = "en",
                   label = c("North", "South"))
ggpie(d, "site", "n") + locale_forma("en", dictionary = dict)