You are reading an old version of the documentation (v1.4.3). For the latest version see

We're updating the default styles for Matplotlib 2.0

Learn what to expect in the new updates


Previous topic

pylab_examples example code:

Next topic

pylab_examples example code:

This Page

pylab_examples example code: stock_demo.pyΒΆ

(Source code, png, hires.png, pdf)

#!/usr/bin/env python

from matplotlib.ticker import MultipleLocator
from pylab import *
from data_helper import get_two_stock_data

d1, p1, d2, p2 = get_two_stock_data()

fig, ax = subplots()
lines = plot(d1, p1, 'bs', d2, p2, 'go')
ylabel('Normalized price')
xlim(0, 3)

title('INTC vs AAPL')
legend( ('INTC', 'AAPL') )


Keywords: python, matplotlib, pylab, example, codex (see Search examples)