8000 Overlapping 3D objects · Issue #12620 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Overlapping 3D objects #12620
Closed
Closed
@Chutlhu

Description

@Chutlhu

Bug report

When plotting a 3D plane, a segment and a few points, there are visualization issues:
The 'filling' of the plane cover the line and the points

import mpl_toolkits.mplot3d as a3
import matplotlib.pylab as plt
import numpy as np    

fig = plt.figure()
ax = a3.Axes3D(fig)

# create an orizontal plane
corners = [[0,0,0],[0,5,0],[5,5,0],[5,0,0]]
tri = a3.art3d.Poly3DCollection([corners], alpha=1)
tri.set_color('w')
tri.set_edgecolor('k')
ax.add_collection3d(tri)

# plot a vector
ax.plot([2,2],[2,2],[0,4], c = 'r')

# plot some points
ax.scatter([1,3],[1,3],[1,3], c = 'r')

ax.set_xlim([0, 5.0])
ax.set_ylim([0, 5.0])
ax.set_zlim([0, 2.5]);

plt.show()

output figure
image

expected output:
the red segment should at [2, 2, 0] in the middle of the plane. It looks as it is 'under' it

stackoverflow thread

Matplotlib version

  • Operating system:
  • Matplotlib version: 3.0.0
  • Matplotlib backend (print(matplotlib.get_backend())): Qt5, GTK and WX
  • Python version: 3.6.6

Installed with pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0