Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Unrenderable violin plot

未關閉
#5,261 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
52/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
pandas, plotly, python

研究方向

首先,在 Python 3.13.5 下使用附帶的 df_melted.csv 執行提供的 Python 指令碼,然後檢查 test_plot.html 並重現 notebook 當機。追蹤此輸入的 violin plot 渲染路徑;生成的 HTML 能夠正常渲染,且同一個圖形不再導致 notebooks 當機,即表示完成。

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

描述

bug P2

I have some example input here and a script for creating a violin plot. The plot writes without error but appears unrenderable, it never displays and will e.g., cause notebooks to crash.

Python 3.13.5
plotly 6.0.1
pandas 2.2.3
import pandas as pd
import plotly.express as px
from plotly.graph_objects import Figure


def create_plot(df: pd.DataFrame) -> Figure:
    fig = px.violin(
        df,
        color='sample',
        color_discrete_sequence=px.colors.qualitative.Safe,
        y='value',
        x='sample',
        points=False,
        box=True,
        facet_col='metric',
        facet_col_wrap=1,
    )
    fig.update_yaxes(matches=None)
    fig.update_xaxes(matches=None)
    fig.update_layout(height=400 * len(df['metric'].unique()))
    return fig


if __name__ == '__main__':
    file = 'df_melted.csv'
    df = pd.read_csv(file)
    fig = create_plot(df)
    fig.write_html('test_plot.html')

Example input file is attached. The input is admittedly unusual for a violin plot (essentially all 0s or all 1s).

Thanks in advance!

df_melted.csv

主要語言
Python
星號
18.8k
分支
2.8k
平均合併
13 小時 28 分鐘
30 天內合併 PR
20

環境準備

從這裡開始

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

plotly/plotly.py 的其他 Issue

查看 plotly/plotly.py 的全部 Issue

相似的 Issue

更多 Python Issue

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

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