import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
fig=plt.figure(figsize=(12,6))
ax=Axes3D(fig)
X,Y=np.mgrid[-3:3:108j,-3:3:100j]
Z=np.exp(-X**2-Y**2)
surf=ax.plot_surface(X,Y,Z,rstride=1,cstride=1,cmap=plt.get_cmap('rainbow'))
ax.set_zlim(-0.1,1)
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
plt.title('$z=exp(-×^2/2-Y^2/2)$的三维图形')
fig.colorbar(surf,shrink=0.5,aspect=5)
plt.savefig('../R&Q_Pic/test5',dpi=600)
plt.show()