Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: Nan values in scatter 3d plot show in black colour when alpha parameter is passed. #25446

Open
@ricmperes

Description

@ricmperes

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

download

Expected outcome

download

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp