Skip to content
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

Static renderers ignore height/width #2651

Closed
nicolaskruchten opened this issue Jul 17, 2020 · 4 comments
Closed

Static renderers ignore height/width #2651

nicolaskruchten opened this issue Jul 17, 2020 · 4 comments
Assignees
Milestone

Comments

@nicolaskruchten
Copy link
Contributor

This always renders at the default size for me:

import plotly.express as px
fig = px.scatter(y=[1,2,3], height=300, width=300)
fig.show("png")

I would consider this a bug, although there may be some reasoning behind this behaviour ... @jonmmease ?

@jonmmease
Copy link
Contributor

Yeah, this behavior is not intuitive. The issue is that the height and width here are overriding the height and width properties of the Image renderer. So this is roughly equivalend to

import plotly.io as pio
pio.renderers["png"].height = 300
pio.renderers["png"].width = 300

import plotly.express as px
fig = px.scatter(y=[1,2,3])
fig.show("png")

So here, width and height are really the default width and height. And here I think it makes sense for the figure's own width/height to take precedence.

But in any case, we do need to put some more thought into precedence.

@nicolaskruchten
Copy link
Contributor Author

Right so this is the same as fig.show("png", width=300, height=300)

@nicolaskruchten
Copy link
Contributor Author

See also #2653

@nicolaskruchten
Copy link
Contributor Author

This is addressed in #3240 and will be part of version 5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants