Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matplotlib fill alpha changes color

I am trying to make matplotlib create a fill that is very transparent by using the alpha command, but it seems to actually change the color. It's there a way to increase transparency without changing the color?

ax.fill_between(x, 0, y[0], facecolor='#614126', interpolate=True, alpha=.3)
like image 482
user2242044 Avatar asked Dec 04 '25 10:12

user2242044


1 Answers

I've run into a similar issue, where specifying an alpha value caused the color to revert to the default blue. In this case, I was able to override whatever was causing the change by using setp(), like so:

my_plot = ax.fill_between(x, 0, y[0], interpolate=True, alpha=.3)
matplotlib.pyplot.setp(my_plot, facecolor='#614126')
like image 184
Tommy Kahn Avatar answered Dec 06 '25 23:12

Tommy Kahn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!