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

Update handling of sequence labels for plot#27767

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
QuLogic merged 1 commit intomatplotlib:mainfromrcomer:plot-single-legend
Feb 15, 2024

Conversation

rcomer
Copy link
Member

@rcomerrcomer commentedFeb 10, 2024
edited
Loading

PR summary

Closes#27762.

  • plot(x, y, label=['foo']) wherey is 1D now results in the legend label "foo" instead of "['foo']" (immediate change).
  • plot(x, y, label=sequence) wherey is 1D andsequence is not of length 1 is deprecated to error in future.

PR checklist

@rcomer

This comment was marked as outdated.

@rcomerrcomer marked this pull request as draftFebruary 10, 2024 15:21
@rcomer

This comment was marked as outdated.

@rcomerrcomer marked this pull request as ready for reviewFebruary 10, 2024 18:51
timhoffm

This comment was marked as outdated.

@rcomer

This comment was marked as outdated.

@timhoffm

This comment was marked as outdated.

@rcomer

This comment was marked as outdated.

@timhoffm

This comment was marked as outdated.

@timhoffm
Copy link
Member

@rcomer I've introduced#27780, which should resolve the boxplot issues you've had with this PR. I suggest to wait until that gets merged, then rebase on it and remove all the boxplot specifics here.

rcomer reacted with thumbs up emoji

@rcomer
Copy link
MemberAuthor

Hid a bunch of comments because they discuss issues withboxplot that are now being handled elsewhere. This change no longer touchesboxplot.


if cbook.is_scalar_or_string(label):
labels = [label] * n_datasets
else:
if len(label) != n_datasets:
Copy link
Member

@timhoffmtimhoffmFeb 15, 2024
edited
Loading

Choose a reason for hiding this comment

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

Optional but inverting the if branches is more readable:

Suggested change
iflen(label)!=n_datasets:
iflen(label)==n_datasets:
  • you remove the negation in the condition
  • And the short and good-case branch comes first

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'm a little sleepy but I think thisif doesn't have anelse.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Oh, I think I get it. I can have a look this evening (on the wrong computer at the moment).

@ksunden
Copy link
Member

Anyone can merge on green CI

@QuLogicQuLogic merged commitaf80c90 intomatplotlib:mainFeb 15, 2024
@rcomerrcomer deleted the plot-single-legend branchFebruary 15, 2024 20:55
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ksundenksundenksunden approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

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

Successfully merging this pull request may close these issues.

[Bug]: Inconsistent treatment of list of labels inplot when the input is a dataframe
4 participants
@rcomer@timhoffm@ksunden@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp