python pyplot でグラフ

math.sin()でなくnp.sin()を使う
1
2
3
4
5
6
7
8
9
10
11
import matplotlib.pyplot as plt
import numpy as np
 
 
x=np.arange(-np.pi,np.pi,.1)
 
y = np.sin(x)
 
plt.plot(x,y)
plt.hlines([0,-1,1], x[0],x[-1], linestyles="dashed")
plt.show()

コメント

このブログの人気の投稿

Python OpenCVとWebカメラでバーコードリーダー

VB.net Dictionaryクラスの初期化