Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Bug in ggplotly with boxplots

I’m new to plotly and only using the ggplotly function to have nice a bit more interactive graphs in RMarkdown HTML documents.
However I noticed that the position dodging of boxplots doesn’t work.
Sample code without plotly
mpg %>% filter(manufacturer %in% c(‘audi’, ‘toyota’)) %>% ggplot(aes(x=class, y=cty, fill=manufacturer)) + geom_boxplot()
But with plotly boxes are overlapping:
mpg %>% filter(manufacturer %in% c(‘audi’, ‘toyota’)) %>% {ggplot(data=.,aes(x=class, y=cty, fill=manufacturer)) + geom_boxplot()} %>% ggplotly()

Hey @masch,

try adding %>% layout(boxmode = 'group')