matplotlib画三维直线图

https://blog.csdn.net/hustqb/article/details/78180337 matplotlib——3D绘图教程

https://blog.csdn.net/weixin_40198632/article/details/78472015

https://blog.csdn.net/guduruyu/article/details/78050268

Python绘制三维散点图并给散点标记记号

【python图像处理】python绘制3D图形

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

fig = plt.figure()
ax = fig.gca(projection='3d')

# Prepare arrays x, y, z
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
z = np.linspace(-2, 2, 100)
r = z**2 + 1
x = r * np.sin(theta)
y = r * np.cos(theta)

ax.plot(x, y, z, label='parametric curve')  #这里传入x, y, z的值
ax.legend()

猜你喜欢

转载自blog.csdn.net/qq_37791134/article/details/84829677
今日推荐