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
Description
Bug summary
In aprojection='3d'
axis, a scatter plot with thec
argument to colour the points is showing black markers in the position of nan values if thealpha
argument is passed. If thealpha
argument is not present, the nan values are not displayed, as expected. If thealpha
argument is present, even withalpha = 1
, the markers are coloured black.
Code for reproduction
n_x=200n_y=1n_z=200_x=np.linspace(-10,10,n_x)_y=0_z=np.linspace(-10,10,n_z)_xx,_yy,_zz=np.meshgrid(_x,_y,_z,indexing='ij')c=np.array(np.arange(n_x*n_y*n_z,dtype=float).reshape(n_x,n_y,n_z))c[int(n_x/4):int(n_x/2),:,:]=np.nanfig=plt.figure(figsize=(12,5))ax0=fig.add_subplot(121,projection='3d')ax0.scatter(_xx,_yy,_zz,c=c,marker='s')ax0.set_title('`alpha` OFF')ax1=fig.add_subplot(122,projection='3d')ax1.set_title('`alpha` ON')scat3d=ax1.scatter(_xx,_yy,_zz,c=c,marker='s',alpha=1)plt.show()
Actual outcome
Expected outcome
Additional information
No response
Operating system
Ubuntu
Matplotlib Version
3.7.0
Matplotlib Backend
module://matplotlib_inline.backend_inline
Python version
Python 3.10.9
Jupyter version
6.5.2
Installation
conda