Skip to content

imshow size limitation #2105

Closed
Closed

Description

@NeedAName

imshow() and matshow() fail to display matrices larger than 2^15 in horizontal dimension,
e.g.:
M = np.ones((100,100000))
plt.imshow(M, cmap='jet', aspect='auto', alpha = 1, origin = 'lower', interpolation = 'none')
plt.show()

matplotlib 1.2.1,
ubuntu gnome 12.10

Activity

  1. tacaswell commented on Jun 1, 2013

    @tacaswell
    Member

    I have also had issues with this.

    On the other hand, one should ask why you are displaying something several orders of magnitude wider than your screen.

  2. dmcdougall commented on Jun 23, 2013

    @dmcdougall
    Member

    @NeedAName @tacaswell Is there an error message?

    I've run into size limitations with Agg, but I get an error message telling me what the problem is. I can understand writing a big image file to disk rather than displaying on the screen.

  3. tacaswell commented on Jun 23, 2013

    @tacaswell
    Member

    No error that I see (doing this interactively). Parts or all of the image just don't show up.

    If you zoom in on a small region, it behaves as expected.

  4. mdboom commented on Jun 24, 2013

    @mdboom
    Member

    Which backend is failing for the OP @NeedAName or @tacaswell ?

  5. tacaswell commented on Jun 24, 2013

    @tacaswell
    Member

    qt4agg (pysides)

  6. pelson commented on Aug 12, 2013

    @pelson
    Member

    Do you really want to show an image which is 100000 pixels wide? I'm guessing you don't have a monitor which is capable of displaying each pixel.

    Is it that you really want to make use of some downsampling algorithm first? I've been working on a bit of an example demonstrating the use of lazy arrays and sending them over to a matplotlib image for fast, lazy, subsampling. This would allow for zoomed in images of arbitrary size (I've been testing with 52428 ** 2 pixels) to be drawn without destroying a conventional machine... is that the kind of thing you are after?

  7. tacaswell commented on Aug 12, 2013

    @tacaswell
    Member

    In my data each column is a time step and I have interesting features at the 100, 1,000, and 10,000 time scales so I am using this to a) very inefficiently down-sample my data for display by letting the rasterization code do it and b) easy data-exploration.

    The lazy array example sounds exactly like what I want to use this for.

  8. mdboom commented on Aug 12, 2013

    @mdboom
    Member

    @pelson: That lazy array example sounds really nice to have. I wouldn't want this to hold up inclusion of something like that, but we should look to that to perhaps influence MEP18 about "plottable objects" and how or if we would create an abstract interface to a more dynamic interface to the data. (I'm basically just noting this for myself or someone else when they get around to writing MEP18).

  9. added this to the milestone on Aug 17, 2014
  10. petehuang commented on Jan 7, 2017

    @petehuang
    Contributor

    Reconfirming on 1.5.3 and TkAgg

  11. modified the milestones: , on Aug 29, 2017
  12. dstansby commented on Dec 29, 2022

    @dstansby
    Member

    The original code snipped seems to work fine for me on both macosx and Qt5Agg backends, so closing. If this is still an issue with a recent release, please re-open or post a comment!

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions