Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this 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.
937f4c9
to0732c7d
Comparefdf570b
to8ed4c02
CompareHi@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! |
9ec152d
to98dd012
Comparelib/matplotlib/axes/_axes.py Outdated
' 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}" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
lib/matplotlib/axes/_axes.py Outdated
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" |
There was a problem hiding this comment.
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...
raiseTypeError(f"Dimensionsof X({Nx}) andy({Ny}) should" | |
raiseTypeError(f"Relevant dimensionsof X({Nx}) andY({Ny}) should" |
There was a problem hiding this comment.
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
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. |
Ok@ksunden Sir, Thanks for the insights I will recommit the changes to solve this issue |
6d8e671
to04f0dc1
Compare@jklymak Sir, I have updated the error message and also fix the issue related to Test failure |
There was a problem hiding this 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! 👍
Thanks@vivekvedant and congratulations on your first Matplotlib PR. We hope to see you again... |
…g = 'flat' in the option
…058-on-v3.7.xBackport PR#25058 on branch v3.7.x (fix for pcolormesh doesn't allow shading = 'flat' in the option)
Fix for pcolormesh doesn't allow shading = 'flat' in the option#24678
PR Summary
PR Checklist
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst