Get startedGet started for free

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.

This exercise is part of the course

Visualization Best Practices in R

View Course

Exercise instructions

  • Add theme_void() to the ggplot object to clean up the background.
  • Give the plot the title 'Proportion of diseases'.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

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.
	___ +
	___
Edit and Run Code