Matplotlib 3D-为另一个轴设置刻度

时间:2019-12-02 07:21:48

标签: python-3.x matplotlib 3d

如何将刻度线设置在相反的轴上?当我放下它时,轴会改变,但不会以这种方式改变。谢谢

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

mpl.rcParams['legend.fontsize'] = 10

fig = plt.figure()
ax = fig.gca(projection='3d')
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')
ax.legend()

plt.show()

enter image description here

0 个答案:

没有答案