0

I have a ggplot with facet_wrap of about 22 different plots. I'm trying to make them interactive using ggplotly, but for some reason certain rows of plots have their header area get larger to the point where I barely see the graph. It looks like all the plots in the same row have the same gray sized area. I'm just trying to generate the plot, but keep the gray title area the same size. Any help would be greatly appreciated. I've tried to look at the panel options, but couldn't find anything that would do what I needed, but I'm not sure if I'm just missing something.

p <- ggplot(data = df, aes(value, fill = FIELD))+
  geom_histogram()+
  facet_wrap(~variable, scales='free_x')

ggplotly(p)

enter image description here

I was able to replicate the error with...

library(titanic)
library(reshape2)

titanic_long <- melt(titanic_train)

p<-ggplot(data=titanic_long, aes(value))+
  geom_histogram(aes(fill=Sex))+
  facet_wrap(~variable, scales='free_x')

ggplotly(p)
PVic
  • 417
  • 1
  • 4
  • 13
  • When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Jun 26 '18 at 21:24
  • Thank you MrFlick, I just updated my code. – PVic Jun 26 '18 at 22:13
  • Plot renders perfectly in my browser. No problem with the code... – Lstat Jun 27 '18 at 12:50
  • Hm, interesting. what browser are you using? – PVic Jun 27 '18 at 13:38

0 Answers0