Incorrect behavior of dynamicTicks vs autorange in facet mode
Hello! I want to use dynamic ticks for plots in application. With that, need not to limit the plot by x axis (i want some spaces on the borders). I do that by "autorange = FALSE" in layot. For single plot it's work fine, but for facet_wrap or facet_grid plots it works fine only for the first plot (left). I tried to use xlim, coord_cartesian with xlim, scale_x_continuous. Nothing helps. Plots are created using ggplot2 (ver. 3.1.0) and then rendered using ggplotly (plotly ver. 4.8.0).
My code:
library(data.table)
library(plotly)
library(ggplot2)
a1 <- c(1:50)
b1 <- rnorm(50, 30, 10)
c1 <- c(rep(c("abc","def"),25))
dt <- as.data.table(list("valueX" = a1, "valueY" = b1, "facetCol" = c1))
dt$facetCol <- as.factor(dt$facetCol)
pplot <- ggplot() + geom_line(data = dt, aes(x = valueX, y = valueY)) +
facet_wrap(~dt$facetCol, ncol = 2)
ggplotly(dynamicTicks = TRUE, pplot) %>% layout(xaxis = list(autorange = FALSE))
How i see it:

What i want:

Yea, dynamicTicks = TRUE should do a better job of preserving the range of the positional scale, but in the meantime, you could set it yourself this way
ggplotly(dynamicTicks = TRUE, pplot) %>%
layout(xaxis = list(autorange = FALSE, range = c(-10, 100)))
Thanks for answer!
Yeah, i tried to use "range". But it works incorrect too:

Same issue here (on y axis though but the issue still holds the same). Couldn't find a fix for this.
Apologies for poking this again, but it'd be great to have a way of ensure a specific range to all facets, while this is getting fixed. Is there a way to achieve that ?
I also ran into the problem of not being able to get fixed axis ranges for facetted plots when using dynamicTicks = TRUE (which I need to use for rangeslider and rangeslider to work properly).
Using layout(xaxis = list(autorange = FALSE, range = c(-10, 100))) only affects the first facet not the others. Are there any other solutions? Thanks!