MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: automatic grid


Many thanks to David Park, Bob Hanlon and others for answering my query about coloring a grid!

Francisco
________________________________

From: Bob Hanlon <hanlonr357 at gmail.com>
To: Francisco Gutierrez <fgutiers2002 at yahoo.com> 
Cc: MathGroup <mathgroup at smc.vnet.net> 
Sent: Saturday, June 22, 2013 8:31 AM
Subject: [mg131316] Re: automatic grid


Aveamos1 = {"V1", "V2", "V3", "V4"};=0Aveamos2 = {5, 20, 7, 11};

Clear[color];
color[x_?NumericQ] := Style[x, If [x > 10, Red, Black], 16];
color[x_] := Style[x, 16];

Grid[{Aveamos1, color /@ veamos2}]

Clear[color];
color[x_?NumericQ] :=
Style[x, If[x > 10, Red,
    If[x > 5, Green, Blue]], 16];
color[x_] := x;

Grid[= {Aveamos1, color /@ veamos2}]


Bob Hanlon


On Sat, Jun 22, 2013 at 3:33 AM, Francisco Gutierrez <fgutiers2002 at yahoo.com> wrote:

>Dear Group:
>I have a grid (in reality, a collection of grids) and would like to make Mathematica give each entry of the grid a style depending on its value.
>For example:
>Aveamos1= {"V1","V2",V3", "V4"}
>veamos2={5,20,7,11}
>Grid[{veamos1,veamos2}]
>Suppose that I want any value above 10 to be coloured in red. How can I manage to do this?
>Thanks
>Francisco
>



  • Prev by Date: Re: What is f[1]? Advanced question
  • Next by Date: Re: Making (a*\[Theta]11)/(1+a^2) into (a/(1+a^2))*\[Theta]11
  • Previous by thread: Re: automatic grid
  • Next by thread: Re: automatic grid