plotly / plotly/Kaleido

`write_image` doesn't seem to respect `width/height`

Open
#378 4 comments 2 reactions 1 assignee View on GitHub

@ayjayt is already working on this.

Since Aug 11, 2025.

bug P2
Dominant language
Python
Stars
498
Forks
62
Avg merge
1d 11h
Merged PRs (30d)
2

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.