Plotting cos function

\[x \rightarrow \cos(x)\]
plot cos
import numpy as np
import matplotlib.pyplot as plt

fig, ax = plt.subplots(1,1)
x = np.linspace(0, 2*np.pi, 100)
y = np.cos(x)
ax.plot(x,y)
plt.show()

Total running time of the script: ( 0 minutes 0.044 seconds)

Gallery generated by Sphinx-Gallery