.. _pylab_examples-subplots_adjust:

pylab_examples example code: subplots_adjust.py
===============================================



.. plot:: /home/tcaswell/source/p/matplotlib/doc/mpl_examples/pylab_examples/subplots_adjust.py

::

    import matplotlib.pyplot as plt
    import numpy as np
    
    plt.subplot(211)
    plt.imshow(np.random.random((100, 100)), cmap=plt.cm.BuPu_r)
    plt.subplot(212)
    plt.imshow(np.random.random((100, 100)), cmap=plt.cm.BuPu_r)
    
    plt.subplots_adjust(bottom=0.1, right=0.8, top=0.9)
    cax = plt.axes([0.85, 0.1, 0.075, 0.8])
    plt.colorbar(cax=cax)
    plt.show()
    

Keywords: python, matplotlib, pylab, example, codex (see :ref:`how-to-search-examples`)