擅长:python、mysql、java
<p>如果您的目标是更好地查看函数的形状,可以使用matplotlib方法<code>view_init(elev=None, azim=None)</code>旋转轴;它设置轴角度的仰角和方位角。例如:</p>
<pre><code>from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# Test 3D function
X, Y, Z = axes3d.get_test_data(0.1)
ax.plot_wireframe(X, Y, Z, rstride=5, cstride=5)
ax.view_init(elev, azim)
plt.draw()
</code></pre>
<p>当标高=30,方位角=45时:</p>
<p><a href="https://i.stack.imgur.com/CHZ7h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CHZ7h.png" alt="enter image description here"/></a></p>
<p>当标高=30,方位角=90时:</p>
<p><a href="https://i.stack.imgur.com/gCynu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gCynu.png" alt="enter image description here"/></a></p>
<p>当标高=0,方位角=90时:</p>
<p><a href="https://i.stack.imgur.com/IsFVn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IsFVn.png" alt="enter image description here"/></a></p>