hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

Adding a title to a GridSpace object squashes the elements

Open rancomp opened this issue 9 months ago • 0 comments

ALL software version info

Platform:             Windows-10-10.0.22631-SP0
Python:               3.11.7 | packaged by Anaconda, Inc. | (main, Dec 15 2023, 18:05:47) [MSC v.1916 64 bit (AMD64)]

hvplot:              0.9.2
holoviews:        1.18.3
panel:               1.3.8
bokeh:              3.3.4
matplotlib:        3.8.0
numpy:             1.26.3
pandas:             2.2.1

Description of expected behavior and the observed behavior

I'm using hvplot API along with polars / pandas to create a GridSpace of heatmaps, with the col, row arguments. When adding a title to the GridSpace, the HeatMap objects get squashed.

The expected behavior is to just add a title. Note that when the GridSpace is created with BOTH col, row arguments, then the title can be added without squashing the images.

Complete, minimal, self-contained example code that reproduces the issue

This also fails with pandas, just change the import to pandas and use pd instead of pl.

import polars as pl
import holoviews as hv
df = pl.DataFrame({"x":[1,1,2,2,]*2, "y":[1,2,1,2,]*2, "C":[1,2,3,4,1,1,2,2], "col":[1]*4+[2]*4})
g = df.plot.heatmap(x="x",y="y",C="C",col="col")

hv.save(g, "without-title.html")
hv.save(g.opts(title="title"), "with-title.html")

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

Before adding title: image After adding title: image

  • [x] I may be interested in making a pull request to address this

rancomp avatar May 05 '24 06:05 rancomp