1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Data Visualization with ggplot2

Exercise

All about attributes: conflicts with aesthetics

In the videos you saw that you can use all the aesthetics as attributes. Let's see how this works with the aesthetics you used in the previous exercises: x, y, color, fill, size, alpha, label and shape.

In this exercise you will set all kinds of attributes of the points!

You will continue to work with mtcars.

Instructions 1/3

undefined XP
  • 1

    Add a point layer, setting alpha, the transparency, to 0.5.

  • 2

    Add a text layer, setting the label to the rownames of the dataset mtcars, and the color to "red".

  • 3

    Add a point layer, setting the shape to 24 and the color to "yellow".