30 Day Map Challange

ggplot2
GIS

Day 1: Health Facilities in Somalia

Public health facilities per 100,000 people in Somalia. Using the WHO health facilities data for Somalia. only about 4 public health facilities are available for every 100,000 people.

Show the code
# Facilities per 100,000 people
coverage <- population_admin2_2026 %>%
  summarise(population = sum(population_total), .by = admin1_name) %>%
  rename(admin1name = admin1_name) %>%
  left_join(count(st_drop_geometry(facilities), admin1name, name = "facilities"),
            by = "admin1name") %>%
  mutate(
    facilities = replace_na(facilities, 0),
    per_100k   = facilities / population * 1e5
  )

national_rate <- sum(coverage$facilities) / sum(coverage$population) * 1e5

# Map
map <- ggplot() +
  geom_sf(data = admin0, fill = pal$land, colour = NA) +
  geom_sf(data = admin2, fill = NA, colour = pal$adm2, linewidth = 0.2, linetype = "22") +
  geom_sf(data = admin1, fill = NA, colour = pal$adm1, linewidth = 0.3) +
  geom_sf(data = admin0, fill = NA, colour = pal$adm0, linewidth = 0.4) +
  geom_sf(data = arrange(facilities, desc(type)),
          aes(colour = type, size = type), shape = 16) +
  scale_colour_manual(values = deframe(select(facility_types, type, colour))) +
  scale_size_manual(values = deframe(select(facility_types, type, size)), guide = "none") +
  guides(colour = guide_legend(nrow = 1, override.aes = list(size = 2.6))) +
  coord_sf(xlim = c(40.8, 54.2), ylim = c(-1.9, 12.2), expand = FALSE) +
  labs(
    title    = "Health Facility Coverage in Somalia",
    subtitle = sprintf("%s public health facilities across Somalia with %.1f health facilities for every 100,000 people.",
                       format(nrow(facilities), big.mark = ","), national_rate),
    caption  = paste(
      "#30DayMapChallenge 2026 | Day 1: Points",
      "Data: ©WHO Somalia health facilities (HDX, 2023)",
      "github.com/axmedmaxamuud/geosom",
      sep = "\n"
    )
  ) +
  theme_day01

# Chart: facilities per 100,000 people by region
chart <- ggplot(coverage, aes(per_100k, fct_reorder(admin1name, per_100k))) +
  geom_col(fill = pal$bar, width = 0.55) +
  geom_text(aes(label = sprintf("%.1f", per_100k)),
            hjust = -0.2, size = 3, family = font, colour = pal$muted) +
  scale_x_continuous(expand = expansion(mult = c(0, 0.25))) +
  labs(title = "Public health facilities\nper 100,000 people") +
  theme_void(base_family = font) +
  theme(
    plot.title.position = "plot",
    plot.title  = element_text(size = 11.5, colour = pal$ink, margin = margin(b = 6)),
    axis.text.y = element_text(size = 9.5, colour = pal$ink, hjust = 1, margin = margin(r = 4))
  )

# produce final map
day01 <- map +
  inset_element(chart, left = 0.665, bottom = 0.02, right = 0.99, top = 0.47, align_to = "panel")

day01

Map of public health facilities in Somalia by type, with a bar chart of facilities per 100,000 people by region.

Day 2: Streets of Mogadishu

This map shows the street network of Mogadishu using OpenStreetMap data. some of the well know junctions of KM4, Ex control Afgooye and Balcad are marked.

Show the code
day02 <- ggplot() +
  geom_sf(data = sea,  fill = pal$sea,  colour = NA) +
  geom_sf(data = land, fill = pal$land, colour = NA) +
  geom_sf(data = streets, aes(colour = class, linewidth = class, alpha = class), lineend = "round") +
  scale_colour_manual(values = deframe(select(road_classes, class, colour)), guide = "none") +
  scale_linewidth_manual(values = deframe(select(road_classes, class, width)), guide = "none") +
  scale_alpha_manual(values = deframe(select(road_classes, class, alpha)), guide = "none") +

  # key junctions: white dot with a navy ring, name on a navy tab
  geom_point(data = junctions, aes(x, y), shape = 21, size = 3.6,
             fill = "white", colour = pal$land, stroke = 1.4) +
  geom_label(data = junctions, aes(x + nx, y + ny, label = name, hjust = hjust),
             family = font, size = 4.1, colour = "white", fill = pal$land,
             label.size = 0, label.r = unit(0, "lines"), label.padding = unit(0.22, "lines")) +

  # title across the top, on a solid navy band
  annotate("rect", xmin = xlim[1], xmax = xlim[2], ymin = ylim[2] - H * 0.115, ymax = ylim[2],
           fill = pal$land) +
  annotate("text", x = cx, y = ylim[2] - H * 0.058, label = spaced("MOGADISHU"),
           family = font, fontface = "bold", size = 17, colour = "white") +

  # legend, bottom right over the sea: a road sample and its name
  annotate("segment", x = legend_items$x0, xend = legend_items$x1,
           y = legend_items$y, yend = legend_items$y,
           colour = legend_items$colour, linewidth = legend_items$width * 1.5,
           alpha = pmax(legend_items$alpha, 0.75), lineend = "round") +
  annotate("text", x = legend_items$x1 + W * 0.025, y = legend_items$y, label = legend_items$class,
           family = font, size = 4.2, colour = "white", hjust = 0) +

  # footnote, bottom left over the sea
  annotate("text", x = xlim[1] + W * 0.04, y = ylim[1] + H * 0.035,
           label = paste0("#30DayMapChallenge 2026  |  Day 2: Lines\n",
                          "Streets © OpenStreetMap contributors (ODbL)\n",
                          "github.com/axmedmaxamuud/geosom"),
           family = font, size = 3, colour = shade(pal$sea, 0.55), lineheight = 1.15,
           hjust = 0, vjust = 0) +

  coord_sf(crs = crs_utm, datum = NA, xlim = xlim, ylim = ylim, expand = FALSE) +
  theme_void() +
  theme(plot.background = element_rect(fill = pal$sea, colour = NA),
        plot.margin = margin(0, 0, 0, 0))

