Skip to content

Commit

Permalink
Only use LegendPlot in select_legend
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Aug 9, 2023
1 parent 0a72163 commit 3ff167d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions holoviews/plotting/bokeh/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ def select_legends(holoviews_layout, figure_index=None, legend_position="top_rig
legend_position : str
Position of the legend(s).
"""
from .element import LegendPlot

if figure_index is None:
figure_index = [0]
elif isinstance(figure_index, bool):
Expand All @@ -485,6 +487,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, LegendPlot):
continue
if i in figure_index:
plot.opts(show_legend=True, legend_position=legend_position)
else:
Expand Down

0 comments on commit 3ff167d

Please sign in to comment.