RBG Color in Graph BuilderI want to use a column in a Graph Builder plot to set the color in a heatmap—not with a color scale, but with an RGB value I previously extracted from an image.
Is there a possibility to store a RGB color in a column - and then use it in Graph Builder?
Data Exploration and VisualizationRe: RBG Color in Graph Builderif this is not possible, some workarounds :
- use value color,
a) use value = row() - and use value color to map the rows to color
b) save "color" with an encoding - and use value color to map the encoded color to the actual color
- is it possible to use the color from row state for a Heatmap Plot?
Re: RBG Color in Graph BuilderYou can store the value as row state using Color State() and RGB Color(), but no idea about using that column directly in graph builder.
Re: RBG Color in Graph BuilderHi @hogi,
I have used a previous solution from @txnelson that enable me to use HEX values from one column and get automatically row colors based on these values :
Return a JMP Color Value from a Hex Color Code
For RGB values, there seems to be some solutions existing:
using RGB values in JSL scripts instead of color name or whatever this (--16741343) is
Extracting colors from a #rrggbb column
Hope these answers may help you,
Re: RBG Color in Graph BuilderHi @Victor_G , thank you for the input.
HexColor is a nice option for:

the hard nut I still have to crack is how I can use this in Graph Builder / Heatmaps.
I'm leaning towards: save {r, g,b } *255 as an expression - and using a table script to manually transfer the values to Value Colors .
another workaround: use JSL & shape equation.
but Heatmaps has its benefits ...
Re: RBG Color in Graph BuilderHere's the script from the Image to Table extension to use an RGB value in Graph Builder. Since it uses JMP's built-in functions, it's fairly fast.
(dt << New Column( "Pixel Color", formula( Color State( RGB Color( :R, :G, :B ) ) ) )) << copy to row states;
Re: RBG Color in Graph BuilderHi Jed Campbell , thank you for the code.
The hard nut I still have to crack is how I can use this in Graph Builder / Heatmaps.
Any better solution than the workaround via Value Colors?
Re: RBG Color in Graph Builderpossible application case: show me my life
from: https://www.youtube.com/watch?v=arj7oStGLkU
empty plot:

Re: RBG Color in Graph Builder@hogi I should have read the entire question, thanks!
For heatmaps, what about using the HLS color space instead of RGB? Since Hue kind of combines/codes for RGB data, you could use the Hue value in the Color role of a heat map, and a chromatic color scale. Color to HLS () in JSL would do the RGB to HLS conversion for you.
Re: RBG Color in Graph BuilderHue - a great idea to get very saturated colors!
In the new version, I apply a preselection based on L and S - and pick THE color by the dominant hue (mode()) .
This makes images with a lot of blue sky clearly visible as blue cells - like our trip to Greece in May 2024.
To get a nice contrast, days with missing image are grey ...
