when I use ggplotly
in jupyterlab
the output gets truncated. How can I force jupyter
to display it properly ?
For some reason if I just use ggplot
the graph can be as large as it needs to be
set.seed(1L)
values <- rnorm(n = 366L)
plot_data <- data.frame(date = seq(as.Date("2011-01-01"), as.Date("2012-01-01"), 1),
value = values,
sign = ifelse(values > 0, "positive", "negative"), size = ifelse(abs(values) > 2, "big", "small")
)
p <- ggplot(data = plot_data) + aes(x = date, y = value, color = sign) + geom_line()
vertical <- as.Date(c("2011-02-01", "2011-10-01"))
names(vertical) <- c("test", "test2")
p <- p + geom_vline(xintercept = vertical, linetype = "dashed", color = "orange")
data_geom <- data.frame(v_x = vertical, v_label = names(vertical), v_y = rep(2.5, 2))
p <- p + geom_text(data = data_geom, aes_string(x = "v_x", label = "v_label", y = "v_y"), colour = "orange", angle = 90, check_overlap = TRUE)
ggplotly(p)
This gives me