Subplot

Multiple regular axes are created with subplot. This is a screenshot of the matplotlib figure window. Navigation controls on the bottom of the figure support a variety of pan and zoom modes.

    import pylab as pl


    t1 = pl.arange(0.0, 5.0, 0.1)
    t2 = pl.arange(0.0, 5.0, 0.02)
    t3 = pl.arange(0.0, 2.0, 0.01)

    pl.subplot(211)
    pl.plot(t1, cos(2*pi*t1)*exp(-t1), 'bo', t2, cos(2*pi*t2)*exp(-t2), 'k')
    pl.grid(True)
    pl.title('A tale of 2 subplots')
    pl.ylabel('Damped')
    
    pl.subplot(212)
    pl.plot(t3, cos(2*pi*t3), 'r--')
    pl.grid(True)
    pl.xlabel('time (s)')
    pl.ylabel('Undamped')