day02

Map of Mogadishu's street network. Main roads are bold yellow, secondary roads pale yellow, tertiary roads white and local streets fine white lines. KM4, Ex Control Afgooye and Ex Control Balcad junctions are marked.

Day 3: Landcover of Riverine Areas in Somalia

The land cover of riverine areas in Somalia. only 3% of the 9.8 million hectors of land is farmed with river water while the bigest share of farms are rainfed.

Show the code
day03b <- ggplot() +
  geom_sf(data = ocean, fill = pal$sea, colour = NA) +
  geom_sf(data = admin_lines, colour = pal$line, linewidth = 0.6) +
  geom_sf(data = somalia_border, colour = shade(wfp[["navy"]], 0.55), linewidth = 0.7) +
  # land cover, no outlines so the patchwork of fields shows
  geom_sf(data = landcover, aes(fill = class), colour = NA) +
  # the rivers: a navy line inside a white casing, visible on every colour
  geom_sf(data = rivers, colour = "white", linewidth = 1.6, lineend = "round") +
  geom_sf(data = rivers, colour = wfp[["blue"]], linewidth = 0.7, lineend = "round") +
  scale_fill_manual(values = deframe(select(classes, class, colour)), guide = "none") +

  # towns
  geom_point(data = towns, aes(x, y), shape = 21, size = 1.9, fill = "white", colour = pal$ink, stroke = 0.6) +
  geom_label(data = towns, aes(x + nx, y, label = town, hjust = hjust),
             family = font, size = 3.4, colour = pal$ink, fill = alpha("white", 0.75),
             label.size = 0, label.r = unit(0.1, "lines"), label.padding = unit(0.12, "lines")) +
  # region names: small, spaced navy capitals
  geom_text(data = regions, aes(x, y, label = label),
            family = font, size = 2.6, fontface = "bold", colour = shade(wfp[["navy"]], 0.35)) +
  # river names, curved along the rivers
  geom_text(data = bind_rows(juba_label, shabelle_label), aes(x, y, label = label, angle = angle),
            family = font, fontface = "bold.italic", size = 4.2, colour = "white") +

  # title block, top left over empty land
  annotate("text", x = xlim[1] + W * 0.04, y = ylim[2] - H * 0.035, hjust = 0, vjust = 1,
           label = "Riverine Landcover", family = font, fontface = "bold", size = 8.5, colour = pal$ink) +
  annotate("text", x = xlim[1] + W * 0.04, y = ylim[2] - H * 0.09, hjust = 0, vjust = 1, lineheight = 1.2,
           label = sprintf(paste0(
             "Land cover in Somalia's Juba and Shabelle River, 2007\n",
             "%.1f million hectares: %d%% bush and woodland, %d%% rainfed farms.\n",
             "Only %d%% is farmed with river water."),
             total_ha / 1e6, round(wood_s * 100), round(rainfed_s * 100), round(water_ha / total_ha * 100)),
           family = font, size = 3.6, colour = pal$ink) +

  # legend: area bar, then the classes
  annotate("text", x = lx0, y = ly + H * 0.022, hjust = 0, label = "Share of the mapped area",
           family = font, size = 3.6, colour = pal$ink, fontface = "bold") +
  annotate("rect", xmin = legend_bar$x0, xmax = legend_bar$x1, ymin = ly - H * 0.006, ymax = ly + H * 0.008,
           fill = legend_bar$colour, colour = NA) +
  annotate("rect", xmin = lx0, xmax = lx0 + W * 0.022, ymin = legend_rows$y - H * 0.0065,
           ymax = legend_rows$y + H * 0.0065, fill = legend_rows$colour) +
  annotate("text", x = lx0 + W * 0.035, y = legend_rows$y, hjust = 0, label = legend_rows$label,
           family = font, size = 3.4, colour = pal$ink) +

  # footnote, at the bottom right over the sea, with space below the legend
  annotate("text", x = lx0, y = ylim[1] + H * 0.018, hjust = 0, vjust = 0, lineheight = 1.15,
           label = paste0("#30DayMapChallenge 2026  |  Day 3: Polygons\n",
                          "Data: FAO SWALIM, Landcover of Riverine Areas (2007)\n\n"),
           family = font, size = 2.9, colour = pal$muted) +

  coord_sf(crs = crs_utm, datum = NA, xlim = xlim, ylim = ylim, expand = FALSE) +
  theme_void() +
  theme(plot.background = element_rect(fill = "white", colour = NA),
        plot.margin = margin(0, 0, 0, 0))

day03b

Land cover map of the Juba and Shabelle river valleys in southern Somalia, 2007. Bush and woodland in dark green covers most of the valleys, with rainfed farms in yellow, rangeland in lime, and thin strips of irrigated and flood-recession farms in blue and orange along the two rivers. Region names, main towns and a legend of each land use's share of the area are shown.