Re: Coloring cells
- To: mathgroup at smc.vnet.net
- Subject: [mg83594] Re: [mg83574] Coloring cells
- From: Syd Geraghty <sydgeraghty at mac.com>
- Date: Sat, 24 Nov 2007 04:09:18 -0500 (EST)
- References: <fhrrsj$5gh$1@smc.vnet.net> <fhu7ui$7fh$1@smc.vnet.net> <200711210758.CAA06030@smc.vnet.net> <200711231033.FAA25112@smc.vnet.net>
Hi Jamie,
Take a look at tutorial/FormattedOutput in online Help,
An example is given there which is very close to what you wanted:-
Grid[Partition[
Table[If[PrimeQ[i], Item[i, Background -> LightYellow], i], {i, 1,
100}],
10], Background -> LightBlue]
It is almost always true that there is a straightforward way of doing
what you want (particularly now in V6) but finding it
is not always easy.
HTH
Yours truly ... Syd
Syd Geraghty B.Sc., M.Sc.
sydgeraghty at mac.com
San Jose, CA
My System
Mathematic 6.0.1 for Mac OS X x86 (32 - bit) (June 19, 2007) License
L2983-5890
MacOS X V 10.4 .10
MacBook Pro 2.33 Ghz Intel Core 2 Duo 2GB RAM
On Nov 23, 2007, at 5:33 AM, Jamie Coventry wrote:
> Hi All,
>
> I'm presenting data in a square arrangement and am trying to
> highlight specific cells in it which have something in common, e.g.
> all are prime, or all are odd numbers. I don't mind if the data is in
> an array/matrix/table, as long as it is n x n.
>
> myData = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
>
> How do I either color the text or the background of a particular
> cell, based on a rule (e.g. how could I color just 2, 3, 5, and 7 in
> the data given)?
>
> Thanks in advance,
>
> Jamie
>
>
- References:
- Re: ordered positions (OrderedPosition?)
- From: Christian Chong-White <christian_chongwhite@hotmail.com>
- Coloring cells
- From: Jamie Coventry <jcoventry@renaissance.edu.hk>
- Re: ordered positions (OrderedPosition?)