0

I can convert a plot created by ggplot2 easily via plotly::ggplotly() as follows:

library(tidyverse)
ggplot(as_tibble(iris), aes(x=Sepal.Width, y=Petal.Length, color=Species)) + geom_point()
plotly::ggplotly()

enter image description here

I expected the following to work such that the points show up in each facets of the plotly figure.

ggplot(as_tibble(iris), aes(x=Sepal.Width, y=Petal.Length)) + facet_wrap(~Species)+ geom_point()
plotly::ggplotly()

This ggplot2 plot:

enter image description here

is converted to:

enter image description here

So it doesn't work, and simply returns a correctly faceted axes with no points.

Is there a workaround?

Versions:

R 3.6.1 
RStudio 1.2.1335
tidyverse 1.2.1
ggplot2 3.2.1
tibble  2.0.1
plotly 4.9.0
hyiltiz
  • 1,158
  • 14
  • 25

0 Answers0