[Image-SIG] show a matrix as image

Milton Cezar Ribeiro miltinho.astronauta at gmail.com
Mon Aug 10 16:49:09 CEST 2009


Dear all,

I have an object that is a matrix (i.e. a list of lists)
and I neet do plot it on screen as an image.
My image have values 1 and 2, and I would
like set different colors for each level.
I tryed figure it out without success. In fact
my images are 512x512, but I include a 10x10 sample below.


   mymatrix=[[1,2,2,2,1,2,2,2,1,1],
              [2,2,1,1,1,1,2,2,1,2],
              [1,1,2,2,1,1,1,1,1,1],
              [1,2,2,1,2,1,1,2,2,2],
              [2,1,2,1,1,1,1,2,1,1],
              [1,2,2,1,2,2,1,2,1,1],
              [2,1,2,1,1,1,2,1,1,1],
              [2,2,1,2,1,2,2,2,2,2],
              [2,2,2,1,2,2,2,1,1,1],
              [1,1,1,2,2,2,1,2,2,1]]

Any help are welcome.

Cheers

milton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20090810/4ec41187/attachment.htm>


More information about the Image-SIG mailing list