For this scatterplot, we are plotting the weight (1000 lbs) of the
automobiles against the mpg (miles/gallon). The colour denotes the
number of cylinders and the size of the circles represents the gross
horsepower of the automobiles.
library(plotly)plot_ly(mtcars, x =~ wt, y =~ mpg, mode ="markers", color =~as.factor(cyl), size =~ hp)