ggplot(nations_filtered, aes(x = year, y = gdp_percap, color = country)) +geom_point(size =3, alpha =0.8, shape =20) +geom_line(size =1)+scale_color_brewer(palette ="Set2") +labs(title ="Top Economies of North and South America", x ="Year", y ="GDP Per Capita (USD)") +theme_bw() +theme(plot.title =element_text(hjust =0.5, face ="bold", size =14))
Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` instead.
`summarise()` has grouped output by 'country'. You can override using the
`.groups` argument.
ggplot(country_gdp, aes(x = year, y = sum_gdp, fill = country)) +geom_area(color ="white", size =0.2) +scale_fill_brewer(palette ="Set2") +labs(title ="Total GDP of the Largest North and South American Economies",x ="Year",y ="Total GDP (Trillions in USD)",fill ="Country") +theme_bw() +theme(plot.title =element_text(hjust =0.5, face ="bold", size =12))
Disclaimer
The Area Graph is showing the United States is dominating in the growth of GDP over the years, while other countries GDPs aren’t as large but are steadily increasing amongst other major American economies.