Steps for Completion:
- Use the commands that we just explored to create the scatterplot.
- For this activity, you will use the gapminder dataset.
- You can use the help command to explore the options.
- To change scales, you will have to use one of the preceding label formats.
- Use labels=scales::unit_format ("K", 1e-3)) for labeling.
Outcome:
The output code is as follows:
ggplot(df, aes(x=gdp_per_capita,y=Electricity_consumption_per_capita))+
geom_point()+
scale_x_continuous(name="GDP",breaks = seq(0,50000,5000),
labels=scales::unit_format("K", 1e-3)) +
scale_y_continuous(name="Electricity Consumption",
breaks = seq(0,20000,2000),
labels=scales::unit_format("K", 1e-3))