cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar

Color Coding Variability Charts through Script

Hello Guys,

I have a simple problem with variability chart which I am not able to script properly.

I want to do a color coding for my variablility charts as per required conditions. For example, I will I want all the rows with 12-Nov-2015 to come in red color and rest in black color. I want to use similar conditions to color code my data for better representation.

I am using this simple code ...

dt = Open("Test.jmp");

dt<< Get Rows Where(:Day == informat ("2015/11/12")) << colors (1);

This is obviously not working. Can you guide me through it ?

I am thinking of changing the color state of the rows and then I believe when I plot the variability chart they will automatically come in different colors, right ?

3 REPLIES 3
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Color Coding Variability Charts through Script

Yes, thats right. Row colors would show up in the variability plot.

Your code is close to do what you want. Get Rows Where() returns a matrix but <<Colors expects a data table.

Try this instead:

dt << Select Where(:Day == Informat("2015/11/12")) << Colors("Red");

Re: Color Coding Variability Charts through Script

Thanks MS. It was a useful information.

A quick follow up question, every time I save the datatable and reopen, this color information is lost? Can you suggest how this color information can be retained till I deliberately delete it, even after my closing and opening the datatable multiple times?

Thanks in advance..

ms
Super User (Alumni) ms
Super User (Alumni)

Re: Color Coding Variability Charts through Script

That is odd. Rowstates incl. colors are normally saved with the data table (assuming you save as .jmp, not export as .xls, .csv etc.).

Make sure the table doesn't have an "OnOpen" table script that wipes the saved row states.