Python Forum
3D Plotting in Matplotlib for Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3D Plotting in Matplotlib for Python
#1
Hi everyone, I'm very new with Python. I found this code and I would like to change the color of a specific position in this 3d-matrix.

Thanks in advance,

Regards,


[Image: e1DQ6kA.png]

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt



fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

z = [8,7,6,7,9,10,9,8,10,8,9,10,9,8,10,8,9,10,9,8,10,8,9,10]
x = [1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4]
y = [1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6]


ax.scatter(x, y, z, c='r', marker='o')
    

ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')

plt.show()
Reply


Messages In This Thread
3D Plotting in Matplotlib for Python - by pabloanm - Apr-20-2019, 07:37 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020