Exercise

All about aesthetics: comparing aesthetics

Now that you've got some practice with using attributes, be careful of a major pitfall: these attributes can overwrite the aesthetics of your plot!

Instructions 1/4

undefined XP
  • 1
    • Using mtcars, create a plot base layer, plt_mpg_vs_wt. Map mpg onto y and wt onto x.
    • Add a point layer, mapping the categorical no. of cylinders, fcyl, onto size.
  • 2

    Change the mapping. This time fcyl should be mapped onto alpha.

  • 3

    Change the mapping again. This time fcyl should be mapped onto shape.

  • 4
    • Swap the geom layer: change points to text.
    • Change the mapping again. This time fcyl should be mapped onto label.