使用宽度/高度在ggplotly中调整大小的动态高度/宽度= 100%
我想通过允许动态高度/宽度来创建一个用ggplotly()
在r
中创建一个图,以便在HTML中看起来像这样的东西:
< Div ID =“ HTMLWIDGET-7C8A8E27B8CE66400314”样式=“宽度:100%;高度:100%;” class =“ plotly html-widget”></div>
with:width/height = 100%
,
但是,这似乎不允许在ggplotly中( )
: 此
ggplotly(p,size =“ 100%”,高度=“ 100%”)
会出现错误。
当使用rshiny plotlyoutput
(例如 https://community.plotly.com/t/plotly-shiny-reactive-height-height-height-of-plots/1503/4 )。
有没有办法从ggplotly()做到这一点?
多谢!
I would like to create a plot with ggplotly()
in R
by allowing dynamic height/width so that it will look something like this in the html:
<div id="htmlwidget-7c8a8e27b8ce66400314" style="width:100%;height:100%;" class="plotly html-widget"></div>
with: width/height=100%
However, this doesn't seem to be allowed in ggplotly()
:
This
ggplotly(p, size=“100%”, height=“100%”)
will throw an error.
It looks like this is possible when using RShiny plotlyOutput
(e.g. https://community.plotly.com/t/plotly-shiny-reactive-height-of-plots/1503/4).
Is there a way to do that from ggplotly() ?
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论