R Plotly Rangeslider covers tick-labels - Is it possible to set location of Rangeslider?

Viewed 1317

I´m using the Plotly package in R to make a plot with both a rangeslider and rangeselector.

The problem is that the rangeslider tends to cover the x-axis tick labels.

A solution could be to manually set the location of the rangeslider, but I can't seem to find any documentation on how to do that.

Below you find a minimal working example of the problem together with a picture of it.

# Make Some Data: 
Dates = as.POSIXct(c("2017-08-08 00:00")) + (0:71)*60^2
Values = rep_len(mtcars$mpg, 72)
tb =  dplyr::tibble(Values, Dates)

# Plot
p = tb %>% plot_ly(type = "scatter", mode = 'markers', x = ~Dates, y = ~Values) %>% 
            layout(xaxis = list(
              rangeslider = list(type = "date"),
              rangeselector = list(
                buttons = list(list(step = "all", label = "All")))
              ))
p

"Note how some of the dates are covered"

Any help will be greatly appreciated! Cheers,

2 Answers
Related