You are reading an old version of the documentation (v1.4.0). For the latest version see https://matplotlib.org/stable/
matplotlib

Previous topic

pylab_examples example code: subplot_toolbar.py

Next topic

pylab_examples example code: subplots_demo.py

This Page

pylab_examples example code: subplots_adjust.pyΒΆ

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

../../_images/subplots_adjust.png
from pylab import *


subplot(211)
imshow(rand(100,100), cmap=cm.BuPu_r)
subplot(212)
imshow(rand(100,100), cmap=cm.BuPu_r)

subplots_adjust(bottom=0.1, right=0.8, top=0.9)
cax = axes([0.85, 0.1, 0.075, 0.8])
colorbar(cax=cax)
show()

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