Skip to content

Commit

Permalink
Only use Overlay and NdOverlay in select_legend
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Aug 10, 2023
1 parent 0a72163 commit 6bff462
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion holoviews/plotting/bokeh/plot.py
Expand Up @@ -700,7 +700,7 @@ class LayoutPlot(CompositePlot, GenericLayoutPlot):
"bottom_right",
'right', 'left',
'top', 'bottom'],
default="right",
default="top_right",
doc="""
Allows selecting between a number of predefined legend position
options.""")
Expand Down
4 changes: 3 additions & 1 deletion holoviews/plotting/bokeh/util.py
Expand Up @@ -33,7 +33,7 @@

from ...core.layout import Layout
from ...core.ndmapping import NdMapping
from ...core.overlay import Overlay
from ...core.overlay import Overlay, NdOverlay
from ...core.util import (
arraylike_types, callable_name, cftime_types,
cftime_to_timestamp, isnumeric, pd, unique_array
Expand Down Expand Up @@ -485,6 +485,8 @@ def select_legends(holoviews_layout, figure_index=None, legend_position="top_rig
holoviews_layout = [holoviews_layout]

for i, plot in enumerate(holoviews_layout):
if not isinstance(plot, (NdOverlay, Overlay)):
continue
if i in figure_index:
plot.opts(show_legend=True, legend_position=legend_position)
else:
Expand Down

0 comments on commit 6bff462

Please sign in to comment.