Hi, I’m trying to make my plots in a DynamicMap differ I size, depending on which plot is selected. However, the straightforward way using different size values for
height does not work, even if I specify
framewise=True. I have also tried with a hook, to see if overriding the bokeh setting before plotting could change the size of the plot.
%load_ext watermark import holoviews as hv import numpy as np import pandas as pd import panel as pn hv.extension('bokeh') print('Watermark of notebook execution:') %watermark -iv select_widget = pn.widgets.Checkbox(name='select') @pn.depends(select=select_widget.param.value) def get_points(select): def column_width(plot, element): size = 200 if select else 400 print(size) plot.handles['plot'].plot_width = size if select: return hv.Points(np.random.rand(10,10)).opts(title='A', hooks=[column_width], framewise=True) else: return hv.Points(np.random.rand(10,10)).opts(title='B', hooks=[column_width], framewise=True) plot = hv.DynamicMap(get_points) app = pn.Column(select_widget, plot) app
The initial plot followed by the plot after selection, where the size of the plot have not changed!
This issue does relate a bit to # GridSpec sizing breaks when plot in DynamicMap updates