library(plotly)
## Warning: package 'plotly' was built under R version 3.6.2
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.6.2
##
## 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
library(datasets)
fig <- plot_ly(midwest, x = ~percollege, color = ~state, type = "box")
fig