This theme will produce ggplots that follow NAFO plot guidelines:
Font: Cambria 9pt.
Plot Border: black 0.5 pt. No borders around entire graph, just plot. Borders around legend (0.5pt) if possible.
Tick Marks to the inside on x & y axis
Graph lines: 0.75 pt, black if possible, otherwise grey
Plot size: Height 6.4 cm, width 11.5 cm.
The helper values .nafo_lwd, .nafo_height, and .nafo_width can be used to impose consistent graph line widths, plot heights, and plot widths, respectively.
theme_nafo(base_size = 9, base_family = "Cambria")
base font size
base font family
ggplot2::theme_minimal
library(ggplot2)
set.seed(123)
d <- data.frame(SSB = rlnorm(40), Recruitment = rlnorm(40),
Species = c(rep("Cod", 20), rep("Plaice", 20)))
ggplot(d) +
geom_point(aes(x = SSB, y = Recruitment, shape = Species),
fill = "white", color = "black", shape = 21,
size = .nafo_pts, stroke = .nafo_stroke) +
geom_hline(aes(yintercept = mean(Recruitment)),
linetype = 2, size = .nafo_lwd) +
theme_nafo()
#> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
#> ℹ Please use `linewidth` instead.
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead
#> Warning: font family 'Cambria' not found, will use 'sans' instead