library(plotly)
## 载入需要的程辑包:ggplot2
##
## 载入程辑包:'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
plot_ly(z=volcano,type = "surface")
p <- plot_ly(mtcars,x = ~mpg,color = ~as.factor(cyl),type = "box")
p