Bug summary
When one of the datasets passed to boxplot is empty, no boxplot is drawn for that dataset. When the same is done for violinplot, violinplot crashes; instead it would be convenient if it behaved like boxplot (draw nothing for the empty dataset).
Code for reproduction
plt.boxplot([np.random.randn(sz) for sz in [100, 0, 200]]) # ok
plt.violinplot([np.random.randn(sz) for sz in [100, 0, 200]]) # crashes
Actual outcome
Second line crashes with
ValueError: zero-size array to reduction operation minimum which has no identity
Expected outcome
Empty violinplot for the second (empty) dataset.
Additional information
No response
Operating system
macOS
Matplotlib Version
3.12.0.dev68+g1cb6fe289
Matplotlib Backend
any
Python version
3.14.0
Jupyter version
ENOSUCHLIB
Installation
git checkout
Bug summary
When one of the datasets passed to boxplot is empty, no boxplot is drawn for that dataset. When the same is done for violinplot, violinplot crashes; instead it would be convenient if it behaved like boxplot (draw nothing for the empty dataset).
Code for reproduction
Actual outcome
Second line crashes with
Expected outcome
Empty violinplot for the second (empty) dataset.
Additional information
No response
Operating system
macOS
Matplotlib Version
3.12.0.dev68+g1cb6fe289
Matplotlib Backend
any
Python version
3.14.0
Jupyter version
ENOSUCHLIB
Installation
git checkout