Du Bois Visualization Challenge 03

Bar plot
R
datavisualization
DuBoisChallenge
Author

Michaël

Published

2024-02-21

Modified

2024-02-25

Bar plot

Acres of land owned by negroes in Georgia – W.E.B Du Bois

Recreating the the data visualization of W.E.B Du Bois from the 1900 Paris Exposition using modern tools. See the challenge presentation.

Setup

library(tidyverse)
library(janitor)
library(showtext)
library(glue)

font_add_google("Play", family = "dubois")
showtext_auto()
options(scipen = 100)

Data

data_03 <- read_csv("data.csv") |> 
  clean_names() |> 
  arrange(desc(date)) |> 
  mutate(date = fct_inorder(factor(date)))

Plot

data_03 |> 
  ggplot(aes(date, land)) +
  geom_col(width = .5,
           fill = "#CB2A44", 
           color = "#CB2A44") +
  geom_text(data = bind_rows(slice_min(data_03, date, n = 1),
                             slice_max(data_03, date, n = 1)),
            aes(label = format(after_stat(y), big.mark = ",")), 
            family = "dubois",
            size = 5,
            position = position_stack(vjust = 0.5)) +
  scale_x_discrete() +
  coord_flip(ylim = c(0, NA), expand = FALSE) +
  labs(title = str_to_upper("Acres of land owned by negroes\nin Georgia."),
       x = "",
       y = "",
       caption = glue("https://r.iresmi.net/ - {Sys.Date()}
                      inspired by W.E.B Du Bois
                      data: https://github.com/ajstarks/dubois-data-portraits/tree/master/challenge/2024")) +
  theme_minimal() +
  theme(text = element_text(family = "dubois", size = 20, lineheight = .5),
        panel.background = element_rect(fill = NA, color = NA),
        panel.grid = element_blank(),
        axis.text.x = element_blank(),
        axis.text.y = element_text(size = 15),
        plot.title = element_text(size = 20, hjust = 0.5),
        plot.background = element_rect(fill = "#E6D4C3", color = NA),
        plot.margin = margin(.2, .3, .1, .3, "cm"),
        plot.caption = element_text(size = 10), 
        plot.caption.position = "plot")
Bar plot of Acres of land owned by negroes in Georgia in the Dubois style
Figure 1: Recreating Acres of land owned by negroes in Georgia