Activity: Applying the Grammar of Graphics to Create a Complex Visualization

Scenario

Sometimes, you may need to customize a plot, changing scales and coordinate types. For example, you may have profits in billions (or trillions) of dollars, and wish to represent a big number as 1M, 2M, and so on. Or, you may want to view percentages of profits per month as a pie chart. In such cases, you would need to change your Cartesian coordinates to polar coordinates.

Aim

To use the Grammar of Graphics to create a visualization.

Steps for Completion

  1. Create the scatter plot using the ggplot commands.
  2. Use the required dataset.
  3. Change scales with one of the preceding label formats.
Refer to the complete code at https://goo.gl/RheL2G.

The outcome will ...

Get Applied Data Visualization with R and ggplot2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.