-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5748,9 +5748,9 @@ def _pcolorargs(self, funcname, *args, shading='auto', **kwargs): | |
|
||
if shading == 'flat': | ||
if (Nx, Ny) != (ncols + 1, nrows + 1): | ||
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" | ||
f"be one larger than C{C.shape}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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'. See https://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 commentThe reason will be displayed to describe this comment to others. Learn more. @jklymak Sir, Updated the error message |
||
f"see help({funcname})") | ||
else: # ['nearest', 'gouraud']: | ||
if (Nx, Ny) != (ncols, nrows): | ||
raise TypeError('Dimensions of C %s are incompatible with' | ||
|
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...
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