문자열에 있는 각 웨이퍼에 대해 이변량 플롯을 만들려고 합니다. FailCode에는 구별할 수 있는 다양한 색상 옵션이 있으므로 사용자 정의 색상 및 마커로 행 범례를 업데이트하려는 점을 제외하면 괜찮아 보입니다. 일반 색상 테마를 사용할 수 없습니다. 방법이 있나요? JSL에서 생성된 각 플롯에 대해 동일한 사용자 정의 범례 사양을 생성하시겠습니까?
*이러한 변경 작업을 수행하고 스크립트에 복사한 후 스크립트를 업데이트하는 방법을 생각하려고 했습니다. 그러나 운이 없었습니다.
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 )
)}
)
)
);
테이블 상자 내부의 열 상자 내부에 있는 그래프 상자에서 사용자 정의 범례를 생성할 수 있습니다.
예를 들어, 여기서는 실패 코드와 각 코드에 사용할 행 상태를 포함하는 테이블을 만듭니다. 코드에서 재사용하기 위해 전역 네임스페이스에 이를 설정하고 테이블을 비공개로 설정하여 테이블을 비공개로 설정할 수 있습니다. 표시되지 않음).
다음으로 두 개의 예제 데이터 테이블을 생성합니다. 그 중 하나에는 실패 코드의 절반만 정의되어 있습니다.
다음으로 두 가지 함수를 만듭니다. 하나는 연속된 범례 항목이 연속되도록(즉, "FailCode_1, FailCode_10, FailCode_2"가 올바르게 정렬되도록) 스마트 정렬을 수행합니다.두 번째 함수는 이변량을 플롯하고 사용자 정의 범례를 추가합니다.
이를 실행하면 동일한 FailCode에 대해 각 플롯의 색상과 마커가 어떻게 동일한지 확인합니다.코드의 색상과 마커를 설정하고 싶을 수도 있습니다. 이는 단순한 예입니다.
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",
<<NEW column=""></NEW>//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 << Update( With( color table ),
Match Columns( :FailCode = :FailCode ),
Add Columns From Update Table( :States )
);
table 1:States << Copy to Row States();
table 1 << Delete Columns( "States" );
<BR />//again for the second table
table 2 << Update( With( color table ),
Match Columns( :FailCode = :FailCode ),
Add Columns From Update Table( :States )
);
table 2:States << Copy to Row States();
table 2 << 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 <= N Items( list ), i++,
j = 0;
var = "";
While( Not( Is Missing( val = Num( Substr( list[i], Length( list[i] ) - j ) ) ) ) & j < 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 <= 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 <= 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 ) ) << Get Keys );
n items = N Items( legend items );
legend marker box = Col Box( "" );
names = {};
For( i = 1, i <= n items, i++,
Eval( Eval Expr(
loc = color table << 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 )] << Padding( Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 ) ) << Border( Top, 0 ) << Border( Bottom, 0 ) << Border( Left, 0 ) << Border( Right, 0 ) << Marker Size( 3 ) << SetBackgroundFill( 0 );
gb[Border Box( 1 )] << Left( 0 ) << Top( 0 ) << Right( 0 ) << Bottom( 0 ) << Sides( 0 );
legend marker box << 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 )] << Set Horizontal( 1 ) );
legend box << Set Selectable Rows( 1 ) << Set Shade Alternate Rows( 0 ) << Set Shade Cells( 0 ) << Set Shade Headings( 0 ) << Set Column Borders( 0 ) << Set Row Borders( 0 ) << Set Underline Headings( 0 );
If( Num( Trim( Word( 1, JMP Version(), "." ) ) ) > 12,
legend box << Set Column Group Borders( 0 ) << 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 << Set Row Change Function(
Function( {this},
table = Expr( table );
items = Expr( legend items );
rows = this << Get Selected Rows();
legend column = Expr( legend );
If( N Rows( rows ) == 0,
table << Clear Select;
Return( 0 );
);
vals = Insert( {}, items[rows] );
Eval( Parse( Eval Insert( "\[
table << Select Where( Contains( ^vals^, :Name("^legend column^") ) )
]\" ) ) )
)
)
) );
hlb
);
Eval( Eval Expr(
New Window( "test",
<<ON close=""></ON>