1

I'm trying to replicate this ggplot using the plotly library:

ggplot(mccase, aes(x=antskad)) + geom_histogram(bins=3) + facet_grid(. ~ rating.1) + scale_y_log10()

I think I almost reach my objetive with:

mccase %>%
  group_by(rating.1) %>%
  plot_ly(y=~rating.1, x=~antskad, type='histogram') %>%
    layout(yaxis = list(type = "log", showgrid=T,  ticks="outside", autorange=TRUE))

However, this works correctly but I need to introduce something like the facet_grid and I have no idea how can be done.

Can anybody help me? Thanks in advance.

Liverat
  • 19
  • 3
  • 1
    Just wrap your ggplot into ggplotly? `ggplotly(ggplot(...) + geom_histogram() + facet_grid(...))` – zx8754 Apr 14 '21 at 09:58

0 Answers0