Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix boxplot legend entries part 2#27711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dstansby merged 2 commits intomatplotlib:mainfromsaranti:boxlegend
Jan 31, 2024
Merged

Conversation

saranti
Copy link
Contributor

@sarantisaranti commentedJan 27, 2024
edited by dstansby
Loading

PR summary

Continuation of PR#27568

Fixes#20512

PR checklist

Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It may be better to add the default label inmerge_kw_rc rather than have it 4 times, but this is fine to merge.

Copy link
Member

@dstansbydstansby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks good - I've left a small optional suggestion to improve the test code.

@dstansbydstansby merged commita382045 intomatplotlib:mainJan 31, 2024
@sarantisaranti deleted the boxlegend branchFebruary 3, 2024 06:25
timhoffm added a commit to timhoffm/matplotlib that referenced this pull requestFeb 12, 2024
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 labelsbut for xtick labels. This is only poorly documented viahttps://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 meanspropagate them simultaneously to xticks and legend entries. This coupling would crippleusers' configurability and limit our ability to migrate to a clear API where legendlabels and tick labels can be configured independently.Until we have sorted out a better API, the recommended solution for the original issuematplotlib#20512 is to grab the artists returned from `boxplot()` and either `set_label()` onthem or pass them to the legend call `ax.legend(handles, labels)`.
@timhoffmtimhoffm mentioned this pull requestFeb 12, 2024
timhoffm added a commit to timhoffm/matplotlib that referenced this pull requestFeb 12, 2024
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 labelsbut for xtick labels. This is only poorly documented viahttps://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 meanspropagate them simultaneously to xticks and legend entries. This coupling would crippleusers' configurability and limit our ability to migrate to a clear API where legendlabels and tick labels can be configured independently.Until we have sorted out a better API, the recommended solution for the original issuematplotlib#20512 is to grab the artists returned from `boxplot()` and either `set_label()` onthem or pass them to the legend call `ax.legend(handles, labels)`.
timhoffm added a commit to timhoffm/matplotlib that referenced this pull requestFeb 14, 2024
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 labelsbut for xtick labels. This is only poorly documented viahttps://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 meanspropagate them simultaneously to xticks and legend entries. This coupling would crippleusers' configurability and limit our ability to migrate to a clear API where legendlabels and tick labels can be configured independently.Until we have sorted out a better API, the recommended solution for the original issuematplotlib#20512 is to grab the artists returned from `boxplot()` and either `set_label()` onthem or pass them to the legend call `ax.legend(handles, labels)`.
dstansby added a commit that referenced this pull requestFeb 14, 2024
@timhoffm
Copy link
Member

I'm sorry, but we had to revert this, because it's not a generally viable solution for boxplot legends (see#27780 (comment)).

We'll be working out a better legend support for boxplots in#27792.

Until that is in place, the recommended way to add legend entries is to grab the relevant Artists from theboxplot() return value and pass them as handles to the legend, e.g. as demonstrated inhttps://stackoverflow.com/a/68124759.

saranti reacted with thumbs up emoji

@sarantisaranti mentioned this pull requestMar 1, 2024
5 tasks
Impaler343 pushed a commit to Impaler343/matplotlib that referenced this pull requestMar 8, 2024
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 labelsbut for xtick labels. This is only poorly documented viahttps://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 meanspropagate them simultaneously to xticks and legend entries. This coupling would crippleusers' configurability and limit our ability to migrate to a clear API where legendlabels and tick labels can be configured independently.Until we have sorted out a better API, the recommended solution for the original issuematplotlib#20512 is to grab the artists returned from `boxplot()` and either `set_label()` onthem or pass them to the legend call `ax.legend(handles, labels)`.
Impaler343 pushed a commit to Impaler343/matplotlib that referenced this pull requestMar 14, 2024
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 labelsbut for xtick labels. This is only poorly documented viahttps://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 meanspropagate them simultaneously to xticks and legend entries. This coupling would crippleusers' configurability and limit our ability to migrate to a clear API where legendlabels and tick labels can be configured independently.Until we have sorted out a better API, the recommended solution for the original issuematplotlib#20512 is to grab the artists returned from `boxplot()` and either `set_label()` onthem or pass them to the legend call `ax.legend(handles, labels)`.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.9.0
Development

Successfully merging this pull request may close these issues.

Bad boxplot legend entries
6 participants
@saranti@timhoffm@tacaswell@dstansby@QuLogic@story645

[8]ページ先頭

©2009-2025 Movatter.jp