Vikrant Prakash
Vikrant Prakash

Reputation: 23

Enable autoscale in plotly.r

In my flexdashboard I used "plotly" library to plot the graph. when the data is refreshing at that time the bar size get reduced. At that time when I clicked on "autoscale" option then it is working fine. My question is can we enable autoscale automatically by any option in plotly.r code ?

Upvotes: 2

Views: 5222

Answers (1)

sakell
sakell

Reputation: 141

Try setting autorange = TRUE for both the x- and y-axis in the layout option.

This solved the issue for me.

Example:

plot_ly(x, y, type = "bar") %>%
  layout(xaxis = list(autorange = TRUE),
         yaxis = list(autorange = TRUE))

For other plotly axes modifications in R check this page.

Upvotes: 7

Related Questions