Describe your issue
I would like to know if an alternative way to visualize the Age and Gender of COVID-19 cases in Fulton County (Covid Report) is acceptable asides the template pyramid plot.
What steps have you already taken to find an answer?
- I currently used a horizontal plot
Provide an example of your R code
ggplot(covid_data_perc, aes(x = age_group, y = percent, fill = gender)) +
geom_bar(stat = "identity", position = "dodge") +
coord_flip() + # Flip coordinates to make it a horizontal pyramid
scale_fill_manual(values = c("Male" = "#1f77b4", "Female" = "#ff7f0e")) + # Adjust colors if needed
theme_minimal() +
labs(
title = "Age and gender of COVID-19 cases in Fulton County",
caption = "Fake dataset for course exercise",
x = "Percent of total",
y = "Age group",
fill = "Gender"
) +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) # Remove grid lines for a cleaner look
Follow-up
- Much appreciation to the tutors for their guidance during this course.