Skip to content

Instantly share code, notes, and snippets.

@tukachev
Created November 26, 2025 19:16
Show Gist options
  • Select an option

  • Save tukachev/666f92f5d7d87172b5a928f96eee44af to your computer and use it in GitHub Desktop.

Select an option

Save tukachev/666f92f5d7d87172b5a928f96eee44af to your computer and use it in GitHub Desktop.
library(tidyverse)
library(sf)
library(rnaturalearth)
library(rnaturalearthdata)
library(ggrepel)
# Загружаем карты
world <- ne_countries(scale = "medium", returnclass = "sf")
countries <- c(
"Russia",
"Kazakhstan",
"Belarus",
"Ukraine",
"Moldova",
"Armenia",
"Azerbaijan",
"Georgia",
"Uzbekistan",
"Tajikistan",
"Kyrgyzstan",
"Turkmenistan"
)
baltic_countries <- c("Lithuania", "Latvia", "Estonia")
region_countries <- c(countries, baltic_countries)
region <- world %>%
filter(admin %in% region_countries)
russia <- region %>% filter(admin == "Russia")
kazakhstan <- region %>% filter(admin == "Kazakhstan")
others_region <- region %>% filter(!admin %in% c("Russia", "Kazakhstan"))
# Задаем проекцию LCC
crs_lcc <- "+proj=lcc +lat_1=55 +lat_2=65 +lat_0=60 +lon_0=100 +datum=WGS84 +units=km"
russia_lcc <- st_transform(russia, crs_lcc)
kazakhstan_lcc <- st_transform(kazakhstan, crs_lcc)
others_region_lcc <- st_transform(others_region, crs_lcc)
# Координаты космодромов
sites_real <- tribble(
~ name, ~ lon, ~ lat,
"Плесецк", 40.5667, 62.9256,
"Капустин Яр", 45.7450, 48.5820,
"Байконур", 63.30778, 45.96611,
"Восточный", 128.3339, 51.8844,
# "Свободный", 128.1225, 51.7608, #Исключаем Свободный
"Никольск", 59.84694, 51.09333 #В сериале Никольск это Ясный
)
sites_sf <- st_as_sf(sites_real, coords = c("lon", "lat"), crs = 4326) %>%
st_transform(crs_lcc)
coords_plot <- sites_sf %>%
bind_cols(st_coordinates(sites_sf))
# Визуализируем
subtitle_txt <- "События сериала разворачиваются на вымышленном космодроме «Никольск», расположение которого совпадает с реальным «Ясным». На карте показаны основные российские космодромы и «Байконур». Закрытый в 2007 году космодром «Свободный» не включён."
map <- ggplot() +
theme_void() +
theme(
plot.caption = element_text(
family = "PT Sans",
size = 14,
color = "gray50",
hjust = 0,
margin = margin(t = 20)
),
plot.margin = margin(20, 20, 20, 20),
plot.title.position = "plot",
plot.caption.position = "plot",
plot.title = element_text(
family = "Roboto",
size = 19,
face = "bold",
hjust = 0,
margin = margin(b = 10)
),
plot.subtitle = element_text(
family = "Roboto",
color = "gray30",
size = 14,
hjust = 0,
margin = margin(b = 15)
),
text = element_text(family = "PT Sans", size = 16),
plot.background = element_rect(fill = "white", color = NA),
panel.background = element_rect(fill = "white", color = NA)
) +
geom_sf(
data = others_region_lcc,
fill = "grey85",
color = "white",
size = 0.3
) +
# Казахстан
geom_sf(
data = kazakhstan_lcc,
fill = "grey85",
color = "white",
size = 0.3
) +
# Россия
geom_sf(
data = russia_lcc,
fill = "#2A78B4",
color = "white",
size = 0
) +
# Точки
geom_sf(
data = sites_sf,
size = 5,
shape = 21,
fill = "red",
color = "white",
stroke = 0.9
) +
# Подписи
geom_text_repel(
family = "PT Sans",
data = coords_plot,
aes(x = X, y = Y, label = name),
color = "white",
size = 4.5,
segment.size = 0.3,
box.padding = 0.5,
nudge_y = 80,
bg.color = "gray30",
bg.r = 0.1
) +
labs(title = "Карта космодромов России в сериале «Митрич» (2025)",
subtitle = str_wrap(subtitle_txt, 70),
caption = "Юрий Тукачев, ноябрь 2025 | @weekly_charts")
map
ggsave(
"map_cosmodromes.png",
map,
width = 8,
height = 7,
dpi = 300
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment