O'Reilly logo
  • Sri Harsha V thinks this is interesting:

x = np.linspace(0, 2*math.pi) plt.plot(x, np.sin(x), label=r'$\sin(x)$') plt.plot(x, np.cos(x), 'ro', label=r'$\cos(x)$') plt.title(r'Two plots in a graph') plt.legend()


Cover of Mastering Python for Finance


Here plt.show() is missing. At least for me, it didn't work without including that statement at the last line.