🌐 AI搜索 & 代理 主页
Skip to content

[Bug]: violin's default alpha no longer persists #30613

@rcomer

Description

@rcomer

Bug summary

Perhaps this is an understood and accepted behaviour change, but I did not see anything in the changenotes. If we set the facecolor of a violin object after creating it, we now also override the default alpha.

Code for reproduction

import matplotlib.pyplot as plt
import numpy as np

fig, ax = plt.subplots()

data = np.random.normal(size=(10, 3))
violins = ax.violinplot(data)

first_violin = violins['bodies'][0]
first_violin.set_facecolor('tab:red')

plt.show()

Actual outcome

With main I get

Image

Expected outcome

With 3.10 I get

Image

Additional information

Bisects to #27304. The default alpha is now included in the default facecolor as a (color, alpha) tuple, rather than being passed by the alpha parameter.

Operating system

Ubuntu

Matplotlib Version

main

Matplotlib Backend

qtagg

Python version

3.13.7

Jupyter version

No response

Installation

git checkout

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions