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

Incorrect overlap of markers in scatter3D #5830

Closed
@praveenv253

Description

@praveenv253

I understand that 3d plotting is as yet a bit hacky, but from what little I understand of the code forPath3DCollection (or is itPatch3DCollection as the docstring for scatter says?), it feels like this should be fixable (patches aren't intersecting each other here).

I'm using Matplotlib v1.5.0. The zorder of markers plotted by 3d scatter goes wrong in certain views.

Here's a minimal example:

importnumpyasnpimportmatplotlib.pyplotaspltfrommpl_toolkits.mplot3dimportAxes3Dx=np.array([-1,0,1])y=np.array([0,0,0])fig=plt.figure()ax=fig.add_subplot(111,projection='3d')patches=ax.scatter(x,y,y,s=2500,c=x)plt.show()

I've made the marker sizes really huge to illustrate the point clearly - in the initial view, the overlap is correct (in this example), but on rotation, it goes wrong:
front_view
back_view

It's not fully clear because of the depthshading, but red is on top of green, which is on top of blue.
It definitely looks likesome zorder information is present - depthshade is using it correctly - but it's not being used to update the drawing order correctly.

This problem gets severely exacerbated as the number of scatter points increases. To demonstrate, execution ofthis gist produces the following ugly result:
sphere
The sphere ought to be mostly red (it's the top view of a spherical grid with color=z-coordinate), instead it's mostly blue because of poor ordering. Rotating it will make it seem like there are holes in the sphere at different places because of incorrect overlap in some strange patterns.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp