Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- can we color the cells in jmp table as we do in excel? I mean really give colors...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Apr 29, 2014 7:11 AM
(13537 views)

can we color the cells in jmp table as we do in excel? I mean really give colors to the part of table/cells interested?

I tried below jsl but it only works when you plot the data in graphs but not in the table itself?

Thanks in advance!

Evan

dt=Data Table( "Bin Wafer Map" );

For(i=4, i<=N col(dt),i++,

dt:i << Set Property(

"Value Colors",

{1=Green,3 = Red, 4 = Yellow,5=orange, 6 = Magenta, 7 =Blue,8 = Cyan,9=BlueCyan}

));

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

In JMP 9 and beyond try right clicking on a cell in a data table and you'll get a menu that will let you color the cell.

In JSL you can use the Color Cell() message:

dt = Open

("$SAMPLE_DATA/Big Class.jmp");column

(dt, “Age”)<<Color Cells({5,{15}});

or the Color Cell by Value() message:

dt = Open

("$SAMPLE_DATA/Big Class.jmp");:Age <<

Set Property

("Value Colors",

{12= -13977430,13= -3780930,14= -

4157407,15= -13596965,16= -2210961,17= -

10562523}

);Wait

(1);:Age <<

Color Cell by Value(1);

-Jeff

-Jeff

12 REPLIES 12

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

In JMP 9 and beyond try right clicking on a cell in a data table and you'll get a menu that will let you color the cell.

In JSL you can use the Color Cell() message:

dt = Open

("$SAMPLE_DATA/Big Class.jmp");column

(dt, “Age”)<<Color Cells({5,{15}});

or the Color Cell by Value() message:

dt = Open

("$SAMPLE_DATA/Big Class.jmp");:Age <<

Set Property

("Value Colors",

{12= -13977430,13= -3780930,14= -

4157407,15= -13596965,16= -2210961,17= -

10562523}

);Wait

(1);:Age <<

Color Cell by Value(1);

-Jeff

-Jeff

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

You can apply a value gradient using JSL in the following manner. Note that to use dynamically calculated values of min, max and average I had to build a string and execute it with eval(parse()).

dt = Open**(** "$SAMPLE_DATA/Big Class.jmp" **)**;

dtcol = column**(**dt, "weight"**)**;

one_min = col min**(**dtcol**)**;

one_max = col max**(**dtcol**)**;

one_avg = col mean**(**dtcol**)**;

gradient_expr = evalinsert**(**"\[

dtcol << Set Property( "Color Gradient",

{"Jet", Range(^one_min^, ^one_max^, ^one_avg^)});

dtcol << color cell by value(1);

]\"**)**;

eval**(**parse**(**gradient_expr**))**;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: can we color the cells in jmp table as we do in excel? I mean really give colors to the part of

Hi is there a way to color selected cells? I have a hew hundred cells that are selected and I would like to give a color to stand out.

Thanks

Sam

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: can we color the cells in jmp table as we do in excel? I mean really give colors to the part of

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

thanks Jeff and PMroz.

I got the hint and was able to get my wafer map colored by Bin(value). I did not know the color by cell value is off by default. Have not figure out how to tell jmp do nothing if the cell value is empty.

=Data Table**(** "Bin Wafer Map" **)**;

For**(**i=**4**, i<=N col**(**dt**)**,i++,

:i << **Set Property(**

"Value Colors",

**1**=Green,**3** = Red, **4** = Yellow,**5**=orange, **6** = Magenta, **7** =Blue

,**8** = Cyan,**9**=BlueCyan,**.**=white**}**

<<**color cell by value****(1))**;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

finally I got it to color only non-empty cells with desired colors. but there is still an error though the script is executable.

=Data Table**(** "Bin Wafer Map" **)**;

**(**i=**4**, i<=N col**(**dt**)**,i++,

**(**j=**1**, j<=N Row**(**dt**)**,j++,

if**(**dt:i**[**j**]**==**1**,dt:i << **Color Cells(**Green,**{**j**})**,

if**(**dt:i**[**j**]**==**3**,dt:i << **Color Cells(**Red,**{**j**})**,

if**(**dt:i**[**j**]**==**4**,dt:i << **Color Cells(**Yellow,**{**j**})**,

if**(**dt:i**[**j**]**==**5**,dt:i << **Color Cells(**Orange,**{**j**})**,

if**(**dt:i**[**j**]**==**6**,dt:i << **Color Cells(**Magenta,**{**j**})**,

if**(**dt:i**[**j**]**==**7**,dt:i << **Color Cells(**Blue,**{**j**})**,

if**(**dt:i**[**j**]**==**8**,dt:i << **Color Cells(**Cyan,**{**j**})**,

if**(**dt:i**[**j**]**==**9**,dt:i << **Color Cells(**BlueCyan,**{**j**})**,

))))));

**(**i=**4**, i<=N col**(**dt**)**,i++,

**(**j=**1**, j<=N Row**(**dt**)**,j++,

**(**!zero or missing**(**dt:i**[**j**])**,dt:i**[**j**]**<<**color cell by value****(1)**,

)));

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

This code is a bit simpler. Note that I'm using k for a looping variable instead of **j**; **j** is a function in JSL.

color_list = **{**"Green", "Red", "Yellow", "Purple", "Orange", "Magenta", "Blue", "Cyan", "BlueCyan"**}**;

dt = Data Table**(** "Bin Wafer Map" **)**;

For**(** i = **4**, i <= N Col**(** dt **)**, i++,

For**(** k = **1**, k <= N Row**(** dt **)**, k++,

one_value = dt:i**[**k**]**;

if **(**! is missing**(**one_value**)**,

dt:i << color cells**(**color_list**[**one_value**]**, **{**k**})**;

dt:i << color cell by value**(** **1** **)**;

** )**;

** )**;

**)**;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

thanks, P!

your script is much simpler but it is not able to exclude the empty cells(showing X)

my script trying to send color cell by value to a cell, which works but giving below error. Do you know what the error tells us and how to debug it?

PS: I tried use below script to add a empty row btw each wafer but it might calls a infinite loop:(, never worked.

For(a=0, a<(N Row(dt))/11,a++,

dt<<add rows(1,(a+(a+1)*11));

);

Thanks a gain.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

My code excludes the empty cells with the ! is missing() check. I only get the X's for empty cells when I use a Value Gradient.

Your code is failing because that method expects a column, not a cell. Again I strongly recommend that you change j to k or something because j is a function in JSL.

I realized that the color cell by value method only needs to be called once per column, so I took it out of the k loop.

color_list = **{**"Green", "Red", "Yellow", "Purple", "Orange", "Magenta", "Blue", "Cyan", "BlueCyan"**}**;

dt = Data Table**(** "Bin Wafer Map" **)**;

For**(** i = **4**, i <= N Col**(** dt **)**, i++,

dt:i << color cell by value**(** **1** **)**;

For**(** k =**1**, k <=N Row**(** dt **)**, k++,

one_value = dt:i**[**k**]**;

if **(**! is missing**(**one_value**)**,

dt:i << color cells**(**color_list**[**one_value**]**, **{**k**})**;

** )**;

** )**;

**)**;