search
LoginSignup
44
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

jupyter notebook 内でのグラフ表示

matplotlibのグラフをインラインで表示

  • グラフ固定の場合
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 100)
y  = np.sin(x)
plt.plot(x, y)

inline.PNG

  • グラフを移動・拡大縮小したい場合
%matplotlib notebook
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 100)
y  = np.sin(x)
plt.plot(x, y)

notebook.PNG

下のアイコンで移動や拡大縮小・保存ができます。

Register as a new user and use Qiita more conveniently

  1. You can follow users and tags
  2. you can stock useful information
  3. You can make editorial suggestions for articles
What you can do with signing up
44
Help us understand the problem. What are the problem?