cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
ENTHU
Level IV

Color Cells based on formula result and display using tabulate.

I am using tabulate command to display data from a table along with a graph.I have colored the cells in the data table based on a condition.

Lets say if temperature < 5 color = red, 10<temperature<20 color = blue etc.

I am then using tabulate function to create table from this.But the cell color doesnt seem to show up in the final output table.

7 REPLIES 7
txnelson
Super User

Re: Color Cells based on formula result and display using tabulate.

The Tabulate Platform does not support cell color.  The displayed output from Tabulate is not a data table.  However, you can have the platform generate a data table from the displayed output, and then you can color those cells.  Look under the red triangle for the "Make into data table" option.

Jim
ENTHU
Level IV

Re: Color Cells based on formula result and display using tabulate.

Thanks!

gzmorgan0
Super User (Alumni)

Re: Color Cells based on formula result and display using tabulate.

Just a quick note on several alternatives:

  • Use Table Summary and color rows
  • From the Tabulate menu, select Make Into Data Table and color that display
  • Write a script to make a custom display table. 
  • If possible, create a graph to represent the table. If it is complex, this is likely not feasible. Below is a simple example. The Graph Builder label is Percent of Total. Note that the bar colors are custom: 12-13 Blue, 14-16 Green, 17+ Red.
  • image.pngimage.png
ENTHU
Level IV

Re: Color Cells based on formula result and display using tabulate.

This is helpful but I have a 20x20 data table.I have to loop through each cell, check the value and color it accordingly.

Eg : I have age1 - age10 columns.I need to color all cells withe age <20 as blue.

How can I do this?

gzmorgan0
Super User (Alumni)

Re: Color Cells based on formula result and display using tabulate.

You did not mention which version of JMP that you are using.

 

You should look up in the Scripting Index, Color Cells.  You can find it by typing "cell" as the search string for the objects messages.  This is a column message. The first argument is the color, the second argument is the row list or ro reference. If no rows are specified then all rows in that column are colored. This is copied from Example 3.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
a = {1, 3, 5};
b = {2, 4, 6};
:height << color cells( {{"Red", a}, {"blue", b}} );

Here is another example, using a For loop, that selects columns based upon their names an row condition.  I like to use custom colors, lighter colors so the numbers are readable.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Blood Pressure.jmp" );
nme = dt << get column names( String );
_xx = dt << get rows where( :Dose == "Control" );
For( i = 3, i <= N Items( nme ), i++,
If( Contains( nme[i], "8" ),
Column( dt, i ) << color cells( RGB Color( 122, 235, 235 ), _xx )
) //end if
); //end for

 

ENTHU
Level IV

Re: Color Cells based on formula result and display using tabulate.

With inputs from all you guys I am able to make a data table from tabulate and color cells based on formula result.

I now need to display this table along with the graph.(I was doing this with tabulate earlier)

 

Is there an easy way to do this? Sorry new to jmp and have lot of questions.

gzmorgan0
Super User (Alumni)

Re: Color Cells based on formula result and display using tabulate.

You can do this with combine windows.  On the bottom right of your table view border check the box. Do the same for your graph. On the graph select the Menu icon and select Combine Windows.  See screenshot below. A pop-up menu will appear, give it a name and the window has both table and graph.

image.png