No description
- R 99.4%
- Rez 0.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| man | ||
| R | ||
| tests | ||
| vignettes | ||
| .gitignore | ||
| .Rbuildignore | ||
| DESCRIPTION | ||
| LICENSE | ||
| LICENSE.md | ||
| NAMESPACE | ||
| NEWS.md | ||
| nordtheme.Rproj | ||
| README.md | ||
| README.Rmd | ||
nordtheme
nordtheme is an implementation of Nord
Theme for ggplot2.
Installation
You can install nordtheme like so:
pak::pak("git::https://git.nikolaydudaev.com/ndudaev/nordtheme.git")
or like so
remotes::install_git("https://git.nikolaydudaev.com/ndudaev/nordtheme.git")
Examples
Dark Mode
Dark mode looks like this with discrete colours:
library(ggplot2)
library(nordtheme)
# Discrete colours: scatter by group
ggplot(mpg, aes(displ, hwy, colour = class)) +
geom_point(size = 2.2, alpha = 0.9) +
scale_colour_nord_d() +
labs(title = "Engine size vs. highway mileage",
subtitle = "Discrete 'mixed' palette: Frost and Aurora interleaved",
x = "Displacement (L)", y = "Highway MPG", colour = NULL,
caption = "Data: ggplot2::mpg") +
theme_nord("dark")
…and continuous fill might look like this:
# Continuous sequential fill
ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
geom_raster() +
scale_fill_nord_c("dark") +
coord_cartesian(expand = FALSE) +
labs(title = "Old Faithful eruptions",
subtitle = "Sequential scale: low density fades into the background") +
theme_nord("dark")
Light Mode
And light mode looks like this when using facets:
# Unmapped geoms + facets: tests default ink (ggplot2 >= 4.0) and strips
ggplot(mpg, aes(hwy)) +
geom_histogram(binwidth = 2, fill = nord[["nord9"]]) +
facet_wrap(~drv) +
labs(title = "Highway MPG by drivetrain", x = "Highway MPG", y = "Count") +
theme_nord("light")
This is an example with semantic colors:
# Semantic status colours
status <- data.frame(
day = rep(1:7, each = 3),
level = factor(rep(c("ok", "warning", "error"), 7),
levels = c("ok", "warning", "error")),
n = c(120, 14, 3, 132, 9, 1, 110, 22, 6, 128, 11, 2,
140, 7, 0, 98, 30, 9, 125, 12, 2)
)
ggplot(status, aes(day, n, fill = level)) +
geom_col(width = 0.7) +
scale_fill_nord_status() +
labs(title = "Events per day by severity",
subtitle = "Semantic scale from Nord's own state colours",
x = "Day", y = "Events", fill = NULL) +
theme_nord("light")