The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: automatic grid
Replies: 4   Last Post: Jun 27, 2013 6:24 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Francisco Gutierrez

Posts: 102
Registered: 5/31/05
Re: automatic grid
Posted: Jun 27, 2013 6:24 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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


From: Bob Hanlon <>
To: Francisco Gutierrez <>
Cc: MathGroup <>
Sent: Saturday, June 22, 2013 8:31 AM
Subject: 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 <> 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?

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.