从CustomJS调整散点图的大小。
window.setXYDimension = function (width, height) {
fig.plot_width = width;
fig.plot_height = height;
console.log({fig});
fig.reset(); //reset doesn't exist
fig.resize(); //resize doesn't exist
fig.layout(); //layout doesn't exist
};
感谢您的帮助。
这很有效。
window.setXYDimension = function (width, height) {
fig.frame_width = width;
fig.frame_height = height;
fig.properties.width.change.emit();
fig.properties.height.change.emit();
};
感谢Smiley提供的解决方案。
您也可以使用以下CustomJS
来调整事件上的图形大小
CustomJS(args=dict(plot1=p1), code="""
plot1.width=1500;
plot1.height=1500;
plot1.document.resize();
"""
)