如何动态调整绘图尺寸

2024-04-26 18:22:46 发布

您现在位置:Python中文网/ 问答频道 /正文

以前我问过一个问题,如何动态地适应波基的情节大小,我得到了一个解决方案,从海瑞。你知道吗

How to fit bokeh plot size dynamically

现在我想问同样的问题。你知道吗

与HYRY的方法类似,我可以使用Plotly.重新布局javascript函数:

TweenMax.to($("#div2"), 0.5, {height:800, onUpdate:function(){Plotly.relayout("493d6ad0-561e-49b1-9c37-f9c427ba7880", {width:1800, height:800});}});

再次感谢海瑞。你知道吗

Plotly不方便的是,我自己找不到指定plot id的方法。在Bokeh中,我们可以通过python函数提供id,而不是随机生成的id:

blue = figure(sizing_mode='stretch_both', tools='pan', id="blue_fig")

有什么好办法吗?你知道吗


Tags: to方法函数idsizeplotbokeh动态