From 3ff167dbefc766466e24bdec13656672293de7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 9 Aug 2023 08:15:53 +0200 Subject: [PATCH] Only use LegendPlot in select_legend --- holoviews/plotting/bokeh/util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/holoviews/plotting/bokeh/util.py b/holoviews/plotting/bokeh/util.py index 2a8244e003..0bb35f82af 100644 --- a/holoviews/plotting/bokeh/util.py +++ b/holoviews/plotting/bokeh/util.py @@ -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): @@ -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: