import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot, numpy, sys

print 'Python     :',sys.version             # Python     : 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
print 'matplotlib :',matplotlib.__version__  # matplotlib : 0.99.3
print 'numpy      :',numpy.__version__       # numpy      : 1.4.0

DNs = numpy.random.randint(low=0,high=255,size=(512,580))
DNs = DNs.astype(numpy.uint8)

#image = matplotlib.pyplot.imshow(DNs, cmap='hot')
#matplotlib.pyplot.savefig('8-bit.png')
matplotlib.pyplot.imsave('8-bit.png',DNs,cmap='hot',origin='upper')
