We can easily specify the color and line style of each plot.
In [1]:
%pylab inline
In [2]:
x = linspace(-10, 10, 1000)
plot(x, sin(x), '-r')
plot(x, cos(x), '--g')
Out[2]:
Here are a few other customization options:
In [3]:
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()
We can plot Cartesian and polar plots side by side.
In [4]:
x = linspace(0, 2 * pi, 1000)
y = 1 + 2 * cos(5 * x)
subplot(121)
plot(x, y)
subplot(122, polar=True)
polar(x, y)
Out[4]: