cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
yetebreo
Level I

How to change row legend colors using JSL

Hi I am currently working on a script but I am stuck with one requirement that is to put specific colors for a specific row legend.

For example I have:

LEGENDNAME_OO

LEGENDNAME_PP

LEGENDNAME_QQ


I want to color legend with _OO suffix with red _PP with blue and _QQ with green

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
uday_guntupalli
Level VIII

Re: How to change row legend colors using JSL

Hello ,

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt << Color by Column( :Age );

Wait( 2 );

dt << Color Rows by Row State;

I think you can further customize this  to match your needs

Best

uday

Best
Uday

View solution in original post

6 REPLIES 6

Re: How to change row legend colors using JSL

Hi,

It's depend of graph you are using.

For Overlay Plot, you can add Connect Color option to define colors options.

Overlay Plot(

  Y( :AA, :BB, :CC ),

  Connect Thru Missing( 1 ),

  :AA(

  Connect Color( 38 ),

  Line Width( "Thin" )

  ),

  :BB(

  Connect Color( 54 ),

  Line Width( "Thin" )

  ),

  :CC( Connect Color( 71 ),

      Line Width( "Thin" ) ));

Guillaume
uday_guntupalli
Level VIII

Re: How to change row legend colors using JSL

Hello ,

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt << Color by Column( :Age );

Wait( 2 );

dt << Color Rows by Row State;

I think you can further customize this  to match your needs

Best

uday

Best
Uday
yetebreo
Level I

Re: How to change row legend colors using JSL

Here is the code I am using

//!

open("C:\Users\krash_tpd_cnt_char.csv");

Bivariate(

    Y(  :VALUE ),

    X(  :TEMP  ),

    By(  :VCC  ),

    SendToReport(

        Dispatch({},"1",ScaleBox,{

            ,Show Major Grid( 1 )

        }),

        Dispatch({},"2",ScaleBox,{

            ,Show Major Grid( 1 )

        }),

        Dispatch( {}, "Bivar Plot", FrameBox,

            {Row Legend(

                WAFER ,

                Color( 1 ),

                Color Theme( "JMP Default" )

            )}

        )

    )

);

this is what is being generated

12412_pastedImage_18.png

but i want *-TT to be green, FF to be red then SS as is (blue)

Re: How to change row legend colors using JSL

Try changing the value ordering in the source column so that FF is first and -TT is second. I realize this is not a JSL solution, but it may get you where you want to be.

yetebreo
Level I

Re: How to change row legend colors using JSL

I am not sure how to change the ordering since these names could be anything only that it ends with TT FF and SS.

I hop somebody can help

Re: How to change row legend colors using JSL

Hello,

You can do a script similar to this one to order value.

This script is not "perfect" but seems to be okay

dt = CurrentDataTable();

col = Column("VCC");

list = {};

ulist = {};

listTT = {};

listSS = {};

listFF = {};

/* Add data from VCC into a list */

For (i=1, i<=Nrows(dt),i++,

     InsertInto (list,col)

);

/* Create a unique list */

For (i=1,i<=Nitems(list),i++,

  If (Nrows(Loc(ulist,list)) == 0,

  InsertInto (ulist,list)

  );

);

/* Create 3 lists contains pattern */

For (i=1,i<=Nitems(ulist),i++,

    if (contains(ulist,"TT") > 0,

    InsertInto (listTT,ulist)

    );

    if (contains(ulist,"SS") > 0,

    InsertInto (listSS,ulist)

    );

    if (contains(ulist,"FF") > 0,

    InsertInto (listFF,ulist)

    );

);

/* Create the final list to have color order*/

list = {};

InsertInto(list,listFF);

InsertInto(list,listTT);

InsertInto(list,listSS);

/* Put Value ordering property */

col << Set Property("Value Ordering",list);

/* Then make your analysis */

Guillaume