Get startedGet started for free

Use of color in scatter plots

We often use the hue of color in a scatter plot to represent categories of a categorical variable. Let's add Gender to our scatter plots.

This exercise is part of the course

Analyzing Survey Data in R

View Course

Hands-on interactive exercise

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

# Add gender to plot
ggplot(data = NHANES20,
       mapping = aes(___)) + 
	geom_point(___) + 
    guides(___ = "none")
Edit and Run Code