Skip to content

Instantly share code, notes, and snippets.

@yzhong52
Created February 16, 2020 05:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yzhong52/411f347f1536b40944578c3913a9d815 to your computer and use it in GitHub Desktop.
Save yzhong52/411f347f1536b40944578c3913a9d815 to your computer and use it in GitHub Desktop.
Beyond data scientist: 3d plots in Python with examples
vertices, triangles = read_obj("teapot.obj")
x = vertices[:,0]
y = vertices[:,1]
z = vertices[:,2]
ax = plt.axes(projection='3d')
ax.set_xlim([-3, 3])
ax.set_ylim([-3, 3])
ax.set_zlim([0, 3])
ax.plot_trisurf(x, z, triangles, y, shade=True, color='white')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment