Stress test
import numpy as np
import time
from matplotlib import pyplot as plt
%matplotlib inline
#counts to 1e6
start = time.time()
N = range(int(1e6))
for n in N:
print(n, end = '\r')
print('\nTook ' + str(int(time.time()-start)) + ' sec')
#displays a plot
fig = plt.figure(figsize = (10, 8))
x = np.linspace(-5, 5, 10000)
y = np.cos(x)
z = np.sin(x)
plt.scatter(x, y, s = 2, color = 'm', label = 'cos(x)')
plt.scatter(x, z, s = 2, color = 'g', label = 'sin(x)')
plt.xlabel('x-axis')
plt.ylabel('y-axis')
plt.xlim(-5, 5)
plt.ylim(-1, 1)
plt.legend()
plt.title('This is a graph!')
plt.show()
999999
Took 124 sec