I would like to know what would be the best way to have elements that are part of the same holomap layout but on separate panel panes have their axes limits computed the same way like when the entire layout is rendered.
It is simpler with the following example.
Let's say I define a HoloMap that I render as a NdLayout of barplots:
df = pd.DataFrame(
{
'level_1': ['A', 'A', 'A', 'A', 'B', 'B', 'B', 'B'],
'level_2': ['C', 'D', 'C', 'D', 'C', 'D', 'C', 'D'],
'group' : ['group1', 'group1', 'group2', 'group2', 'group1', 'group1', 'group2', 'group2'],
'values': [3, 1, 9, 11, 5, 6, 1, 3],
}
)
hv_ds = hv.Dataset(
df,
kdims=['level_1', 'level_2', 'group'],
vdims='values',
)
layout = hv_ds.to(
hv.Bars,
kdims=['level_1', 'level_2'],
vdims='values',
).layout('group')
layout
This layout is cleanly rendered, with y axes limits set as to show the top of the bars:
However, if I want for customization sake to separate the elements of the layout in different panel panes, the y limits are computed on the first rendered element:
pn.Row(
pn.Column(
pn.pane.Markdown("## Group 1"),
layout['group1'],
),
pn.Column(
pn.pane.Markdown("## Group 2"),
layout['group2'],
)
)
Is there any way to force computation of the y axes limits as when the whole layout is rendered?
As a side note, I noticed that if I render the full layout AND THEN parts of it, the axes limits are correctly set. May be this could be leveraged, but I don't know how to render a layout and then hide it...
pn.Column(
layout,
pn.Row(
pn.Column(
pn.pane.Markdown("## Group 1"),
layout['group1'],
),
pn.Column(
pn.pane.Markdown("## Group 2"),
layout['group2'],
)
),
)


