Re: how to convert a matrix to a graphy
- To: mathgroup at smc.vnet.net
- Subject: [mg49211] Re: how to convert a matrix to a graphy
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Thu, 8 Jul 2004 02:50:44 -0400 (EDT)
- Organization: The University of Western Australia
- References: <ccdm0b$seq$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <ccdm0b$seq$1 at smc.vnet.net>,
jianchaoyao at hotmail.com (Justin) wrote:
> The matrix A is a 8*8 one. The largest gray level is a_max and the
> smallest is -a_max.
>
> I wanna convert this matrix to a graphy. How to do?
Use RasterArray, Raster, or ListDensityPlot. For example,
mat = Table[0.1 Mod[i, j], {i, 2, 10}, {j, 2, 10}]
Show[Graphics[RasterArray[Map[GrayLevel,mat,{2}]]],
AspectRatio -> Automatic]
Show[Graphics[Raster[mat,{{2,2},{10,10}},{Min[mat],Max[mat]}]],
AspectRatio -> Automatic]
ListDensityPlot[mat,Frame -> False, Mesh -> False]
Cheers,
Paul
--
Paul Abbott Phone: +61 8 9380 2734
School of Physics, M013 Fax: +61 8 9380 1014
The University of Western Australia (CRICOS Provider No 00126G)
35 Stirling Highway
Crawley WA 6009 mailto:paul at physics.uwa.edu.au
AUSTRALIA http://physics.uwa.edu.au/~paul