基本的な流れ 始めに、numpy, pyplot, mpl_toolkit.mplot3dをimportしておく。 np.arangeでx,yそれぞれの描画範囲を指定。 np.meshgridで2次元メッシュを作成 func(X,Y)よりZの値を算出 X, Y, Zの値を用いて描画 # 3Dグラフの描画 import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D x = np.arange(-5,5,0.25) y = np.arange(-5,5,0.25) X, Y = np.meshgrid(x,y) Z = func(X,Y) fig = plt.figure() ax = Axes3D(fig) ax.plot_wireframe(X,Y,Z) plt.sho
![Matplotlibで3Dグラフを描く - Qiita](https://cdn-ak-scissors.b.st-hatena.com/image/square/cbc1f0f7d57c0fbd7dc87d81bc07542c36a83eff/height=288;version=1;width=512/https%3A%2F%2Fcdn.qiita.com%2Fassets%2Fqiita-fb-2887e7b4aad86fd8c25cea84846f2236.png)