Connecting points in a scatter plot

The primary objective of this recipe is to understand how we can connect points in a scatter plot. The plot is inspired by Alberto Cairo infographic regarding the Gini coefficient, and the GDP data under various president's tenure in Brazil and connected points based on these three variables. In this recipe, we will apply the same concept to the USA economy.


For all the data visualizations and references used in recipes in this book, please refer to the See also section in each recipe

Connecting points in a scatter plot

How to do it…

We will start to import the data in R. The dataset comprises of the Gini coefficient, the GDP data of the USA and ...

Get R: Recipes for Analysis, Visualization and Machine Learning now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.