plotly / plotly/plotly.py

ecdf with normed histogram

未關閉
#4,772 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

feature P3
主要語言
Python
星號
18.8k
分支
2.8k
平均合併
16 小時 26 分鐘
30 天內合併 PR
21

描述

I really like the plotly.express.ecdf and have been using it a lot in my daily work.
When I show ecdf plots in meetings, I usually show it with marginal='histogram', since this is easier understandable for the non-data-scientists in the room.
However, since the amount of data varies I would like to have a normalized histogram, i.e. have percent values.

I know this would be possible with subplots, but there are really a lot of ugly adjustments to make.
So a solution could be to show the percentage in the hint as well, or something like histnorm from plotly.express.histogram.

Example for easy testing:

import plotly.express as px
import numpy as np
import pandas as pd

# Generate random data
np.random.seed(42)  # For reproducibility
data = np.random.normal(loc=0, scale=1, size=1000)  # Normal distribution data

# Create a pandas dataframe
df = pd.DataFrame({'Values': data})

# Create ECDF plot with histogram
fig = px.ecdf(data, 
              ecdfnorm='percent', 
              marginal='histogram')

# Show the figure
fig.show()

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 px.ecdf 入口點開始,比較在 px.histogram 中 marginal='histogram' 與 histnorm 是如何設定的。確定預期行為是正規化的 marginal bins,還是 hover 時顯示百分比資訊,然後使用提供的 NumPy 和 pandas 範例驗證結果;當 ECDF 直方圖的 marginal 無需手動建立子圖即可表示百分比時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
numpy, pandas, plotly, python
領域
data-visualization
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。