import numpy as np import matplotlib.pyplot as plt x = np.arange(-5, 5, 0.1) y = np.sin(x) plt.title("graph") # グラフのタイトル plt.xlabel("x") # x軸(横軸)のラベル plt.ylabel("y") # y軸(縦軸)のラベル plt.plot(x, y) plt.xlim(-np.pi, np.pi) plt.ylim(-1.2, 1.2) plt.show()