Skip to content

aspect="auto" for px.imshow does nothing when plotting RGB data #5172

Open
@martinsondergaard

Description

@martinsondergaard

I am trying to plot an RGB image that strecthes to fill the figure, and I cannot get it to work.

Using a standard 2D array works as expected, and the image is able to dynamically stretch to the figure.

arr = np.random.random((100, 100))
px.imshow(arr, aspect="auto")

But if I instead try to plot an RGB image with the same settings, then the image stays with its original aspect ratio.

img = np.random.random((100, 100, 3))
px.imshow(img, aspect="auto")

In this case, setting the aspect key does nothing and the image keeps a fixed aspect ratio. Explicitly adding with and height also does nothing to change the aspect ratio.

Is this an expected limitation of the aspect setting? If yes, then it should probably be documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething brokendocumentationwritten for humans

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy