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

未关闭
#378 4 条评论 2 个 reaction 已指派 1 人 在 GitHub 查看

@ayjayt 已经在做这个了。

开始于 2025年8月11日。

评估

这个 Issue 还没有评估数据。

描述

bug P2

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
主要语言
Python
星标
504
派生
65
平均合并
6 天 9 小时
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

plotly/kaleido 的其他 Issue

查看 plotly/kaleido 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。