GGPLOT - scale_size

Create scales for area or radius and then convert them with ggplotly.

p <- ggplot(mpg, aes(displ, hwy, size = hwy)) +
   geom_point()
plotly::ggplotly(p)
p <- ggplot(mpg, aes(displ, hwy, size = hwy)) +
   geom_point()
p <-  p + scale_size("Highway mpg")
plotly::ggplotly(p)
p <- ggplot(mpg, aes(displ, hwy, size = hwy)) +
   geom_point()
p <-  p + scale_size(range = c(0, 10))
plotly::ggplotly(p)
p <- ggplot(mpg, aes(displ, hwy, size = hwy)) +
   geom_point()
p <-  p + scale_size_area()
plotly::ggplotly(p)
p <- ggplot(mpg, aes(displ, hwy, size = hwy)) +
   geom_point()
p <-  p + scale_size_binned()
plotly::ggplotly(p)
p <-    
 ggplot(mpg, aes(class, cyl)) +
  geom_count() +
  scale_size_area()
plotly::ggplotly(p)
p <- ggplot(mpg, aes(displ, hwy, size = hwy)) +
   geom_point()
p <-  p + scale_radius()
plotly::ggplotly(p)