Skip to content

write_image doesn't seem to respect width/height #378

@DanielYang59

Description

@DanielYang59

Thanks for working on this helpful package again. I guess very likely similar to #12, but it seems to appear for our case:

  • kaleido: 1.0.0, plotly: 6.2.0
  • macos 15.6 (ARM64)
  • Python 3.10.18
import plotly.graph_objects as go

fig = go.Figure(go.Bar(x=["A", "B"], y=[1, 2]))
fig.update_layout(width=1200, height=300)

fig.write_image("out.svg")

Saved image (obviously not 1200:300):

Image

And the following as suggested in #12 seems to fix:

plotly.io.defaults.default_width = None
plotly.io.defaults.default_height = None

Metadata

Metadata

Assignees

Labels

P2needed for current cyclebugsomething broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions