library(plotly)
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
data(mtcars)

plot_ly(x=mtcars$mpg, y= mtcars$cyl, z = mtcars$wt, 
type = "scatter3d", mode = "markers", color = mtcars$cyl)

An example using plotly on the mtcars data set for visualization. On the xaxis we have mpg, on the y we have cylinder and on the z we have weight. Color coded by cyl.