Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
Labels
P3backlog bugsomething broken documentationwritten for humans
@martinsondergaard

Description

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

    P3backlog bugsomething broken documentationwritten for humans

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /