練習問題 1

練習問題 1 の matplotlib での解答

../../../_images/plot_exercice_1_1.png

Python ソースコード: plot_exercice_1.py

import numpy as np
import matplotlib.pyplot as plt
n = 256
X = np.linspace(-np.pi, np.pi, 256, endpoint=True)
C,S = np.cos(X), np.sin(X)
plt.plot(X, C)
plt.plot(X,S)
plt.show()

Total running time of the example: 0.05 seconds ( 0 minutes 0.05 seconds)