You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of expected behavior and the observed behavior
I'm creating a BoxWhisker plot using holoviews and adding a legend to it.
Expected behaviour: Legend shows the categories only once.
Observed behaviour: Legend shows the categories twice.
Complete, minimal, self-contained example code that reproduces the issue
I may be interested in making a pull request to address this
I don't know enough about the code to make a pull request, but I have done a dive in and narrowed the problem down a bit so that someone that knows their way around the code can probably easily fix this:
The problem lies somewhere between holoviews\plotting\bokeh\stats.py and holoviews\plotting\bokeh\element.py
In stats.py, two datasets and two mappings are introduced, one for the part of the boxplot above the average line and one for below it:
then, only for vbar_map (not for vbar2_map), the legend field is set:
if self.show_legend:
vbar_map['legend_field'] = cdim.name
however, for some reason, in the _apply_transforms of ElementPlot in element.py, the 'legend_field' is also set for the vbar2_map, which causes it to also be rendered as a legend.
Would be great if someone found a fix for that!
The text was updated successfully, but these errors were encountered:
I should maybe mention that I found a "dirty" solution by checking for key == "vbar_2" in the _init_glyphs for loop and deleted the 'legend_field' entry, so I just added
if key == "vbar_2":
del group_style['legend_field']
after the _apply_transforms call, but that is probably not a good way to do it...
ALL software version info
Software Version Info
Description of expected behavior and the observed behavior
I'm creating a BoxWhisker plot using holoviews and adding a legend to it.
Expected behaviour: Legend shows the categories only once.
Observed behaviour: Legend shows the categories twice.
Complete, minimal, self-contained example code that reproduces the issue
Screenshots or screencasts of the bug in action
I don't know enough about the code to make a pull request, but I have done a dive in and narrowed the problem down a bit so that someone that knows their way around the code can probably easily fix this:
The problem lies somewhere between holoviews\plotting\bokeh\stats.py and holoviews\plotting\bokeh\element.py
In stats.py, two datasets and two mappings are introduced, one for the part of the boxplot above the average line and one for below it:
then, only for vbar_map (not for vbar2_map), the legend field is set:
however, for some reason, in the
_apply_transforms
ofElementPlot
in element.py, the 'legend_field' is also set for the vbar2_map, which causes it to also be rendered as a legend.Would be great if someone found a fix for that!
The text was updated successfully, but these errors were encountered: