Search code examples
rggplot2plotlyggplotly

Axis labels disappear after zooming in


I used the data from this example. After zooming in enough, axis labels were not shown anymore. I am wondering if there is a way to redraw the updated labels? Thanks!

library(ggplot2)
library(tidyquant)
library(plotly)

data("FANG") 
AMZN <- tq_get("AMZN", get = "stock.prices", from = "2000-01-01", to = "2016-12-31")

p <- AMZN %>%
  ggplot(aes(x = date, y = adjusted)) +
  geom_line(color = palette_light()[[1]]) + 
  scale_y_log10() +
  labs(title = "AMZN Line Chart", 
       subtitle = "Log Scale", 
       y = "Closing Price", x = "") + 
  theme_tq()

ggplotly(p)

output


Solution

  • ggplotly(p, dynamicTicks = TRUE)