I have created a scatter plot for CO2 emissions for Argentina and Brazil. How would i make them different colours? at the moment it's all green. Thanks Lois
df%>%
dplyr:: filter(Country %in% c("Argentina", "Brazil")) %>%
filter(Year<=2019 & Year>=1950) %>%
ggplot(aes(x = Year, y = CO2_annual_tonnes)) +
geom_point(na.rm =TRUE, shape=20, size=2, colour="green") +
labs (x = "Year", y = "CO2Emmissions (tonnes)")
Try this:
library(ggplot2)
library(dplyr)
df%>%
dplyr:: filter(Country %in% c("Argentina", "Brazil")) %>%
filter(Year<=2019 & Year>=1950) %>%
ggplot(aes(x = Year, y = CO2_annual_tonnes, colour=factor(country))) +
geom_point(na.rm =TRUE, shape=20, size=2) +
labs (x = "Year", y = "CO2Emmissions (tonnes)")