India

Day 22 of 30DayMapChallenge. 2 colors
R
spatial
datavisualization
30DayMapChallenge
Author

Michaël

Published

2024-11-22

Modified

2024-11-22

A photo of Holi festivities in India

Holi 2016-01 – CC-BY-NC-ND by Rajesh Pamnani

Day 22 of 30DayMapChallenge: « 2 colours » (previously).

Just a joke…

Config

library(dplyr)
library(rnaturalearth)
library(ggplot2)
library(glue)

Data

Data from Natural Earth.

countries <- ne_countries(scale = 110, returnclass = "sf")

Map

countries |> 
  ggplot() +
  geom_sf(aes(fill = if_else(sovereignt == "India", sovereignt, "Outdia")), 
          color = "gold3") +
  scale_x_continuous(expand = c(0, 0)) +
  scale_y_continuous(expand = c(0, 0)) +
  scale_fill_manual(name = "", 
                    values = list("India" = "indianred2",
                                  "Outdia" = "gold1")) +
  coord_sf(crs = "+proj=eqearth") +
  labs(title = "भारत",
       caption = glue("https://r.iresmi.net/ - {Sys.Date()}
                      data: Natural Earth")) +
  theme_void() +
  theme(plot.title = element_text(color = "indianred3", 
                                  size = 16,
                                  face = "bold"),
        plot.caption = element_text(size = 6, 
                                    color = "darkgrey"),
        plot.margin = unit(c(1, 2, 1, 2), "mm"))
Map of India vs the rest of the world
Figure 1: India/Outdia