3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

matplotlibで3次元グラフを描く

Last updated at Posted at 2018-07-21
# 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()

3d_figure.png

参考

3
3
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?