Answers for "3d plotting python"

2

3d plots in python

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

#plotting a scatter for example
fig = plt.figure()
ax = fig.add_subplot(111,projection = "3d")
ax.scatter(xs = data["x"], ys = data["y"], zs = data["z"])
fig
Posted by: Guest on August-11-2021
0

plot 3d points in python

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



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

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



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()
Posted by: Guest on May-21-2020
0

plot 3d python

fig = plt.figure()
ax = plt.axes(projection='3d')
Posted by: Guest on June-29-2021

Python Answers by Framework

Browse Popular Code Answers by Language