import numpy as np
import pylab as pl
if __name__ == '__main__':
fig = pl.figure(figsize=(10, 5))
ax = fig.add_subplot(121)
toplot = np.random.randint(0, 255, [40, 40])
pl.text(1, 3, 'Left picture', fontsize=20)
pl.imshow(toplot)
ax = fig.add_subplot(122)
toplot = np.random.randint(0, 2, [40, 40])
pl.text(1, 3, 'Right picture', fontsize=20)
pl.imshow(toplot)
pl.savefig('image_%d.png' % 0)