You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Activity
jonmmease commentedon Jul 17, 2020
Yeah, this behavior is not intuitive. The issue is that the
heightandwidthhere are overriding theheightandwidthproperties of the Image renderer. So this is roughly equivalend toSo here,
widthandheightare 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 commentedon Jul 17, 2020
Right so this is the same as
fig.show("png", width=300, height=300)nicolaskruchten commentedon Jul 17, 2020
See also #2653
nicolaskruchten commentedon Jun 16, 2021
This is addressed in #3240 and will be part of version 5.0