Create a radial bar chart to show top 10 cities with highest air pollution levels
Air pollution is a growing concern in urban environments.
We’ll visualize the AQI levels of the 10 most polluted cities.
We utilized a radial bar chart to visualize the top 10 cities with the highest air pollution levels. This type of chart effectively shows comparative values in a circular format.
library(ggplot2)
library(dplyr)
library(RColorBrewer)
air_pollution <- data.frame(
city = c(“Byrnihat”, “Delhi”, “Lahore”, “Hotan”, “Faisalabad”, “Ghaziabad”, “Noida”, “Baghpat”, “Peshawar”, “Lucknow”),
pm25 = c(128.2, 110.2, 97.4, 94.3, 92.5, 91.3, 89.7, 88.1, 86.9, 85.4) )
air_pollution <- air_pollution %>%
arrange(desc(pm25)) %>%
mutate(city = factor(city, levels = city))
ggplot(air_pollution, aes(x = city, y = pm25, fill = city)) +
geom_bar(stat = “identity”, width = 1, color = “white”) +
coord_polar(theta = “x”, start = 0) +
theme_minimal() +
labs(
title = “Top 10 Most Polluted Cities (PM2.5 µg/m³, 2024)”,
subtitle = “Data Source: Visual Capitalist”,
x = NULL,
y = NULL ) +
theme( axis.text.y = element_blank(),
axis.ticks = element_blank(),
axis.text.x = element_text(size = 10, face = “bold”),
plot.title = element_text(size = 14, face = “bold”, hjust = 0.5),
plot.subtitle = element_text(size = 10, hjust = 0.5), legend.position = “none” ) + scale_fill_brewer(palette = “Set3”)
student attendance heatmap