Subscribe Bookmark RSS Feed

Saving data table to journal with reverse gradient colored cells

xm

Community Trekker

Joined:

Apr 25, 2014

Here's a (deceptively) simple set of scripting problems that's been plaguing me for the last couple of days, and I hope, before I throw up my hands and retire prematurely, that someone here can help; the discussion forums have yielded no answers.

I have a data table with a column of percentages to which I'd like to apply a gradient (0% Red --> 50% Yellow --> 100% Green) and then save to a journal, color formatting included. Attached is a small example of what such a table might look like.

Problem #1

I can apply a gradient just fine with:


col << Set Property ( "Color Gradient", {"Green Yellow Red", Range ( {0, 1, 0.5} ) } );

col << Color Cell by Value (1);

However, the default gradient colors are in the wrong order, and I can't figure out how to reverse them. I've tried every combination of "Reverse Scale", "Reverse Color", and, in a fit of despair, just plain old "Reverse" in various places in the script, to no avail. I even tried to use Value Colors, unsuccessfully. Is there any way to apply this specific gradient without having to resort to coding formulas for RGB values?

Problem #2

Assuming problem #1 is resolved, I'd like to copy the data table with its fine, fancy formatting into a journal.


dt << Journal;

Easy, right? Oh JMP... if only you could be so straightforward. All that hard-earned color formatting gets stripped the standard journaling way, so how do I keep the format? Could I save the data table as an image? A user named Erik asked the same question and received no response.

Please help to keep my early retirement at bay. Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

I can answer your first question.  Using your dataset, click on the little red triangle and select Copy Table Script.  This yielded the following code:

:Percentage << Set Property ( "Color Gradient",{{"Green Yellow Red Copy", 16387, {{252, 11, 11}, "Yellow", "Green"}},

                Range( {0, 1, 0.5} )} );

:Percentage << Color Cell by Value (1);

6 REPLIES
Solution

I can answer your first question.  Using your dataset, click on the little red triangle and select Copy Table Script.  This yielded the following code:

:Percentage << Set Property ( "Color Gradient",{{"Green Yellow Red Copy", 16387, {{252, 11, 11}, "Yellow", "Green"}},

                Range( {0, 1, 0.5} )} );

:Percentage << Color Cell by Value (1);

xm

Community Trekker

Joined:

Apr 25, 2014

Well color me (ha!) sheepish and grateful. It didn't occur to me that the table script would also have column formatting changes. Thank you so much!

pmroz

Super User

Joined:

Jun 23, 2011

I can answer your second question too.  JMP 10 doesn't support showing the cell colors in the journal, but JMP 11 does.  Upgrade!

7040_Colors in Journal.png

xm

Community Trekker

Joined:

Apr 25, 2014

I am already running JMP 11, so straight up journaling didn't work, but I am updating the software right now, given your advice. I'll post results as soon as I try <<Journal with the updates!

pmroz

Super User

Joined:

Jun 23, 2011

I'm running JMP 11.2.

xm

Community Trekker

Joined:

Apr 25, 2014

All right! Finally got the JMP11 update installed, and that solved the journal coloring problem. You have been a lifesaver. Thanks again!