Created
April 7, 2019 22:04
-
-
Save Leva-kleva/cfd8125ce0322791657ec23bf80b6303 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import pi | |
import numpy as np | |
import matplotlib.pyplot as plt | |
n = int(input()) | |
##generation | |
x = np.arange(0, 2*pi+0.1, 0.1) | |
array = [np.cos(i*x).tolist() for i in range(1, n+1, 1) ] | |
x = x.tolist() | |
## question one | |
graph = plt.figure() | |
ax = graph.add_subplot(111) | |
for i in range(n) : | |
ax.plot(x, array[i], label = "k = " + str(i+1)) | |
plt.legend() | |
## question two | |
for i in range(n) : | |
graph = plt.figure() | |
ax = graph.add_subplot(111) | |
ax.plot(x, array[i], label = "k = " + str(i+1)) | |
plt.legend() | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment