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 摘要。