Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Description
Bug report
Bug summary
Creating a 3d scatterplot with ax.scatter() and the "c" argument for colour only produces 1 legend entry
Code for reproduction
importnumpyasnpimportmatplotlib.pyplotaspltfig=plt.figure()ax=fig.add_subplot(111,projection='3d')x=np.random.rand(20)y=np.random.rand(20)z=np.random.rand(20)c=np.random.randint(low=0,high=4,size=20)ax.scatter(x,y,z,c=c)leg= [1,2,3,4]ax.legend(leg)
Actual outcome
Expected outcome
The legend should have separate entries for "1", "2", "3", "4"
Matplotlib version
- Operating system: Ubuntu 18.04
- Matplotlib version: 3.3.0 (also exists at least as far back as 3.2.2)
- Matplotlib backend (
TkAgg
): - Python version: 3.6.3
- Jupyter version (if applicable): N/A
- Other libraries: Numpy