Skip to content

imshow documentation has confusing matrix dimensions #10323

Closed

Description

This Stackoverflow question brings the confusing matrix dimensions used in the imshow documentation to our attention.

image

According to the docstring one may use arrays of shapes (n, m) etc. which are then named MxN.

However, according to wikipedia

A matrix with m rows and n columns is called an m × n matrix or m-by-n matrix.

This is also the convention used by numpy, e.g. the arrays.ndarray.html speaks about

A 2-dimensional array of size 2 x 3, composed of 4-byte integer elements:
x = np.array([[1, 2, 3], [4, 5, 6]], np.int32)

The documentation should therefore either speak of

  • shape (n, m), or n x m array (nxm looks strange)
  • shape (N, M) or NxM array
  • shape (m, n) or m x n array
  • shape (M, N) or M x N array

Now, which is better? All capitalized or not, n or m being rows?

Activity

  1. timhoffm commented on Jan 26, 2018

    @timhoffm
    Member

    Also mentioned in #10225 .

  2. anntzer commented on Jan 26, 2018

    @anntzer
    Contributor

    Should clearly be m first and n second. I prefer (m, n) but am not going to fight over capitalization and commas vs crosses.

  3. ImportanceOfBeingErnest commented on Jan 26, 2018

    @ImportanceOfBeingErnest
    MemberAuthor

    Oh great, @timhoffm If you are already aware of this, this can be just closed as duplicate I guess.

  4. timhoffm commented on Jan 26, 2018

    @timhoffm
    Member

    I propose to find a consensus on the format here before closing. I‘m afraid the other thread has too many aspects to reasonably discuss them there. It‘s more a collection.

    That said, I don‘t have a strong opinion here. Numpy seems to use capital letters but mixes MxN and (M, N). See e.g. https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.linalg.lstsq.html#numpy.linalg.lstsq

  5. ImportanceOfBeingErnest commented on May 22, 2018

    @ImportanceOfBeingErnest
    MemberAuthor

    This issue is sufficiently addressed by the new docs in #10982.
    Hence I'm closing this.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions