library(plotly)
plot_ly(mtcars, x = ~wt, y = ~mpg, type = "scatter", color = ~disp)

Continuous Color

## Warning: `arrange_()` is deprecated as of dplyr 0.7.0.
## Please use `arrange()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.

Scatterplot Sizing

By specifying the size argument you can make each point in your scatterplot a different size.

library(plotly)
plot_ly(mtcars, x = ~wt, y = ~mpg, type = "scatter", 
        color = ~factor(cyl), size = ~hp)

Scatterplot Sizing

## Warning: `line.width` does not currently support multiple values.

## Warning: `line.width` does not currently support multiple values.

## Warning: `line.width` does not currently support multiple values.