JSL スクリプトを使用して Y 軸の参照線ラベルを数値で更新する方法 (USL LSL ラベルを使用してプロットを自動化する)タイトルの通り、JSL スクリプト (USL LSL ラベルを使用してプロットを自動化) を使用して、Y 軸参照線ラベルを数値で更新するにはどうすればよいですか?
現在、JSL スクリプトを使用して、データ テーブルのセットから一連のプロットを生成し、ワンクリックで USL/LSL 制限付きの分布プロットを表示しています。プロットに表示されるこれらの制限は、管理制限テーブルに基づいています (値を更新しました)。ただし、改善するにはもう 1 つの手順が必要です。管理制限テーブルに基づいて、実際の数値でこれらの USL/LSL ラベルを表示することです。ラベルを 1 つずつ手動で更新する以外に、自動化するための関連する JSL コマンドを見つけることができませんでした。誰か例を示す方法を知っていますか? よろしくお願いします。

For( i = 1, i <= 100, i++,
xCol = Column(dt, i);
if ( Mod( i-8, 5 ) == 0,
rowBox = hlistbox();
win << Append( rowBox )
);
rowBox << Append(
//New Window( "training - Fit Y by X by Serial",
//dt << Fit Group(
Graph Builder(
Size( 350, 350 ),
Fit to Window("off"),
Show Control Panel( 0 ),
Show Title ( 1 ),
Show Subtitle ( 0 ),
Show Legend( 1 ),
Show Header ( 0 ),
Show Footer ( 0 ),
//Update Variable to Column Name
Variables(X( :TEMP ),Y( xCol ),Overlay( :Unit )),
Elements( Smoother( X, Y, Legend( 8 ) ), Points( X, Y, Legend( 9 ) ) ),
SendToReport(
Dispatch(
{}, "Graph Builder",
OutlineBox, {Set Title( "" ), Image Export Display(Normal)},
),
Dispatch(
{}, "Graph Builder",
FrameBox,{Transparency(0.8), Left( 0 ), Right( 0 ), Top( 1 ), Bottom( 1 )},
)
//To update labels USL/LSL limits in numeric value
)
)自動化とスクリプト基本的なデータ分析とモデリングウィンドウズRe: JSL スクリプトを使用して Y 軸の参照線ラベルを数値で更新する方法 (USL LSL ラベルを使用してプロットを自動化)これはいくつかのアイデアを与えるかもしれませんhttps://community.jmp.com/t5/Discussions/Change-Line-Color-and-Line-Style-in-all-platforms/mp/819799/highlight/true#M99792
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
ml = dt << Manage Limits(
Process Variables(dt << Get Column Group("Processes")),
);
ml << Show Limits All;
ml << Save to Column Properties;
ml << Close Window;
dt << Distribution(
Stack(1),
Continuous Distribution(
Column(:NPN1),
Horizontal Layout(1),
Vertical(0),
Process Capability(Use Column Property Specs)
)
);
// "Tool script" starts from here
// Names Default To Here(1);
abs = Current Report() << XPath("//AxisBox");
names = {"A", "B", "C", "D"};
idx = 0;
For Each({ab}, abs,
s = ab << get script;
For Each({cur_s}, s,
If(Head Name(cur_s) == "Add Ref Line",
l = Substitute(Name Expr(cur_s), Expr(Add Ref Line()), Expr(List()));
If(Contains(l, "LSL") | Contains(l, "Target") | Contains(l, "USL"),
// this isn't documented
idx++;
Eval(EvalExpr(
ab << Update Ref Line(1, Expr(idx), "Solid", "Orange", names[idx], 3);
));
);
);
);
);
特定のプラットフォームと軸が1つだけであれば、これはおそらく単純化できるだろう。
Re: JSL スクリプトを使用して Y 軸の参照線ラベルを数値で更新する方法 (USL LSL ラベルを使用してプロットを自動化)これは、列の仕様制限を設定し、グラフビルダーを実行して仕様制限を自動的に表示する簡単なスクリプトです。

Names Default To Here( 1 );
dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );
htUSL = 66;
htLSL = 55;
Eval(
Eval Expr(
dt:height << set property(
"spec limits",
{LSL( Expr( htLSL ) ), USL( Expr( htUSL ) ), Show Limits( 1 )}
)
)
);
dt << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);
Re: JSL スクリプトを使用して Y 軸の参照線ラベルを数値で更新する方法 (USL LSL ラベルを使用してプロットを自動化)ありがとう、ネルソン。コードは私のコードと似ていて、USL LSL の参照線を数値で表示することもできません。
Num(htUSL) を使用して数値に変更しようとしましたが、参照線がまったくないプロットが生成されました。参照線を表示するには、Expr (htUSL) を使用する必要があります。手動の方法を除いて、JSL スクリプトを介して数値でこれらの制限を表示する他のオプションはないようです。
htUSL = 66;
htLSL = 55;
Eval(
Eval Expr(
dt:height << set property(
"spec limits",
{LSL( Expr( htLSL ) ), USL( Expr( htUSL ) ), Show Limits( 1 )},
{LSL( Num( htLSL ) ), USL( Num( htUSL ) ), Show Limits( 1 )}, //Not working
)
)
);Re: JSL スクリプトを使用して Y 軸の参照線ラベルを数値で更新する方法 (USL LSL ラベルを使用してプロットを自動化)ありがとう、Jarmo。これは、プロセス能力の方法でプロットを表示するのに適しており、数値の代わりに USL LSL も表示します。管理制限テーブルはすでに更新されていますが、JSL スクリプトを使用してプロットに数値でこれらの制限を表示するためのもう 1 つの手順が必要です。
Re: JSL スクリプトを使用して Y 軸の参照線ラベルを数値で更新する方法 (USL LSL ラベルを使用してプロットを自動化)Set Property("Spec Limits") 関数で 2 つのリストを使用するのはなぜですか? Spec Limits では、1 セットの制限のみが許可されます。さらに、Eval( EvalExpr() 関数は、囲まれた関数内で Expr() を検索し、各 Expr() の値を展開してから、Eval() 関数で適切に評価できます。2 番目の Spec Limits 仕様では、Expr() を Num() に置き換えました。これは、JMP リスト内にあるため、その評価や htLSL および htUSL は評価されず、JSL に渡される内容は JMP には不明になります。
複数の列を実行しようとしている場合は、各列に個別に仕様制限を設定する必要があります。
私の例を変更せずに実行しましたか? 実行した場合、USL および LSL 参照線を含むグラフが生成されますか?
Re: JSL スクリプトを使用して Y 軸の参照線ラベルを数値で更新する方法 (USL LSL ラベルを使用してプロットを自動化)こんにちは、ジム。参照線を「USL」テキストではなく数値に変更することについてです。
コード例では、USL、LSL 参照線を変更せずにグラフに表示できますが、USL/LSL を数値 (管理制限テーブルからの参照) で表示したいだけです。
添付のスナップショットは、USL、LSL を数値で変更したいという私の希望を示しています (右側を参照)。ただし、自動化のために JSL スクリプトで実行できればと思います。ありがとうございます。

Re: JSL スクリプトを使用して Y 軸の参照線ラベルを数値で更新する方法 (USL LSL ラベルを使用してプロットを自動化)これは、既存の限界テーブルを使用して参照線を作成する例です。2つの異なる方法を使用した2つの異なる例があります。

Names Default To Here( 1 );
dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );
// open a limits table created from Manage Limits
dtLimit = New Table( "Limits",
Add Rows( 2 ),
New Column( "Variable", Character, "Nominal", Set Values( {"height", "weight"} ) ),
New Column( "LSL", Set Values( [55, 65] ) ),
New Column( "USL", Set Values( [66, 170] ) ),
New Column( "Target", Set Selected, Set Values( [., .] ) )
);
// One way to set the reference lines
colNames = dt << get column names( string, continuous );
// Create the graphs
For Each( {col}, colNames,
gb = dt << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( As Column( col ) ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);
// Set the ref lines
// Get the row in the limits table that has the limits for the current column
theRow = (dtLimit << get rows where( dtLimit:Variable == col ))[1];
Report( gb )[AxisBox( 2 )] << add ref line(
dtLimit:LSL[theRow],
"Solid",
"Blue",
Char( dtLimit:LSL[theRow] ),
1
);
Report( gb )[AxisBox( 2 )] << add ref line(
dtLimit:USL[theRow],
"Solid",
"Blue",
Char( dtLimit:USL[theRow] ),
1
);
);
// Second way to set the reference lines using Spec Limits column property
// the default when using the Spec Limits is for graph builder to insure
// the spec limits are displayed on the graph. This example with use the
// spec limits, and then change the label to a numeric
colNames = dt << get column names( string, continuous );
ml = dt << Manage Limits( Process Variables( Eval( colNames ) ) );
ml << load from limits table( dtLimit );
ml << Show Limits All;
ml << Save to Column Properties;
ml << Close Window;
// Create the graphs
For Each( {col}, colNames,
gb = dt << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( As Column( col ) ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);
// Set the ref lines
// Get the limits from the spec limits for the current column
// and change the label
specs = Column( dt, col ) << get property( spec limits );
Report( gb )[AxisBox( 2 )] << add ref line( specs["LSL"], "Solid", "Blue", Char( specs["LSL"] ), 1 );
Report( gb )[AxisBox( 2 )] << add ref line( specs["USL"], "Solid", "Blue", Char( specs["USL"] ), 1 );
);Re: JSL スクリプトを使用して Y 軸の参照線ラベルを数値で更新する方法 (USL LSL ラベルを使用してプロットを自動化)私が提供したスクリプトは、プロット内のスペック限界の名前を変更する方法を示しているため、理解できなかったと思います。これは、LSL、USL、ターゲットテキストの代わりに値を使用します。
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
ml = dt << Manage Limits(
Process Variables(dt << Get Column Group("Processes")),
);
ml << Show Limits All;
ml << Save to Column Properties;
ml << Close Window;
gb = dt << Graph Builder(
Size(528, 448),
Show Control Panel(0),
Variables(X(:SITE), Y(:NPN1)),
Elements(Points(X, Y, Legend(3)))
);
abs = Report(gb) << XPath("//AxisBox");
idx = 0;
For Each({ab}, abs,
s = ab << get script;
For Each({cur_s}, s,
If(Head Name(cur_s) == "Add Ref Line",
l = Substitute(Name Expr(cur_s), Expr(Add Ref Line()), Expr(List()));
If(Contains(l, "LSL") | Contains(l, "Target") | Contains(l, "USL"),
idx++;
Eval(EvalExpr(
ab << Update Ref Line(1, Expr(idx), "Solid", "Blue", Char(l[1]), 1);
));
);
);
);
);

おそらく、限界値の表示を有効にして仕様限界列プロパティを使用せず、独自の名前の列プロパティに基づいて参照線として限界値を追加する方がよいでしょう。
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
gb = dt << Graph Builder(
Size(528, 448),
Show Control Panel(0),
Variables(X(:SITE), Y(:NPN1)),
Elements(Points(X, Y, Legend(3)))
);
specs = Column(dt, "NPN1") << get property("Spec Limits");
Report(gb)[AxisBox(2)] << Add Ref Line(
specs["LSL"], "Solid", "Blue", Char(specs["LSL"]), 1
);
Report(gb)[AxisBox(2)] << Add Ref Line(
specs["USL"], "Solid", "Blue", Char(specs["USL"]), 1
);
Re: JSL スクリプトを使用して Y 軸の参照線ラベルを数値で更新する方法 (USL LSL ラベルを使用してプロットを自動化)休日に返信していただきありがとうございます、ジム。2 番目の方法で数値で設定できるようになりました。
Re: JSL スクリプトを使用して Y 軸の参照線ラベルを数値で更新する方法 (USL LSL ラベルを使用してプロットを自動化)例をありがとう、Jarmo。示された例は両方とも正常に動作しています。自動化が完了しました。