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 for pcolormesh doesn't allow shading = 'flat' in the option#25058

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
jklymak merged 4 commits intomatplotlib:mainfromvivekvedant:fix-pcolormesh-issue
Jan 24, 2023

Conversation

vivekvedant
Copy link
Contributor

Fix for pcolormesh doesn't allow shading = 'flat' in the option#24678

PR Summary

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (andpytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a.. versionadded:: directive in the docstring and documented indoc/users/next_whats_new/
  • API changes are marked with a.. versionchanged:: directive in the docstring and documented indoc/api/next_api_changes/
  • Release notes conform with instructions innext_whats_new/README.rst ornext_api_changes/README.rst

Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a while, please feel free to ping@matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

@melissawm
Copy link
Member

Hi@vivekvedant - thanks for the PR! It looks like you have a couple of linting errors (you can see them herehttps://github.com/matplotlib/matplotlib/actions/runs/3980860096/jobs/6824208412 or clicking on "Details" on the Linting/flake8 job.) This does not block a review of your PR but if you have the time it would be nice to fix them 😄 Otherwise, now we wait for a maintainer to review your code. Thanks!

' X (%d) and/or Y (%d); see help(%s)' % (
C.shape, Nx, Ny, funcname))
raise TypeError(f"Dimensions of X({Nx}) and y({Ny}) should"
f"be one larger than C{C.shape}"
Copy link
Member

Choose a reason for hiding this comment

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

This error should probably say something about shading='flat', because it is possible to pass x and y the same shape as C for shading='auto' and shading='nearest'. Seehttps://matplotlib.org/stable/gallery/images_contours_and_fields/pcolormesh_grids.html for a discussion.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@jklymak Sir, Updated the error message

raise TypeError('Dimensions of C %s are incompatible with'
' X (%d) and/or Y (%d); see help(%s)' % (
C.shape, Nx, Ny, funcname))
raise TypeError(f"Dimensions of X({Nx}) and y({Ny}) should"
Copy link
Member

Choose a reason for hiding this comment

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

Y should be capitalized. Suggest "Relevant" because X and Y can be 2-D.... Otherwise this looks good to me...

Suggested change
raiseTypeError(f"Dimensionsof X({Nx}) andy({Ny}) should"
raiseTypeError(f"Relevant dimensionsof X({Nx}) andY({Ny}) should"

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Ok Sir, Thank you for the suggestion

@ksunden
Copy link
Member

lib/matplotlib/tests/test_axes.py::test_pcolorflaterror

Test failure is a consequence of this change, specifically that the older error message pattern is being matched in the test.

jklymak reacted with thumbs up emoji

@vivekvedant
Copy link
ContributorAuthor

Ok@ksunden Sir, Thanks for the insights I will recommit the changes to solve this issue

@vivekvedant
Copy link
ContributorAuthor

@jklymak Sir, I have updated the error message and also fix the issue related to Test failure

@dstansbydstansby added this to thev3.7.0 milestoneJan 24, 2023
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.

Thanks a lot for the PR - looks great to me! 👍

@jklymakjklymak merged commit0ec308d intomatplotlib:mainJan 24, 2023
@jklymak
Copy link
Member

Thanks@vivekvedant and congratulations on your first Matplotlib PR. We hope to see you again...

meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestJan 24, 2023
rcomer added a commit that referenced this pull requestJan 24, 2023
…058-on-v3.7.xBackport PR#25058 on branch v3.7.x (fix for pcolormesh doesn't allow shading = 'flat' in the option)
@ksundenksunden mentioned this pull requestFeb 20, 2023
6 tasks
@vivekvedantvivekvedant deleted the fix-pcolormesh-issue branchDecember 11, 2023 05:59
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

@jklymakjklymakjklymak approved these changes

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Labels
None yet
Projects
Milestone
v3.7.0
Development

Successfully merging this pull request may close these issues.

[Bug]: pcolormesh doesn't allow shading = 'flat' in the option
5 participants
@vivekvedant@melissawm@ksunden@jklymak@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp