Enable autoscale in plotly.r

戏子无情 提交于 2020-02-05 04:34:27

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/54552405/enable-autoscale-in-plotly-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!