8000 aspect="auto" for px.imshow does nothing when plotting RGB data · Issue #5172 · plotly/plotly.py · GitHub
[go: up one dir, main page]

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
martinsondergaard opened this issue May 9, 2025 · 0 comments
Open
Labels
bug something broken documentation written for humans P3 backlog

Comments

@martinsondergaard
Copy link
martinsondergaard commented May 9, 2025

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.

@gvwilson gvwilson added bug something broken P3 backlog documentation written for humans labels May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken documentation written for humans P3 backlog
Projects
None yet
Development

No branches or pull requests

2 participants
0