Commit 3dfcb51
committed
Partly revert matplotlib#27711
This PR removes the propagation of `labels` to any artist legend labels.
Other than the rest of the plotting functions `labels` is not used for legend labels
but for xtick labels. This is only poorly documented via
https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bxp.html and in an
[example](https://matplotlib.org/stable/gallery/statistics/boxplot_color.html).
Whatever our way forward regarding the use of `labels` is, we should by no means
propagate them simultaneously to xticks and legend entries. This coupling would cripple
users' configurability and limit our ability to migrate to a clear API where legend
labels and tick labels can be configured independently.
Until we have sorted out a better API, the recommended solution for the original issue
matplotlib#20512 is to grab the artists returned from `boxplot()` and either `set_label()` on
them or pass them to the legend call `ax.legend(handles, labels)`.1 parent 585bdce commit 3dfcb51
2 files changed
+15
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3885 | 3885 | | |
3886 | 3886 | | |
3887 | 3887 | | |
3888 | | - | |
| 3888 | + | |
| 3889 | + | |
3889 | 3890 | | |
3890 | 3891 | | |
3891 | 3892 | | |
| |||
4004 | 4005 | | |
4005 | 4006 | | |
4006 | 4007 | | |
4007 | | - | |
4008 | | - | |
4009 | | - | |
4010 | 4008 | | |
4011 | 4009 | | |
4012 | 4010 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1429 | 1429 | | |
1430 | 1430 | | |
1431 | 1431 | | |
1432 | | - | |
1433 | | - | |
1434 | | - | |
1435 | | - | |
1436 | | - | |
1437 | | - | |
1438 | | - | |
1439 | | - | |
1440 | | - | |
1441 | | - | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | | - | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
0 commit comments