hvplot
hvplot copied to clipboard
Hvplot with datashade/rasterize not working neither in Google Colab nor Kaggle
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.
Can you clarify "will not work"? What does it do?
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.
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.
Ok, thanks for clarifying!
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
.
Same problem on local instance - zooming doesn't redraw.