I would like to zoom in on the y-axis on a plotly plot that uses rangeslider
.
A reproducible example:
library(ggplot2)
library(plotly)
p <- ggplot(faithful, aes(x = waiting)) +
geom_histogram(bins = 30)
p <- ggplotly(p)
p <- rangeslider(p)
p
The way I can zoom is the following:
However, I would like to be able to also zoom like this (which is done by not adding a rangeslider
):
I assume this can be done by using something along the lines of
p <- layout(p, dragmode = "zoom")
but I haven't been able to make this work.