2019-07-01から1ヶ月間の記事一覧
The code how to remove all graphs plotted import matplotlib.pyplot as plt ...... plt.gca().clear()
表示されているグラフの削除 import matplotlib.pyplot as plt 省略 plt.gca().clear()
サンプルコード In [3]: arr = [1,2,2,3,4,5,4,19] In [4]: mea = pd.Series(arr).rolling(window=2).mean() In [5]: print(mea) Out[5]: 0 NaN 1 1.5 2 2.0 3 2.5 4 3.5 5 4.5 6 4.5 7 11.5
ipythonの起動時にpylabオプションをつける ipython --pylab 簡単なグラフをプロットしてみる In [1]: import numpy as np In [2]: import matplotlib.pyplot as plt In [3]: x = arange(10) In [4]: y = np.random.rand(10) In [5]: plt.plot(x,y) Out[5]: [<matplotlib.lines.Line2D at 0x7ff0f46f5f60></matplotlib.lines.line2d>…