MathGroup Archive 2013

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

Search the Archive

Re: automatic grid

  • To: mathgroup at
  • Subject: [mg131316] Re: automatic grid
  • From: Francisco Gutierrez <fgutiers2002 at>
  • Date: Thu, 27 Jun 2013 06:32:55 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • References: <> <>
  • Reply-to: Francisco Gutierrez <fgutiers2002 at>

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


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

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

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

Grid[{Aveamos1, color /@ veamos2}]

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> 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"}
>Suppose that I want any value above 10 to be coloured in red. How can I manage to do this?

  • References:
  • 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