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
pyplot.plot conflict: markerfacecolor ='none' and alpha #11104
Bug summary
I tried to use a previously-works-fine code to make a plot but failed to reproduce the same one -- after updating matplotlib to 2.2. The hollow circles in plot (defined by markerfacecolor='None') are now in black facecolor. After manually locating the error, I found that the keyword 'alpha' seems conflict to markerfacecolor = 'None' which never happened before. This conflict will only affect facecolor set as 'None'.
Code for reproduction
importmatplotlib.pyplotasplt# This works properlyplt.figure()
plt.plot([1,2,3],[1,2,3],'o',c='g',markeredgecolor='g',markersize=10,markerfacecolor='r',linewidth=2,alpha=1)
plt.show()
# markerfacecolor='none' conflicts with alpha keywordplt.figure()
plt.plot([1,2,3],[1,2,3],'o',c='g',markeredgecolor='g',markersize=10,markerfacecolor='none',linewidth=2,alpha=1)
plt.show()
# markerfacecolor='none' conflicts with alpha keyword, and this happens on different alphasplt.figure()
plt.plot([1,2,3],[1,2,3],'o',c='g',markeredgecolor='g',markersize=10,markerfacecolor='none',linewidth=2,alpha=0.5)
plt.show()
# remove alpha keyword and markerfacecolor='none' works wellplt.figure()
plt.plot([1,2,3],[1,2,3],'o',c='g',markeredgecolor='g',markersize=10,markerfacecolor='none',linewidth=2) # no alpha hereplt.show()
Activity
ImportanceOfBeingErnest commentedon Apr 22, 2018
This is reproducible on current master.
print(line.get_markerfacecolor())prints"none"correctly, so this might happen at draw time?!anntzer commentedon Apr 22, 2018
Bisects to #9911. Humpf...
anntzer commentedon Apr 22, 2018
After some investigation, turns out that the signature
indeed requires rgbFace to possibly be None. The face color is converted per
and convert_face explicitly checks for None at
Looks like the "easy" fix is to manually revert the relevant parts of #9911.
anntzer commentedon Apr 23, 2018
Actually I have a better fix coming.