Python-3D图表 (Python - 3D Charts)
Python is also capable of creating 3d charts. It involves adding a subplot to an existing two-dimensional plot and assigning the projection parameter as 3d.
Python还能够创建3d图表。 它涉及将子图添加到现有的二维图,并将投影参数分配为3d。
绘制3D图 (Drawing a 3D Plot)
3dPlot is drawn by mpl_toolkits.mplot3d to add a subplot to an existing 2d plot.
3dPlot由mpl_toolkits.mplot3d绘制,以将子图添加到现有的2d图中。
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
chart = plt.figure()
chart3d = chart.add_subplot(111, projection='3d')
# Create some test data.
X, Y, Z = axes3d.get_test_data(0.08)
# Plot a wireframe.
chart3d.plot_wireframe(X, Y, Z, color='r',rstride=15, cstride=10)
plt.show()
Its output is as follows −
其输出如下-
翻译自: https://www.tutorialspoint.com/python_data_science/python_3d_charts.htm