βshortの自堕落Diary

web関係や、プログラミングなどを扱う予定です。プランなど立てていないので、不定期投稿になります。

sin波とcos波

import numpy as np
import matplotlib.pyplot as plt

x = np.arange(0, 6, 0.1)
y1 = np.sin(x)
y2 = np.cos(x)

plt.plot(x, y1, label = "sin")
plt.plot(x, y2, linestyle = "--", label = "cos")
plt.xlabel("x")
plt.ylabel("y")
plt.title('sin & cos')
plt.legend()
plt.show()

f:id:weblog2016it:20170715213834p:plain

参考


Pythonからはじめる数学入門


ゼロから作るDeep Learning ―Pythonで学ぶディープラーニングの理論と実装