I’m creating two heatmaps which have different ranges of data. I’d like to plot them together with the same extents, with empty cells added as needed to make them the same size. Here’s code for two sample heatmaps:
import random
import holoviews as hv
hv.extension("matplotlib")
data1 = [(x, y, random.random()) for x in range(3) for y in range(6)]
data2 = [(x, y, random.random() * 3) for x in range(7) for y in range(2)]
hmap1 = hv.HeatMap(data1)
hmap2 = hv.HeatMap(data2)
combined = (hmap1 + hmap2).opts(hv.opts.HeatMap(show_values=False, colorbar=True))
which renders as
with one taller heatmap and one wider. I’d like them both to be 7×6 in this example. I tried doing combined.opts(shared_axes=True)
, but the results are the same. Doing hmap1.redim.values(x=[0, 1, 2, 3, 4, 5, 6])
also produces the same plot.
How can I resize multiple (not necessarily just two) heatmaps to plot them together with the same grid?