plotly / plotly/plotly.py

Updating `xaxis_range` changes y-axis range for `px.scatter` when marginals are displayed.

未关闭
#4,643 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug P3
主要语言
Python
星标
18.8k
派生
2.8k
平均合并
16 小时 26 分钟
30 天内合并 PR
21

描述

Problem

When using px.scatter and displaying both marginals, updating the xaxis_range will change the yaxis_range such that data will be cut off.

Changing the yaxis_range works as expected.
The bug only occurs when using both marginals.

I am using the current latest version 5.22.0.

Code

import plotly.express as px

# figure normal
fig = px.scatter(
    x=[3, 37, 37, 69],
    y=[1.8, 3.9, 2.7, 4.8],
    marginal_x="histogram",
    marginal_y="histogram",
)

fig.show()

# x axis is modified correctly
# but y axis is modified too
fig.update_layout(xaxis_range=[0, 185])

fig.show()

The first fig.show() produces:
working

The second fig.show() produces:
bugged

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先运行提供的 Python 复现代码,使用 px.scatter 和两个边际直方图,然后检查生成的图形如何处理 xaxis_range 和 yaxis_range。完成的标准是,更改 xaxis_range 不再改变或裁剪 y 轴范围,并且有一个涵盖两个边际直方图的回归测试。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
data-visualization
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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