Cleaning up the pie
The pie chart you made in the last plot is good, but it's a little cluttered. Let's clean it up using the ggplot function theme_void() along with giving it a meaningful title with ggtitle(...).
The disease_counts summarized data frame from the last exercise is already loaded for you.
Questo esercizio fa parte del corso
Visualization Best Practices in R
Istruzioni dell'esercizio
- Add
theme_void()to the ggplot object to clean up the background. - Give the plot the title
'Proportion of diseases'.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
ggplot(disease_counts, aes(x = 1, y = total_cases, fill = disease)) +
# Use a column geometry.
geom_col() +
# Change coordinate system to polar.
coord_polar(theta = "y") +
# Clean up the background with theme_void and give it a proper title with ggtitle.
___ +
___