bokeh backend could not plot any Elements in the Overlay.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 124
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 1
Description
hvplot==0.8.1
I am trying to help a user on discourse https://discourse.holoviz.org/t/scrollbar-legend-in-hvplot/4293/2 find a way to make a useful plot with a 1000 legend items. I want to provide a way to let him select the items to display.
During that I ran into the issue where no items are selected and an empty dataframe is to be plotted. This leads to an error.
I've experienced this many times before. You can solve this manually as shown in the screenshot.

But it takes knowledge and time to do. I think this is friction and makes hvplot harder to use than it has to be.
Instead an empty but working plot should be returned.
## Minimum, reproducible example
```python
import hvplot.pandas
import pandas as pd
df = pd.DataFrame(columns=["x", "y", "A"])
import panel as pn
scat = df.hvplot.scatter(x="x", y="y", by="A")
pn.panel(scat).servable()
```

```bash
SkipRendering: bokeh backend could not plot any Elements in the Overlay.
Traceback (most recent call last):
File "/opt/conda/lib/python3.9/site-packages/bokeh/application/handlers/code_runner.py", line 231, in run
exec(self._code, module.__dict__)
File "/home/jovyan/repos/private/hvplot/script2.py", line 8, in
pn.panel(scat).servable()
File "/opt/conda/lib/python3.9/site-packages/panel/viewable.py", line 374, in servable
self.server_doc(title=title, location=location) # type: ignore
File "/opt/conda/lib/python3.9/site-packages/panel/viewable.py", line 853, in server_doc
model = self.get_root(doc)
File "/opt/conda/lib/python3.9/site-packages/panel/pane/base.py", line 314, in get_root
root = self.layout._get_model(doc, comm=comm)
File "/opt/conda/lib/python3.9/site-packages/panel/layout/base.py", line 146, in _get_model
objects = self._get_objects(model, [], doc, root, comm)
File "/opt/conda/lib/python3.9/site-packages/panel/layout/base.py", line 131, in _get_objects
child = pane._get_model(doc, root, model, comm)
File "/opt/conda/lib/python3.9/site-packages/panel/pane/holoviews.py", line 248, in _get_model
plot = self._render(doc, comm, root)
File "/opt/conda/lib/python3.9/site-packages/panel/pane/holoviews.py", line 324, in _render
return renderer.get_plot(self.object, **kwargs)
File "/opt/conda/lib/python3.9/site-packages/holoviews/plotting/bokeh/renderer.py", line 73, in get_plot
plot = super(BokehRenderer, self_or_cls).get_plot(obj, doc, renderer, **kwargs)
File "/opt/conda/lib/python3.9/site-packages/holoviews/plotting/renderer.py", line 238, in get_plot
plot = self_or_cls.plotting_class(obj)(obj, renderer=renderer,
File "/opt/conda/lib/python3.9/site-packages/holoviews/plotting/plot.py", line 1602, in __init__
self.subplots = self._create_subplots(ranges)
File "/opt/conda/lib/python3.9/site-packages/holoviews/plotting/plot.py", line 1674, in _create_subplots
raise SkipRendering("%s backend could not plot any Elements "
holoviews.core.options.SkipRendering: bokeh backend could not plot any Elements in the Overlay.
```
Contributor guide
Assessment
This issue has not been assessed yet.