0
p <- ggplot(data = df,aes(label1 = label1 , label2 = label2 , label3 = label3 , label4 = Label4 )) +
  geom_point(aes(point1, point2, color = color_column)) +
  theme(legend.text=element_text(size=rel(0.6))) +
  facet_wrap(~ color_column, nrow = 4, ncol = 2) +
  scale_color_manual("legend", values = my_colors)+
  xlim(0, 10) + ylim(0, 10) 

  ggplotly(p,dynamicTicks = TRUE, width = 1000, height = 1000)

I am noticing that xlim and ylim does not function as expected and my charts have axis scales at random. Likewise, applying coord_cartesian does not fix the problem either.

Does anybody know the issue here?

Ciaran O Brien
  • 374
  • 3
  • 13
  • It would be easier to help if you create a small reproducible example. A (example) dataset `df` and the vector `my_colors` are missing in your question but they are necessary to run your code. Here are some information about reproducible examples: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – tamtam Mar 04 '21 at 12:36

1 Answers1

0

It seems changing the final line to dynamicTicks = FALSE resolved the problem of ggplotly overwriting my ylim settings.

Ciaran O Brien
  • 374
  • 3
  • 13