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
- :
- Color gradient based on absolute value?

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

Jul 17, 2014 7:35 AM
(6715 views)

Hi,

I am trying to color a column based on the sigma distance from target instead of from lowest to highest.

For example, I want a color gradient from the smallest value to the largest value so from 0.07 to 0.64 (with -0.54 having the same color as +0.54). I do want to keep the negative signs so that I know which side of the target it is on.

Here is some example data:

0.07

-0.24

-0.54

-0.26

-0.64

0.09

0.30

0.03

-0.15

0.54

Is this possible to do in a JMP script? Any ideas?

Thanks!

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

I've attached a small example script that colors "height" column cells in BigClass.jmp according to a distance from a target value.

Here's a sampling of the result using a target of 60.

Notice that 59 and 61 have the same color because they're both 1 away from the target.

I hope you will be able to adapt the script to your data table.

3 REPLIES 3

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

Re: Color gradient based on absolute value?

Two possibilities:

- Create a new column which is the absolute value of the first and use that for color, but still use the first column for labeling.
- Create a custom color gradient that's symmetric. For instance, black to white to black with a centered value scale. If you really need 0.07 to be the minimum, you can create a constant color zone in the middle. That is black-to-white-to-white-to-black.

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

I've attached a small example script that colors "height" column cells in BigClass.jmp according to a distance from a target value.

Here's a sampling of the result using a target of 60.

Notice that 59 and 61 have the same color because they're both 1 away from the target.

I hope you will be able to adapt the script to your data table.

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

Re: Color gradient based on absolute value?

Thank you so much! I had tried the second option but it didn't seem to work unless the range was equal on both sides.

John, your script worked great. I really appreciate it. Thanks!