Skip to content

Commit

Permalink
chapter 3: update fig label
Browse files Browse the repository at this point in the history
  • Loading branch information
rainer-rq-koelle committed May 7, 2024
1 parent aa63244 commit 382189b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 12 deletions.
25 changes: 17 additions & 8 deletions 03-traffic_characterisation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,10 @@ p_eur <- tfc_eur |> plot_timeline_per_year() + labs(subtitle = "Europe")
p_bra / p_eur + plot_layout(guides = "collect") & theme(legend.position = "top")
```



* For Brazil, traffic in the first half of 2023 exceeded the pre-pandemic traffic level
* On a network level, the continual recovery of the traffic is on-going in Europe.
* The first half of 2023 saw traffic levels at about 90-95% of the pre-pandemic network traffic and started following a classical *seasonal* pattern. However, traffic recovery in Europe is not at the same level for each pre-pandemic service/connection. The recovery also resulted in a light modification of network connectivity. The Russian invasion of Ukraine resulted in the closure of a significant portion of the airspace (about 20%). However, the overall impact of the closure on air traffic - on a network level - was relatively small.



This high-level network perspective shows that traffic in both regions is comparable to pre-pandemic levels.
It will be interesting to observe the further evolution and growth of air traffic.

Expand All @@ -216,8 +212,6 @@ p_share_of_network <- function(.annual_share_of_network_df){
return(p_share)
}
# BRAZIL ========= Airport Level Study
# Cleaning/prep process in Hugos-prep.qmd file(code lines 1826 to 1881)
Expand Down Expand Up @@ -268,6 +262,13 @@ study_apt_lvl <- study_apt_lvl |>
left_join(bra_apts_names, by = join_by(ICAO))
p_study1 <- study_apt_lvl |>
mutate(
NAME = case_match(NAME
, "Belo Horizonte" ~ "B.Horizonte"
, "Rio Dumont" ~ "R.Dumont"
, "Porto Alegre" ~ "P.Alegre"
, .default = NAME)
) |>
filter(!(YEAR == "2023")) |>
ggplot() +
geom_col(aes(x = NAME, y = TOT_FLTS_YEAR, fill = YEAR)
Expand All @@ -288,7 +289,11 @@ study_apt_lvl <- study_apt_lvl |>
# labs(x = NULL, y = NULL,)
#
# p_study1 / p_study2
```
```{r}
#| label: fig-bra-apt-tfc
#| fig.cap: Brazilian airport level traffic
#|
(p_share_of_network(tmp_annual_share) +
scale_x_discrete(guide = guide_axis(n.dodge = 2))
) + p_study1 +
Expand Down Expand Up @@ -362,8 +367,11 @@ p1_eur <- annual_tfc_apt |> ggplot() +
# labs(x = NULL, y = NULL,)
# p1_eur / p2_eur
```

```{r}
#| label: fig-eur-apt-level-tfc
#| fig-cap: Europeaan airport level traffic
# patch the 2 plots
(p_share_of_network(tmp) +
Expand Down Expand Up @@ -758,6 +766,7 @@ fm_apts_eur <- tfc_apts_eur |> fleet_mix_from_counts("EUR")
```{r}
#| label: fig-fleet-mix
#| fig-cap: Fleet mix observed at the study airports in 2023
#| fig-height: 7
key_year <- 2022
fm_apts <- bind_rows(fm_apts_bra, fm_apts_eur) |>
Expand Down
27 changes: 23 additions & 4 deletions _scope-airports-map.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ this_airports <- readr::read_csv("./data/airport-LAT-LON-NAME.csv", show_col_typ
worldmap <- ggplot2::borders("world2", colour="lightblue", fill="lightblue")
ggplot2::ggplot() + worldmap + theme_void()

library(ggplot2)
library(ggrepel)
library(rnaturalearth)
library(rnaturalearthdata)
library(patchwork)
library(ggrepel)

world <- ne_countries(scale = "medium", returnclass = "sf")
bra_map <- world |> dplyr::filter(admin == "Brazil")
Expand All @@ -38,16 +41,29 @@ eur_map <- ne_countries(
,"Germany","Belgium","Netherlands","Luxembourg"
,"Austria","Switzerland", "Italy"), scale = "medium")

bra_apts_coord <- this_airports |>
filter(grepl(pattern = "^SB", x = ICAO)) |>
mutate(NUDGE_X = case_when(
ICAO %in% c("SBSV") ~ -20
,.default = -10)
)

bra_chart <- ggplot2::ggplot() +
geom_sf(data = bra_map) +
geom_point(data = this_airports |> filter(grepl(pattern = "^SB", x = ICAO))
, aes(x = LON, y = LAT)) +
geom_label_repel(data = this_airports |> filter(grepl(pattern = "^SB", x = ICAO))
, aes(x = LON, y = LAT
, label = paste(ICAO, NAME)
, label = stringr::str_wrap(paste(ICAO, NAME), 8)
)

,position = ggpp::position_nudge_center(x = -2, y = 2,
center_x = 0, center_y = 0),
# label.size = NA,
label.padding = 0.2

, max.overlaps = Inf
, force = 50
# , force = 1
# , nudge_x = 5
) +
theme_void()
Expand All @@ -62,11 +78,14 @@ eur_chart <- ggplot2::ggplot() +
, aes(x = LON, y = LAT
, label = paste(ICAO, NAME)
)
, max.overlaps = Inf
, max.overlaps = 0
, force = 50
# , nudge_x = 5
) +
theme_void()

bra_chart + eur_chart
bra_chart

eur_chart


0 comments on commit 382189b

Please sign in to comment.