Subscribe Bookmark
XanGregg

Staff

Joined:

Jun 23, 2011

Custom Row State Colors

Though JMP 6 and earlier support full RGB color in most graphics, row state colors used for data marks have been limited to the colors in JMP's general-purpose 65-color palette. With JMP 7, that limitation has been lifted.

How do you set row states to colors that are not in the palette? Interactively, you can select "Custom" from the bottom of the color menu which will bring up a color picker to let you choose any RGB color. That color will be applied to the currently selected rows, as usual.


In JSL, you can set row state values with computed RGB colors allowing you to use any color them you want. For example, for the script below assigns a shade of blue based on the value in the Age column. (The 0.7 and 0.8 are scale factors to avoid extremely washed out or saturated blues.)



For Each Row(

v = (:Age - Col Min( :Age )) * 0.7

/ (Col Max( :Age ) - Col Min( :Age ));

Row State() = Combine States( Color State( {0.8-v, 0.8-v, 1} ),

Marker State( 12 ) );

);



And here is a scatterplot of Height by Weight for Big Class.jmp.






1 Comment
Community Member

Colors in JSL - JMP Blog wrote:

[...] addition to more color options in the user interface, JMP 7 also adds more robust color control in JSL. JMP's encoding of palette [...]

Article Tags