You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Default color after setting alptha to Patch in legened #10574
After setting alpha to legend Patch, the color of edited patch resets to default(blue).
Code for reproduction
"""========Barchart========A bar plot with errorbars and height labels on individual bars"""importmatplotlib.pyplotaspltimportnumpyasnpN=5men_means= (20, 35, 30, 35, 27)
men_std= (2, 3, 4, 1, 2)
ind=np.arange(N) # the x locations for the groupswidth=0.35# the width of the barsfig, ax=plt.subplots()
rects1=ax.bar(ind, men_means, width, color='r', yerr=men_std)
women_means= (25, 32, 34, 20, 25)
women_std= (3, 5, 2, 3, 3)
rects2=ax.bar(ind+width, women_means, width, color='y', yerr=women_std)
# add some text for labels, title and axes ticksax.set_ylabel('Scores')
ax.set_title('Scores by group and gender')
ax.set_xticks(ind+width/2)
ax.set_xticklabels(('G1', 'G2', 'G3', 'G4', 'G5'))
leg=ax.legend((rects1[0], rects2[0]), ('Men', 'Women'))
#this line causes bug - reset to default color(blue)leg.get_patches()[0].set_alpha(0.854321)
plt.show()
Activity
fix for matplotlib#10574
anntzer commentedon Nov 3, 2018
Looks like duplicate of #11702 and fixed by #11703.