holoviz / holoviz/hvplot

The visualization rendered depends on the active render at plot creation

Open
#1,236 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

I'm on hvplot==0.9.1, holoviews==1.18.1, trying to communicate to the world that hvPlot now works with Polars.

To my surprice I cannot **create and render independently** to any of the backends. I must recreate and render the plot.

I believe that it must be a fundamental principle that I can create the plot objects and render independently. Anything else does not make sense in my world. Otherwise I can't reuse a plot for different use cases.

## Does not work if I create plot once

![image](https://github.com/holoviz/hvplot/assets/42288570/338f4ee3-f184-4b2c-8050-b07a0757aa11)

## Works when I create plots again

![image](https://github.com/holoviz/hvplot/assets/42288570/7ebd44bc-56fb-440f-80d2-0737db7c7ae7)

## Code

```python
import polars as pl
import hvplot.polars

df = pl.read_csv("Christmas tree sales 2004-2016.csv")
df = df.with_columns(pl.col("total_trees_sold")/10**6)
plot = df.hvplot.bar(x="Year", y="total_trees_sold", title="Christmas Trees sold by year", color="red", ylabel="Trees Sold in millions", height=200, width=1200)

hvplot.extension("bokeh")
plot

hvplot.extension("matplotlib")
plot

hvplot.extension("plotly")
plot
```

[Christmas tree sales 2004-2016.csv](https://github.com/holoviz/hvplot/files/13758344/Christmas.tree.sales.2004-2016.csv)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.