Clarify array shape vs image size in imshow() docstring by mspacek · Pull Request #11125 · matplotlib/matplotlib · GitHub
Skip to content

Clarify array shape vs image size in imshow() docstring - #11125

Closed
mspacek wants to merge 1 commit into
matplotlib:masterfrom
mspacek:patch-2
Closed

mspacek wants to merge 1 commit into
matplotlib:masterfrom
mspacek:patch-2

Conversation

@mspacek

@mspacek mspacek commented Apr 25, 2018

Copy link
Copy Markdown
Contributor

PR Summary

The shape of a 2D array is (nrows, ncols), but images are normally described by width x height (ncols, nrows). The docstring for imshow() had these a bit mixed up in my opinion. This clarifies it.

I'm not sure if the default is to use (m, n) or (n, m) to represent the shape of a 2D array. Grepping through the project reveals roughly equal use of both. I've left it as (m, n) in this PR, but maybe we should do another PR to make the notation consistent throughout the project.

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@ImportanceOfBeingErnest

Copy link
Copy Markdown
Member

@mspacek

mspacek commented Apr 25, 2018

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants