Re: ArrayPlot: ColorRules v. ColorFunction
- To: mathgroup at smc.vnet.net
- Subject: [mg57962] Re: ArrayPlot: ColorRules v. ColorFunction
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Tue, 14 Jun 2005 05:10:26 -0400 (EDT)
- Organization: The Open University, Milton Keynes, England
- References: <d8jli2$stv$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Bruce Colletti wrote:
> Re Mathematica 5.1 under WinXP.
>
> T is a 5x5 matrix of numbers.
>
> Using ArrayPlot, how would I display the colored array, where entries in [0, 0.3], (0.3,0.5] and (0.5,1] are Red, White and Blue respectively (default color is green for values outside [0,1])?
>
> Thanks.
>
> Bruce
>
Hi Bruce,
You must to define your own color function as in the following line
In[1]:=
ArrayPlot[T, ColorFunction ->
(Which[0 <= #1 <= 0.3, Red,
0.3 < #1 <= 0.5, White,
0.5 < #1 <= 1, Blue,
True, Green] & )];
Best regards,
/J.M.