<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Issues with reproducing custom row legend settings in JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Issues-with-reproducing-custom-row-legend-settings-in-JSL/m-p/393255#M64361</link>
    <description>&lt;P&gt;You can create a customized legend from graph boxes inside of a col box inside of a table box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, here I create a table holding the fail codes and the row-states to use for each one (you would probably want to set this in a global namespace for re-use in your code, and make the table private so it doesn't show).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next I create two example data tables, one of which has only half of the fail codes defined.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next I create two functions -- one does a smart sort so that consecutive legend entries are consecutive (i.e., so that "FailCode_1, FailCode_10, FailCode_2" gets sorted properly).&amp;nbsp; The second function plots the bivariates and adds a custom legend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you run this, notice how the colors and markers for each plot are the same for the same FailCode.&amp;nbsp; You would probably want to set the colors and markers for your code, this is simply an example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

colors = {
	//{r,g,b}
	{1,0.5,0},
	{1,0,1},
	{0,1,1},
	{1,0,0},
	{0,1,0},
	{0,0,1},
	{0.7, 0.5, 0.3},
	{0.3, 0.5, 0.7},
	{0.5, 0.3, 0.7},
	{0.5, 0.7, 0.3},
	{0.7, 0.5, 0.7},
	{0.5, 0.7, 0.5},
	{0.3, 0.7, 0.7},
	{0.9, 0.1, 0.2},
	{0.3, 0.5, 0.6},
	{0.1, 0.3, 0.9},
	{0.5, 0.2, 0.0},
	{0.0, 0.7, 0.3},
	{0.4, 0.1, 0.2},
	{0.8, 0.5, 0.2},
	{0.2, 0.8, 0.5}
};

names = {
	"FailCode_0",
	"FailCode_1",
	"FailCode_2",
	"FailCode_3",
	"FailCode_4",
	"FailCode_5",
	"FailCode_6",
	"FailCode_7",
	"FailCode_8",
	"FailCode_9",
	"FailCode_10",
	"FailCode_11",
	"FailCode_12",
	"FailCode_13",
	"FailCode_14",
	"FailCode_15",
	"FailCode_16",
	"FailCode_17",
	"FailCode_18",
	"FailCode_19",
	"FailCode_20"
};

Eval( Eval Expr(
color table = New Table("Colors",
	&amp;lt;&amp;lt;New Column( "FailCode", "Character", &amp;lt;&amp;lt;Set Values( names ) ), 
	&amp;lt;&amp;lt;New Column( "States", "Row State", &amp;lt;&amp;lt;Set Each Value( Combine States( colors = Expr( colors ); Color State( colors[Row()] ), Marker State( Row() ) ) ) )
)
) );
color table:States &amp;lt;&amp;lt; Copy to Row States();

table 1 = New Table( "DataExample1",
	&amp;lt;&amp;lt;New Column( "rows", "Numeric", &amp;lt;&amp;lt;Set Values( 1::1000 ) ),
	&amp;lt;&amp;lt;New Column( "Wafer", "Character", &amp;lt;&amp;lt;Set Each Value( "WAFER_" || Char( Random Integer( 1, 4 ) ) ) ),
	&amp;lt;&amp;lt;New Column( "FailCode", "Character", &amp;lt;&amp;lt;Set Each Value( "FailCode_" || Char( 2 * Random Integer( 1, 10 ) ) ) ),
	&amp;lt;&amp;lt;New Column( "Time", "Numeric", &amp;lt;&amp;lt;Set Each Value( Today() + Random Integer( 1, 1000 ) * 60 ), &amp;lt;&amp;lt; Format( "y/m/d h:m:s", 22, 0 ) ),
	&amp;lt;&amp;lt;New Column( "Data", "Numeric", &amp;lt;&amp;lt;Set Each Value( Random Exp() ) )
);

table 2 = New Table( "DataExample1",
	&amp;lt;&amp;lt;New Column( "rows", "Numeric", &amp;lt;&amp;lt;Set Values( 1::5000 ) ),
	&amp;lt;&amp;lt;New Column( "Wafer", "Character", &amp;lt;&amp;lt;Set Each Value( "WAFER_" || Char( Random Integer( 1, 4 ) ) ) ),
	&amp;lt;&amp;lt;New Column( "FailCode", "Character", &amp;lt;&amp;lt;Set Each Value( "FailCode_" || Char( Random Integer( 1, 20 ) ) ) ),
	&amp;lt;&amp;lt;New Column( "Time", "Numeric", &amp;lt;&amp;lt;Set Each Value( Today() + Random Integer( 1, 1000 ) * 60 ), &amp;lt;&amp;lt; Format( "y/m/d h:m:s", 22, 0 ) ),
	&amp;lt;&amp;lt;New Column( "Data", "Numeric", &amp;lt;&amp;lt;Set Each Value( Random Exp() ) )
);
&lt;BR /&gt;//Here is where we set the row-states for the tables to plot.  We don't want the bivariate function setting the row states.
table 1 &amp;lt;&amp;lt; Update( With( color table ),
	Match Columns( :FailCode = :FailCode ),
	Add Columns From Update Table( :States )
);
table 1:States &amp;lt;&amp;lt; Copy to Row States();
table 1 &amp;lt;&amp;lt; Delete Columns( "States" );
&lt;BR /&gt;//again for the second table
table 2 &amp;lt;&amp;lt; Update( With( color table ),
	Match Columns( :FailCode = :FailCode ),
	Add Columns From Update Table( :States )
);
table 2:States &amp;lt;&amp;lt; Copy to Row States();
table 2 &amp;lt;&amp;lt; Delete Columns( "States" );

smart sort = Function( {list, return sort index = 0},
	{args, function name, doc string, sorted list, i, j, var, val, ret},
	sorted list = {};
	For( i = 1, i &amp;lt;= N Items( list ), i++,
		j = 0;
		var = "";
		While( Not( Is Missing( val = Num( Substr( list[i], Length( list[i] ) - j ) ) ) ) &amp;amp; j &amp;lt; Length( list[i] ),
			var = val;
			j++;
		);
		sorted list[i] = Eval List( {Substr( list[i], 1, Length( list[i] ) - j ), var, i, j} );
	);
	sorted list = Sort List( sorted list );
	If( return sort index == 0,
		For( i = 1, i &amp;lt;= N Items( list ), i++,
			list[i] = sorted list[i][1] || Right( Char( sorted list[i][2] ), sorted list[i][4], "0" )
		);
	,
		For( i = 1, i &amp;lt;= N Items( sorted list ), i++,
			If( sorted list[i][1] == "BASELINE",
				list[sorted list[i][3]] = 0
			,
				list[sorted list[i][3]] = i
			)
		);
	);
	list
);

make bivariate = Function( {table, xcol, ycol, categorical, legend},
	{Default Local},
	legend items = Smart Sort( Associative Array( Column( table, legend ) ) &amp;lt;&amp;lt; Get Keys );
	n items = N Items( legend items );
	legend marker box = Col Box( "" );
	names = {};
	For( i = 1, i &amp;lt;= n items, i++,
		Eval( Eval Expr(
		loc = color table &amp;lt;&amp;lt; Get Rows Where( :FailCode == Expr( legend items[i] ) )
		) );
		// here is a little fun magic to create a legend column out of graph boxes
		ob = Outline Box( "",
			gb = Graph Box(
				Frame Size( 14, 14 ),
				Y Scale( 0, 1 ),
				X Scale( 0, 1 ),
				SuppressAxes,
				Marker Seg( [0.5], [0.5], Row States( color table, Matrix( loc ) ) )
			)
		);
		//make sure that all the padding and borders look right
		gb[Frame Box( 1 )] &amp;lt;&amp;lt; Padding( Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 ) ) &amp;lt;&amp;lt; Border( Top, 0 ) &amp;lt;&amp;lt; Border( Bottom, 0 ) &amp;lt;&amp;lt; Border( Left, 0 ) &amp;lt;&amp;lt; Border( Right, 0 ) &amp;lt;&amp;lt; Marker Size( 3 ) &amp;lt;&amp;lt; SetBackgroundFill( 0 );
		gb[Border Box( 1 )] &amp;lt;&amp;lt; Left( 0 ) &amp;lt;&amp;lt; Top( 0 ) &amp;lt;&amp;lt; Right( 0 ) &amp;lt;&amp;lt; Bottom( 0 ) &amp;lt;&amp;lt; Sides( 0 );
		legend marker box &amp;lt;&amp;lt; Append( ob );
		Insert Into( names, legend items[i] );
	);
	legend name box = String Col Box( "FailCode", names );
	Eval( Eval Expr(
	hlb = H List Box(
		Platform( table, //need to encapsulate the bivariate in a platform to ensure it uses the correct table
			biv = Bivariate(
				Y( Column( table, ycol ) ),
				X( Column( table, xcol ) ),
				By(Column( table, categorical ))
			);
		)
	,
		legend box = Table Box(
			legend marker box
		,
			legend name box
		)
	);
	) );
	Try( hlb[List Box( 2 )] &amp;lt;&amp;lt; Set Horizontal( 1 ) );
	legend box &amp;lt;&amp;lt; Set Selectable Rows( 1 ) &amp;lt;&amp;lt; Set Shade Alternate Rows( 0 ) &amp;lt;&amp;lt; Set Shade Cells( 0 ) &amp;lt;&amp;lt; Set Shade Headings( 0 ) &amp;lt;&amp;lt; Set Column Borders( 0 ) &amp;lt;&amp;lt; Set Row Borders( 0 ) &amp;lt;&amp;lt; Set Underline Headings( 0 );
	If( Num( Trim( Word( 1, JMP Version(), "." ) ) ) &amp;gt; 12,
		legend box &amp;lt;&amp;lt; Set Column Group Borders( 0 ) &amp;lt;&amp;lt; Set Heading Column Borders( 0 );
	);
	
	//Lastly we need to set the row change function so that clicking the legend does normal legend things.
	Eval( Eval Expr(
	legend box &amp;lt;&amp;lt; Set Row Change Function(
		Function( {this},
			table = Expr( table );
			items = Expr( legend items );
			rows = this &amp;lt;&amp;lt; Get Selected Rows();
			legend column = Expr( legend );
			If( N Rows( rows ) == 0,
				table &amp;lt;&amp;lt; Clear Select;
				Return( 0 );
			);
			vals = Insert( {}, items[rows] );
			Eval( Parse( Eval Insert( "\[
			table &amp;lt;&amp;lt; Select Where( Contains( ^vals^, :Name("^legend column^") ) )
			]\" ) ) )
		)
	)
	) );
	hlb
);

Eval( Eval Expr(
New Window( "test",
	&amp;lt;&amp;lt;On Close(
		color table = Expr( color table );
		table 1 = Expr( table 1 );
		table 2 = Expr( table 2 );
		Try( Close( table 1, No Save ) );
		Try( Close( table 2, No Save ) );
		Try( Close( color table, No Save ) );
	)
,
	V List Box(
		Outline Box( "",
			make bivariate( table 1, "time", "data", "Wafer", "FailCode" )
		)
	,
		Outline Box( "",
			make bivariate( table 2, "time", "data", "Wafer", "FailCode" )
		)
	)
)
) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 15 Jun 2021 01:57:47 GMT</pubDate>
    <dc:creator>ErraticAttack</dc:creator>
    <dc:date>2021-06-15T01:57:47Z</dc:date>
    <item>
      <title>Issues with reproducing custom row legend settings in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Issues-with-reproducing-custom-row-legend-settings-in-JSL/m-p/393162#M64356</link>
      <description>&lt;P&gt;I am trying to create this bivariate plot for each wafer I have in a string. It looks good except I would like to update the row legend with custom colors and markers since there are many different color options in FailCode to distinguish by. I cannot use the general color themes. Is there a way to &lt;STRONG&gt;create custom legend specifications that will be the same for each plot created all in JSL?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*I was trying to think of a way to update the script after making these changes and copying to my script. However, haven't had any luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Bivariate(
	Y( :YLoc ),
	X( :XLoc ),
	By(:Wafer),
	SendToReport(
		Dispatch(
			{},
			"Bivar Plot",
			FrameBox,
			{Marker Size( 6 ), Row Legend(
				FailCode,
				Color( 1 ),
				Color Theme( "Strong and Pastel Mix" ),
				Marker( 0 ),
				Marker Theme( "" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:15:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Issues-with-reproducing-custom-row-legend-settings-in-JSL/m-p/393162#M64356</guid>
      <dc:creator>saneal</dc:creator>
      <dc:date>2023-06-11T11:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with reproducing custom row legend settings in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Issues-with-reproducing-custom-row-legend-settings-in-JSL/m-p/393255#M64361</link>
      <description>&lt;P&gt;You can create a customized legend from graph boxes inside of a col box inside of a table box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, here I create a table holding the fail codes and the row-states to use for each one (you would probably want to set this in a global namespace for re-use in your code, and make the table private so it doesn't show).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next I create two example data tables, one of which has only half of the fail codes defined.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next I create two functions -- one does a smart sort so that consecutive legend entries are consecutive (i.e., so that "FailCode_1, FailCode_10, FailCode_2" gets sorted properly).&amp;nbsp; The second function plots the bivariates and adds a custom legend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you run this, notice how the colors and markers for each plot are the same for the same FailCode.&amp;nbsp; You would probably want to set the colors and markers for your code, this is simply an example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

colors = {
	//{r,g,b}
	{1,0.5,0},
	{1,0,1},
	{0,1,1},
	{1,0,0},
	{0,1,0},
	{0,0,1},
	{0.7, 0.5, 0.3},
	{0.3, 0.5, 0.7},
	{0.5, 0.3, 0.7},
	{0.5, 0.7, 0.3},
	{0.7, 0.5, 0.7},
	{0.5, 0.7, 0.5},
	{0.3, 0.7, 0.7},
	{0.9, 0.1, 0.2},
	{0.3, 0.5, 0.6},
	{0.1, 0.3, 0.9},
	{0.5, 0.2, 0.0},
	{0.0, 0.7, 0.3},
	{0.4, 0.1, 0.2},
	{0.8, 0.5, 0.2},
	{0.2, 0.8, 0.5}
};

names = {
	"FailCode_0",
	"FailCode_1",
	"FailCode_2",
	"FailCode_3",
	"FailCode_4",
	"FailCode_5",
	"FailCode_6",
	"FailCode_7",
	"FailCode_8",
	"FailCode_9",
	"FailCode_10",
	"FailCode_11",
	"FailCode_12",
	"FailCode_13",
	"FailCode_14",
	"FailCode_15",
	"FailCode_16",
	"FailCode_17",
	"FailCode_18",
	"FailCode_19",
	"FailCode_20"
};

Eval( Eval Expr(
color table = New Table("Colors",
	&amp;lt;&amp;lt;New Column( "FailCode", "Character", &amp;lt;&amp;lt;Set Values( names ) ), 
	&amp;lt;&amp;lt;New Column( "States", "Row State", &amp;lt;&amp;lt;Set Each Value( Combine States( colors = Expr( colors ); Color State( colors[Row()] ), Marker State( Row() ) ) ) )
)
) );
color table:States &amp;lt;&amp;lt; Copy to Row States();

table 1 = New Table( "DataExample1",
	&amp;lt;&amp;lt;New Column( "rows", "Numeric", &amp;lt;&amp;lt;Set Values( 1::1000 ) ),
	&amp;lt;&amp;lt;New Column( "Wafer", "Character", &amp;lt;&amp;lt;Set Each Value( "WAFER_" || Char( Random Integer( 1, 4 ) ) ) ),
	&amp;lt;&amp;lt;New Column( "FailCode", "Character", &amp;lt;&amp;lt;Set Each Value( "FailCode_" || Char( 2 * Random Integer( 1, 10 ) ) ) ),
	&amp;lt;&amp;lt;New Column( "Time", "Numeric", &amp;lt;&amp;lt;Set Each Value( Today() + Random Integer( 1, 1000 ) * 60 ), &amp;lt;&amp;lt; Format( "y/m/d h:m:s", 22, 0 ) ),
	&amp;lt;&amp;lt;New Column( "Data", "Numeric", &amp;lt;&amp;lt;Set Each Value( Random Exp() ) )
);

table 2 = New Table( "DataExample1",
	&amp;lt;&amp;lt;New Column( "rows", "Numeric", &amp;lt;&amp;lt;Set Values( 1::5000 ) ),
	&amp;lt;&amp;lt;New Column( "Wafer", "Character", &amp;lt;&amp;lt;Set Each Value( "WAFER_" || Char( Random Integer( 1, 4 ) ) ) ),
	&amp;lt;&amp;lt;New Column( "FailCode", "Character", &amp;lt;&amp;lt;Set Each Value( "FailCode_" || Char( Random Integer( 1, 20 ) ) ) ),
	&amp;lt;&amp;lt;New Column( "Time", "Numeric", &amp;lt;&amp;lt;Set Each Value( Today() + Random Integer( 1, 1000 ) * 60 ), &amp;lt;&amp;lt; Format( "y/m/d h:m:s", 22, 0 ) ),
	&amp;lt;&amp;lt;New Column( "Data", "Numeric", &amp;lt;&amp;lt;Set Each Value( Random Exp() ) )
);
&lt;BR /&gt;//Here is where we set the row-states for the tables to plot.  We don't want the bivariate function setting the row states.
table 1 &amp;lt;&amp;lt; Update( With( color table ),
	Match Columns( :FailCode = :FailCode ),
	Add Columns From Update Table( :States )
);
table 1:States &amp;lt;&amp;lt; Copy to Row States();
table 1 &amp;lt;&amp;lt; Delete Columns( "States" );
&lt;BR /&gt;//again for the second table
table 2 &amp;lt;&amp;lt; Update( With( color table ),
	Match Columns( :FailCode = :FailCode ),
	Add Columns From Update Table( :States )
);
table 2:States &amp;lt;&amp;lt; Copy to Row States();
table 2 &amp;lt;&amp;lt; Delete Columns( "States" );

smart sort = Function( {list, return sort index = 0},
	{args, function name, doc string, sorted list, i, j, var, val, ret},
	sorted list = {};
	For( i = 1, i &amp;lt;= N Items( list ), i++,
		j = 0;
		var = "";
		While( Not( Is Missing( val = Num( Substr( list[i], Length( list[i] ) - j ) ) ) ) &amp;amp; j &amp;lt; Length( list[i] ),
			var = val;
			j++;
		);
		sorted list[i] = Eval List( {Substr( list[i], 1, Length( list[i] ) - j ), var, i, j} );
	);
	sorted list = Sort List( sorted list );
	If( return sort index == 0,
		For( i = 1, i &amp;lt;= N Items( list ), i++,
			list[i] = sorted list[i][1] || Right( Char( sorted list[i][2] ), sorted list[i][4], "0" )
		);
	,
		For( i = 1, i &amp;lt;= N Items( sorted list ), i++,
			If( sorted list[i][1] == "BASELINE",
				list[sorted list[i][3]] = 0
			,
				list[sorted list[i][3]] = i
			)
		);
	);
	list
);

make bivariate = Function( {table, xcol, ycol, categorical, legend},
	{Default Local},
	legend items = Smart Sort( Associative Array( Column( table, legend ) ) &amp;lt;&amp;lt; Get Keys );
	n items = N Items( legend items );
	legend marker box = Col Box( "" );
	names = {};
	For( i = 1, i &amp;lt;= n items, i++,
		Eval( Eval Expr(
		loc = color table &amp;lt;&amp;lt; Get Rows Where( :FailCode == Expr( legend items[i] ) )
		) );
		// here is a little fun magic to create a legend column out of graph boxes
		ob = Outline Box( "",
			gb = Graph Box(
				Frame Size( 14, 14 ),
				Y Scale( 0, 1 ),
				X Scale( 0, 1 ),
				SuppressAxes,
				Marker Seg( [0.5], [0.5], Row States( color table, Matrix( loc ) ) )
			)
		);
		//make sure that all the padding and borders look right
		gb[Frame Box( 1 )] &amp;lt;&amp;lt; Padding( Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 ) ) &amp;lt;&amp;lt; Border( Top, 0 ) &amp;lt;&amp;lt; Border( Bottom, 0 ) &amp;lt;&amp;lt; Border( Left, 0 ) &amp;lt;&amp;lt; Border( Right, 0 ) &amp;lt;&amp;lt; Marker Size( 3 ) &amp;lt;&amp;lt; SetBackgroundFill( 0 );
		gb[Border Box( 1 )] &amp;lt;&amp;lt; Left( 0 ) &amp;lt;&amp;lt; Top( 0 ) &amp;lt;&amp;lt; Right( 0 ) &amp;lt;&amp;lt; Bottom( 0 ) &amp;lt;&amp;lt; Sides( 0 );
		legend marker box &amp;lt;&amp;lt; Append( ob );
		Insert Into( names, legend items[i] );
	);
	legend name box = String Col Box( "FailCode", names );
	Eval( Eval Expr(
	hlb = H List Box(
		Platform( table, //need to encapsulate the bivariate in a platform to ensure it uses the correct table
			biv = Bivariate(
				Y( Column( table, ycol ) ),
				X( Column( table, xcol ) ),
				By(Column( table, categorical ))
			);
		)
	,
		legend box = Table Box(
			legend marker box
		,
			legend name box
		)
	);
	) );
	Try( hlb[List Box( 2 )] &amp;lt;&amp;lt; Set Horizontal( 1 ) );
	legend box &amp;lt;&amp;lt; Set Selectable Rows( 1 ) &amp;lt;&amp;lt; Set Shade Alternate Rows( 0 ) &amp;lt;&amp;lt; Set Shade Cells( 0 ) &amp;lt;&amp;lt; Set Shade Headings( 0 ) &amp;lt;&amp;lt; Set Column Borders( 0 ) &amp;lt;&amp;lt; Set Row Borders( 0 ) &amp;lt;&amp;lt; Set Underline Headings( 0 );
	If( Num( Trim( Word( 1, JMP Version(), "." ) ) ) &amp;gt; 12,
		legend box &amp;lt;&amp;lt; Set Column Group Borders( 0 ) &amp;lt;&amp;lt; Set Heading Column Borders( 0 );
	);
	
	//Lastly we need to set the row change function so that clicking the legend does normal legend things.
	Eval( Eval Expr(
	legend box &amp;lt;&amp;lt; Set Row Change Function(
		Function( {this},
			table = Expr( table );
			items = Expr( legend items );
			rows = this &amp;lt;&amp;lt; Get Selected Rows();
			legend column = Expr( legend );
			If( N Rows( rows ) == 0,
				table &amp;lt;&amp;lt; Clear Select;
				Return( 0 );
			);
			vals = Insert( {}, items[rows] );
			Eval( Parse( Eval Insert( "\[
			table &amp;lt;&amp;lt; Select Where( Contains( ^vals^, :Name("^legend column^") ) )
			]\" ) ) )
		)
	)
	) );
	hlb
);

Eval( Eval Expr(
New Window( "test",
	&amp;lt;&amp;lt;On Close(
		color table = Expr( color table );
		table 1 = Expr( table 1 );
		table 2 = Expr( table 2 );
		Try( Close( table 1, No Save ) );
		Try( Close( table 2, No Save ) );
		Try( Close( color table, No Save ) );
	)
,
	V List Box(
		Outline Box( "",
			make bivariate( table 1, "time", "data", "Wafer", "FailCode" )
		)
	,
		Outline Box( "",
			make bivariate( table 2, "time", "data", "Wafer", "FailCode" )
		)
	)
)
) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Jun 2021 01:57:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Issues-with-reproducing-custom-row-legend-settings-in-JSL/m-p/393255#M64361</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2021-06-15T01:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with reproducing custom row legend settings in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Issues-with-reproducing-custom-row-legend-settings-in-JSL/m-p/394742#M64524</link>
      <description>&lt;P&gt;Thank you! This is exactly what I needed. I was able to use the first part of your code to update my rowstates and then create a legend without selecting a color scheme (selecting none instead of pastel for instance) and it maintained my row states (by wafer) like I wanted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a bit new to JMP script so the smart sort and more complicated bivariate script was a bit hard to follow. Anyway you can clarify any of that just for future use? Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 15:14:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Issues-with-reproducing-custom-row-legend-settings-in-JSL/m-p/394742#M64524</guid>
      <dc:creator>saneal</dc:creator>
      <dc:date>2021-06-21T15:14:10Z</dc:date>
    </item>
  </channel>
</rss>

