-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
R Data Visualization Cookbook
By :
In the previous recipe, we studied how multivariate data can be displayed on a scatter plot. We used color as a visual cue to display information related to different presidents in the USA and how the economy performed. In this recipe, we will build on the same idea and introduce interactive scatter plots. The limitation of a static plot is that they are hard to interpret if the points overlap, and if the gridlines are not present the data may be hard to decipher as well. Interactive plots help us to overcome this limitation. In this recipe, we will plot a simple interactive scatter plot with a trend line as shown in the following screenshot:

We would plot an interactive scatter plot using the googleVis package in R.
To generate an interactive scatter plot, we will install and load the googleVis package in R. We can import the data in R using the read.csv() function:
install.packages("googleVis")
library(googleVis)
income = read...
Change the font size
Change margin width
Change background colour