5.11 Control colors and shapes - Video Tutorials & Practice Problems
Video duration:
1m
Play a video:
<v Voiceover>There are many</v> aesthetic mappings possible in ggplot, and while we've gone over and over them, it'd be nice to show them all at once, so again of the ggplot data set, we'll do ggplot, diamonds, aes, x equals carat, y equals price, color equals color, shape equals cut, and size equals depth. And we'll make this a scatter plot. Giving this a moment to run, we see a graph with a lot of information. We have, let this be a little bit bigger. We have carat on the x axis, price on the y axis, color of the diamonds mapped to color, the cut of the diamonds mapped to the shape of the point, and the depth of the diamond is mapped to the size of the point. Bigger points have greater depth. Lots of different stuff you can show on a plot, and it really is important to decide just because you can show it, should you show it? The human mind can only process so much information, and right now, there's a lot coming at the screen. It looks really cool, but what is this really telling us? And that is an important consideration to have when making graphics.