我在 Python 中使用 matplotlib 创建了一个 2D 绘图,一个例子是:
它是使用 2 个列表生成的:
import matplotlib.pyplot as plt
import numpy as np
plt.plot(X, Y) #X and Y are lists, containing the x and y coordinates of points respectively
plt.show()
Run Code Online (Sandbox Code Playgroud)
现在我想围绕 Y 轴创建该图的旋转,并以 Y 轴垂直的方式将其可视化。使用 matplotlib 如何做到这一点?