Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2013

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

Search the Archive

Re: automatic grid

  • To: mathgroup at smc.vnet.net
  • Subject: [mg131316] Re: automatic grid
  • From: Francisco Gutierrez <fgutiers2002 at yahoo.com>
  • Date: Thu, 27 Jun 2013 06:32:55 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <20130622073308.6B8D46A0A@smc.vnet.net> <CAEtRDSfhKPEcva-cpbe9UZH-hLHQ4e+nnit8nAh4hYmLGSXiAQ@mail.gmail.com>
  • Reply-to: Francisco Gutierrez <fgutiers2002 at yahoo.com>

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
>



  • 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