Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Problem
Currently, boxplots do not get legend entries.#27711 was an attempt to introduce them but only solved one very particular usecase and did not generalize well. See#27780.
There is alabels
parameter, but that only sets x-tick labels. And it has one entry per box. For the legend we should have only one entry perboxplot()
call no matter how many boxes that has, becauseboxplot
draws N identically styled boxes and it does not make sense to have N identical handles with different labels.
Because of the x-tick relation oflabels
and it's relation to individual boxes, this parameter is not suited for the legend labels.
Proposed solution
We need a separate parameter. There are basically two options:
Variant 1)legend_label: str
pro: simple and clear, no interference with the existing API
con: inconsistent with the rest of the library: all other functions uselabel
for the legend entry.
Variant 2)label: str
pro: consistent with the rest of the library
con: Havinglabel
alongsidelabels
is quite confusing and easily leads to errors. (We could runtime-check for the type str vs list of str, to give helpful error messages but still ...)
If we want to go this way, we should renamelabels
totick_labels
or similar.