In addition to SuperStormer's points ...
_cos are never used. You don't need to assignments to these variable.
In the event you will eventually use them...
Leading underscore are used to indicate private members of a class. To avoid collisions with keywords, by convention, a trailing underscore is used (i.e.
'tan' is being passed to
plt.legend(), but there is no tangent plot.
It works, but it is a bad habit to get into. Pass the desired curve titles directly to the
plt.plot() function (i.e.
, label="sin"), and simply call
plt.legend() with no arguments.
111 and why are you passing it to
import numpy as np
import matplotlib.pylab as plt
x = np.linspace(-360, 360, 45) * np.pi / 180
sin_ = plt.plot(x, np.sin(x), label="sin")
cos_ = plt.plot(x, np.cos(x), label="cos")
#tan_ = plt.plot(x, np.tan(x), label="tan")
# plt.show() # For CPython