1. Learn
  2. /
  3. Courses
  4. /
  5. Analyzing Survey Data in R

Exercise

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.

Instructions 1/2

undefined XP
  • 1

    Create a bubble plot of NHANES20. Map Height to x, Weight to y, WTMEC4YR to size, and Gender to color. Set alpha to 0.3 and include a legend for color but not size.

  • 2

    Create a scatter plot of NHANES20. Map Height to x, Weight to y, WTMEC4YR to alpha, and Gender to color. Include a legend for color but not for alpha.