%pylab inline x = linspace(-10, 10, 1000) plot(x, sin(x), '-r') plot(x, cos(x), '--g') plot(x, sin(x), '-r', label='sine') plot(x, cos(x), '--g', label='cosine') xticks([-10, 0, 10]) yticks([-1, 0, 1]) ylim(-2, 2) legend() grid() x = linspace(0, 2 * pi, 1000) y = 1 + 2 * cos(5 * x) subplot(121) plot(x, y) subplot(122, polar=True) polar(x, y)