hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

Hvplot with datashade/rasterize not working neither in Google Colab nor Kaggle

Open yerbby opened this issue 1 year ago • 5 comments

Previously you were able to run hvplot with full functionality on those platforms just by installing hvplot with:

!pip install hvplot

Since the last mayor version update, to make hvplot work you have to:

!pip install --upgrade hvplot
!pip install --upgrade bokeh
!pip install --upgrade holoviews

However, I have not been able to make it work with datashader/rasterize options, even after installing:

!pip install datashader
!pip install jupyter_bokeh

Reproducible example:

# Load iris dataset
import pandas as pd
from sklearn.datasets import load_iris

iris = load_iris()
df = pd.DataFrame(data=iris.data, columns=iris.feature_names)
df['target'] = iris.target
# this will work: 
import hvplot.pandas

hvplot.extension('bokeh')
df.hvplot(kind='scatter',  x='sepal width (cm)', y='sepal length (cm)', width=600, height=300) 
# this will not work: 
import hvplot.pandas

hvplot.extension('bokeh')
df.hvplot(kind='scatter', 
          x='sepal width (cm)',
          y='sepal length (cm)',
          groupby='target',
          width=600,
          height=300,
          datashade=True, 
        #   rasterize=True,
          cnorm= 'eq_hist', 
          dynspread=True,
          alpha=0.5)

Any hints to make hvplot with datashader work on this online platforms would be welcome. Thanks in advance.

YbY.

yerbby avatar Jul 27 '23 16:07 yerbby

Can you clarify "will not work"? What does it do?

jbednar avatar Jul 28 '23 02:07 jbednar

Sure @jbednar,

in Google Colab executing my previous code will automatically open a Code snippet tab asking for enabling third-party Jupyter widgets, as in the figure below. However, running the suggested two lines of code does not solve the problem and the hvplot is not even shown.

Img1

However, in Kaggle, the plot panel will show up, but the "rasterization" is not working, I mean, if the plot is zoomed or paned it is not renderized again, it is just a static plot, the cloud of dots is not disaggregated when you zoom in, etc.

image

yerbby avatar Jul 28 '23 12:07 yerbby

Ok, thanks for clarifying!

jbednar avatar Jul 30 '23 17:07 jbednar

Hello, checking to see whether any updates are available on this issue? Running into the same problem, with colab not showing a plot when rasterize=True.

Rridley7 avatar Nov 11 '23 14:11 Rridley7

Same problem on local instance - zooming doesn't redraw.

jmakov avatar Dec 26 '23 19:12 jmakov