The NSW Government typeface is Public Sans. Recommendations:
ragg::agg_png(). These devices should be
used by default by RStudio if {ragg} is installed.theme_waratah() sets default fonts, styles, and colour
palettes for plots. You can set the theme globally with
ggplot2::set_theme() or add it to an individual plot. If
using any global options like
options(waratah.colour_theme = "aboriginal"), make sure to
do this before setting the theme.
See vignette("cookbook") for some examples of using the
theme.
The NSW palettes are designed around two grids consisting of colour columns and tonal rows. Guidelines for charts suggest techniques for ensuring good contrast so that your charts are accessible.
Individual colours are available by name,
e.g. nsw_colours$blue_01.
To access colours using the grid system, use pal_nsw().
We can visualise the colours with a utility from the scales package:
This gave us the first two tones of blue followed by the first two
tones of red. Importantly, pal_nsw() always provides a
discrete colour palette.
To use that with ggplot as a discrete colour scale, you can use:
or scale_fill_discrete() to set the fill scale. In case
you need a continuous scale, ggplot will automatically interpolate the
colours:
Instead of working directly with the grid, you can instead use
pal_waratah(). Specify the pattern of your data and you
will get a reasonable discrete or continous scale. Note that this makes
it harder to follow the chat recommendations mentioned above, but it can
be more convenient for scientific data visualisation.
For qualitative data, a mix of tonal rows 1 and 2 are chosen to avoid overly-similar colours:
There are also palettes for sequential and diverging continuous data that allow a choice of the base hue:
Because pal_waratah() considers colour similarity, you
can request that it also take into account colour vision disorders:
To make that choice globally, set:
Colour palettes in waratah allow a variant to be specified, including
the default variant = "base" and the Aboriginal palette
variant = "aboriginal". See pal_nsw() for
details.
The logo is included in PNG format:
library(magick)
#> Linking to ImageMagick 6.9.12.98
#> Enabled features: fontconfig, freetype, fftw, heic, lcms, pango, raw, webp, x11
#> Disabled features: cairo, ghostscript, rsvg
#> Using 4 threads
image_path <- system.file(
"images",
"nsw-gov-logo-primary.png",
package = "waratah"
)
image_read(image_path)