Unrenderable violin plot
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- pandas, plotly, python
- Domain
- data-visualization
Research direction
Start by running the provided Python script with the attached df_melted.csv under Python 3.13.5, then inspect test_plot.html and reproduce the notebook crash. Trace the violin plot rendering path for this input; done means the generated HTML renders and the same figure no longer crashes notebooks.
Written by the indexing model from the issue text.
Description
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!
- Dominant language
- Python
- Stars
- 18.8k
- Forks
- 2.8k
- Avg merge
- 13h 41m
- Merged PRs (30d)
- 21
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from plotly/plotly.py
-
P3 size: 1 task
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
P3 size: 1 task
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug P1
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
feature P3
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
feature P3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
All issues in plotly/plotly.py
Similar issues
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DiamondLightSource/dodal#2211 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openml/openml-python#1749 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sipyourdrink-ltd/bernstein#6191 ·