bw plots

Figures

Fig 1

library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.3.3
fig <- ggplot(iris, aes(Sepal.Length, fill = Species)) + geom_density(alpha = 0.7)
fig +theme_bw(base_size=14)

Fig 2

library(colorblindr)
## Loading required package: colorspace
cvd_grid(fig)

Fig 3

g_bar <- ggplot() +
  geom_bar(
    data = mpg,
    mapping = aes(y = class, fill = drv)
  )
g_bar + scale_fill_grey() +
  theme_bw(base_size=18)

Fig 4

g <- ggplot() +
  geom_point(
    data = mpg,
    mapping = aes(x = displ, y = class, colour = drv)
  )
g +
  scale_colour_grey() +
  theme_bw(base_size=18)

Fig 5

mpg |>
  dplyr::count(class, drv) |>
  ggplot() +
  geom_col(
    mapping = aes(x = n, y = class, fill = drv),
    position = position_dodge2(preserve = "single", width = 1)
  ) +
  geom_text(
    mapping = aes(
      x = n + 0.5, y = class,
      group = drv,
      label = paste0("drv:", drv)
    ),
    position = position_dodge2(preserve = "single", width = 1),
    hjust = 0
  ) +
  scale_fill_grey() +
  scale_x_continuous(limits = c(0, 60)) +
  theme_bw(base_size=14)