Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Labels
Description
Bug summary
Plotting a scatter wherec=
is a sequence with the initial value beingnan
will have the legend entry showing text only
Code for reproduction
importmatplotlib.pyplotaspltimportnumpyasnpx=np.linspace(0,1,50)y=np.linspace(-1,1,50)c=np.linspace(10,100,50)c_nan=np.linspace(10,100,50)c_nan[0]=np.nanfig,ax=plt.subplots()line1=ax.scatter(x,y,c=c,s=12,label='Test 1')line2=ax.scatter(x*2,y*2,c=c_nan,s=12,label='Test 2')ax.legend()plt.show()
Actual outcome
Expected outcome
Have each legend entry show a symbol
Additional information
No response
Operating system
WIndows
Matplotlib Version
3.6.3
Matplotlib Backend
Qt5Agg
Python version
3.10.x
Jupyter version
No response
Installation
pip