# Jupyter Notebook で描く場合
%matplotlib inline
import numpy as np
import matplotlib.pylab as plt
from mpl_toolkits.mplot3d import Axes3D
def function_2(x):
return x[0]**2 + x[1]**2
x = []
x.append(np.arange(-3.0, 3.0, 0.2))
x.append(np.arange(-3.0, 3.0, 0.2))
mg_0, mg_1 = np.meshgrid(x[0], x[1])
y = function_2([mg_0, mg_1])
fig = plt.figure()
ax = Axes3D(fig)
ax.plot_wireframe(mg_0, mg_1, y)
plt.show()
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme