.csv ファイルの X 座標から複数の異なる範囲の差分を計算し、グラフまたはテキスト ボックスに表示するための JMP スクリプト式こんにちは。いくつかのデータ ポイントの添付グラフを作成し、追加の折れ線グラフでそれをオーバーレイするスクリプトがあります。 ここで、複数の異なる x 座標における最高点と最低点の間のデルタを計算できるようにする必要があります。 すべての X 座標値が含まれているため、最初の操作は実行できますが、オレンジ色の計算された線の間の X 座標値のみと、最初の曲線のみに対してそれを行う方法に困惑しています。オレンジ色の線の内側の左側と右側の両方を計算します。 可能であればこれらの値をグラフ上、またはグラフの作成時に表示されるテキスト ボックスに表示したいと考えました。 デルタを計算するために必要な 4 つの異なる範囲を説明するのに役立ついくつかの画像と、現在のスクリプトを含めました。 オレンジ色の線は、スクリプトの実行時にユーザーが入力した値に基づいているため、データに応じて変化する可能性があります。 ご協力をよろしくお願いいたします。 ありがとう!



framex_value = "";
w = New Window( "Frame size X",// opens a window with a title and this content...
<<RETURN result=""> (76200 - framex_value/2) & :X coordinate < (76200 - framex_value/2) );
//dt << delete rows:
//FieldMat = matrix(Col Max(IntenCD)-(Col Min(IntenCD)));
New Window( " Delta results: ", modal,
Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing
V List Box( // V and H lists nest to organize the display boxes
H List Box( Text Box( "Full plate delta: " ), TextBox( Char( FullMat ) ) ),
//Spacer Box( size( 1, 10 ) ), // a little vertical space
//H List Box( Text Box( "Full field delta: " ), TextBox( Char( FieldMat ) ) ),
//Spacer Box( size( 1, 10 ) ), // a little vertical space
//H List Box( Text Box( "Edge of field delta: " ), TextBox( Char( 0 ) ) ),
))
);
// Determine X Matrix
xMat = matrix(76200 - (framex_value/2)) |/ matrix(76200 - (framex_value/2)) |/
matrix(76200 + (framex_value/2)) |/ matrix(76200 + (framex_value/2));
// The yMat is static
yMat = [1, 0.92, 0.92, 1];
gb = dt << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( :X Coordinate ), Y( :Normalized ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
);
Report( gb )[FrameBox( 1 )] << Add Graphics Script(
Pen Color( "orange" );
Pen Size( 2 );
Line( xmat, ymat );
);
report(gb)[AxisBox(2)] << min(.91);
w << closeWindow; // just the dialog, not the report
)
)
)
)
);</RETURN>品質およびプロセスエンジニアリングRe: .csv ファイルの X 座標から複数の異なる範囲の差分を計算し、グラフまたはテキスト ボックスに表示するための JMP スクリプト式完璧です、ありがとう@txnelson 。 これら 2 つの変更がうまくいきました。 現在は完璧に動作しています。 今回のご協力に改めて感謝申し上げます。
Re: .csv ファイルの X 座標から複数の異なる範囲の差分を計算し、グラフまたはテキスト ボックスに表示するための JMP スクリプト式デフォルトでは、JMP が xMat などの変数を作成すると、その変数は変更されるまで残ります。また、コードの最初の実行時に必要な変数が作成されていない場合、コード内で変数を要求するときに、プログラムに提供する値が含まれていないため、一部の計算が実行できなくなります。実行される。ただし、スクリプトの後半で変数が設定された場合、削除または変更されるまで設定されたままになります。したがって、スクリプトを 2 回目に実行し、最初のスクリプト実行で必要な変数が見つからなかった時点でコードが到達すると、後で設定されたため、今回は変数が見つかります。スクリプトの最後の実行時のコード内の時間。
これが起こりそうな場所を見つけました。データテーブルのアクティビティが完了した後に変数 dt を設定していました。コード行をスクリプト内のさらに上に移動したので、最初の実行でコードが機能する可能性があります。また、スクリプトの最初の行として「Clear Symbols()」を配置しました。これにより、スクリプトの開始時にコード内のすべての変数がクリアされます。これにより、前回の実行の値はすべて消去されているため、参照される変数値はこのコードの実行で作成されている必要があります。コードを試して、機能するかどうかを確認してください。
Clear Symbols();
Names Default To Here( 1 );
ramex_value = "";
w = New Window( "Frame size X", // opens a window with a title and this content...
<<RETURN result=""> (76200 - (framex_value / 2)) & dt:X coordinate < (76200 + (framex_value / 2)),
dt:Normalized,
.
)
) - Col Max( dt:Normalized ) - Col Min( dt:Normalized ) + 1;
Col Min( If( dt:X coordinate > (76200 - (framex_value / 2)) & dt:X coordinate < (76200 + (framex_value / 2)), dt:Normalized, . ) );
// Graph Builer and Delta display
gb = dt << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( dt:X Coordinate ), Y( dt:Normalized ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
);
Report( gb )[FrameBox( 1 )] << Add Graphics Script(
Pen Color( "orange" );
Pen Size( 2 );
Line( xmat, ymat );
// Add the results to the chart
Text( Boxed, {75000, .94}, "Overall Delta = " || Char( Format( overallDelta, 7, 4 ) ) );
Text( Boxed, {75000, .93}, "Within Frame Delta = " || Char( Format( withinOrangeDelta, 7, 4 ) ) );
);
Report( gb )[AxisBox( 2 )] << Min( .91 );
w << closeWindow;
)
)
)
)
);</RETURN>Re: .csv ファイルの X 座標から複数の異なる範囲の差分を計算し、グラフまたはテキスト ボックスに表示するための JMP スクリプト式したがって、スクリプトをさらにテストしたところ、(データに対して 2 回目に実行したときは) 完璧に動作したように見えましたが、最初はそうではありませんでした。 最初の実行後はデルタの計算と表示が行われませんが、スクリプトを 2 回目に実行すると機能します...混乱しています。 クリーンアップされたコードと、最初の実行で結果が得られなかった画像と、2 回目の実行で成功した結果の画像を添付しました。 スクリプトが初めて正しく動作しない原因となるものは何でしょうか?
framex_value = "";
w = New Window( "Frame size X",// opens a window with a title and this content...
<<RETURN result=""> (76200 - (framex_value / 2)) & :X coordinate < (76200 + (framex_value / 2)),
:Normalized,
.
)
) - Col Max( :Normalized ) - Col Min( :Normalized ) +1;
Col Min(
If( :X coordinate > (76200 - (framex_value / 2)) & :X coordinate < (76200 + (framex_value / 2)),
:Normalized,
.
)
);
// Graph Builer and Delta display
gb = dt << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( :X Coordinate ), Y( :Normalized ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
);
Report( gb )[FrameBox( 1 )] << Add Graphics Script(
Pen Color( "orange" );
Pen Size( 2 );
Line( xmat, ymat );
// Add the results to the chart
Text( Boxed, {75000, .94}, "Overall Delta = " || Char( Format( overallDelta, 7, 4 ) ) );
Text( Boxed, {75000, .93}, "Within Frame Delta = " || Char( Format( withinOrangeDelta, 7, 4 ) ) );
);
Report( gb )[AxisBox( 2 )] << Min( .91 );
w << closeWindow;
)
)
)
)
);</RETURN>

Re: .csv ファイルの X 座標から複数の異なる範囲の差分を計算し、グラフまたはテキスト ボックスに表示するための JMP スクリプト式ありがとう@txnelson 。私はこれを理解することができ、完璧に機能しています。 グラフにテキストを表示するには、xy 座標の前後に { } を配置する必要があることがわかりました。 私のスクリプトに関する皆様の知識と支援に本当に感謝しています。
Re: .csv ファイルの X 座標から複数の異なる範囲の差分を計算し、グラフまたはテキスト ボックスに表示するための JMP スクリプト式その追加の説明には意味があります。 あなたの提案に基づいて取り組んでいきます。 ありがとう。
Re: .csv ファイルの X 座標から複数の異なる範囲の差分を計算し、グラフまたはテキスト ボックスに表示するための JMP スクリプト式
// Is the purpose of the display window below, only to display the values of overallDelta and withinOrangeDelta?
// That is all it is going to do. It does not allow for any data input, just displaying of those values
overallDelta = 22;
withinOrangeDelta = 15;
New Window( " Delta results: ",
modal,
Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing
V List Box( // V and H lists nest to organize the display boxes
H List Box( Text Box( "Full plate delta: " ), Text Box( Char( overallDelta, 7, 4 ) ) ),
Spacer Box( size( 1, 10 ) ), // a little vertical space
H List Box( Text Box( "Full field delta: " ), Text Box( Char( withinOrangeDelta, 7, 4 ) ) ),
Spacer Box( size( 1, 10 ) ), // a little vertical space
H List Box( Text Box( "Edge of field delta: " ), Text Box( Char( 0 ) ) ),
)
)
);
// The leftDelta and rightDelta calculations will be similar to the above withinOrangeDelta, but
// I don't know what the upper and lower boundry values of :Normalized are or what the interior
// boundrys for the calclations are
// The code below will create your X Coordinate by Normalized graph
// If you have generated the xmat and ymat matrices, it will draw your orange line on the chart
// Then at a fixed XY point on the graph, of 500,.92 it will add in the text "Overall Delta = nn.nnnn"
// It is likely, that different data from your sample data will make the positioning of the statistics
// inapproprate if you have a hardwired value of 500,.92 for the display. So you will need to determine
// what those values need to be. You can get the values by determining the minimum values in the data table
// or you can query the displayed graph to get the axis minimums and then set the position from there.
gb = dt << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( :X Coordinate ), Y( :Normalized ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
);
Report( gb )[FrameBox( 1 )] << Add Graphics Script(
Pen Color( "orange" );
Pen Size( 2 );
Line( xmat, ymat );
// Add the results to the chart
Text( 500, .92, "Overall Delta = " || Char( Format( overallDelta, 7, 4 ) ) );
Text( 500, .915, "Within Delta = " || Char( Format( withinOrangeDelta, 7, 4 ) ) );
);
Report( gb )[AxisBox( 2 )] << Min( .91 );
// I don't see any window reference called "w"
w << closeWindow; // just the dialog, not the reportRe: .csv ファイルの X 座標から複数の異なる範囲の差分を計算し、グラフまたはテキスト ボックスに表示するための JMP スクリプト式心配しないでください、それが私が疑問に思っていたことでした。
グラフに表示されるテキストについてはどうですか? これは見えません。 グラフの前に値が表示されるポップアップ ウィンドウを作成することはできますが、それらの値をグラフ上に表示してグラフと一緒に確認できるようにするというアイデアがとても気に入りました。 そこに何か欠けているものはありますか?
参考のためにスクリプトの最後だけを含めました。
今回のご協力に改めて感謝申し上げます。
New Window( " Delta results: ", modal,
Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing
V List Box( // V and H lists nest to organize the display boxes
H List Box( Text Box( "Full plate delta: " ), TextBox( Char( overallDelta, 7,4 ) ) ),
Spacer Box( size( 1, 10 ) ), // a little vertical space
H List Box( Text Box( "Full field delta: " ), TextBox( Char( withinOrangeDelta, 7,4 ) ) ),
Spacer Box( size( 1, 10 ) ), // a little vertical space
H List Box( Text Box( "Edge of field delta: " ), TextBox( Char( 0 ) ) ),
))
);
// The leftDelta and rightDelta calculations will be similar to the above withinOrangeDelta, but
// I don't know what the upper and lower boundry values of :Normalized are or what the interior
// boundrys for the calclations are
gb = dt << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( :X Coordinate ), Y( :Normalized ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
);
Report( gb )[FrameBox( 1 )] << Add Graphics Script(
Pen Color( "orange" );
Pen Size( 2 );
Line( xmat, ymat );
// Add the results to the chart
text ( 500,.92, "Overall Delta = " || char(format(overallDelta, 7,4)));
text ( 500,.915, "Within Delta = " || char(format(withinOrangeDelta, 7,4)));
);
report(gb)[AxisBox(2)] << min(.91);
w << closeWindow; // just the dialog, not the report
)
)
)
)
);Re: .csv ファイルの X 座標から複数の異なる範囲の差分を計算し、グラフまたはテキスト ボックスに表示するための JMP スクリプト式はい……どうやら私のタイプミスのようです……ごめんなさいRe: .csv ファイルの X 座標から複数の異なる範囲の差分を計算し、グラフまたはテキスト ボックスに表示するための JMP スクリプト式コード内のインスタンスでは :Normalize と書かれていますが、これは実際には :Normalized でなければなりませんか?

Re: .csv ファイルの X 座標から複数の異なる範囲の差分を計算し、グラフまたはテキスト ボックスに表示するための JMP スクリプト式正規化された列は、指定したデータ テーブルから作成されます。表示されているグラフの作成に使用したデータ....「正規化」列は、それらのグラフの軸値の 1 つとして使用されます。
Re: .csv ファイルの X 座標から複数の異なる範囲の差分を計算し、グラフまたはテキスト ボックスに表示するための JMP スクリプト式これについては助けてくれてありがとう、ただしまだいくつかの問題があります。 スクリプトを実行すると、次のエラーが発生します。
名前が未解決: 'Normalize' のアクセスまたは評価で正規化{16}、:Normalize/*###*/
また、問題が発生しているこのセクションをコメントアウトして、表示コメントをテストすると、グラフに表示されません。
これらの問題を理解するのを手伝ってもらえますか?
ありがとう。
Re: .csv ファイルの X 座標から複数の異なる範囲の差分を計算し、グラフまたはテキスト ボックスに表示するための JMP スクリプト式素晴らしいです、ありがとう。 これは素晴らしいですね。 試してみて、どのように機能するか見てみましょう。 大変助かりました。
Re: .csv ファイルの X 座標から複数の異なる範囲の差分を計算し、グラフまたはテキスト ボックスに表示するための JMP スクリプト式全体とデルタ内を計算するコードをチャートに追加しました (テストされていないコード)。左右のデルタ計算には、ボックスを定義するためのルールが必要です。
2 つの値の非常に単純な表示も追加しました。
どちらの場合も、コードに次の機能拡張を行うために必要なアプローチを提供します。完璧なコードを保証することはできませんが、コンセプトを見てそこから取り入れられるはずです。
framex_value = "";
w = New Window( "Frame size X",// opens a window with a title and this content...
<<RETURN result=""> (76200 - framex_value/2) & :X coordinate < (76200 - framex_value/2) );
//dt << delete rows:
//FieldMat = matrix(Col Max(IntenCD)-(Col Min(IntenCD)));
New Window( " Delta results: ", modal,
Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing
V List Box( // V and H lists nest to organize the display boxes
H List Box( Text Box( "Full plate delta: " ), TextBox( Char( FullMat ) ) ),
//Spacer Box( size( 1, 10 ) ), // a little vertical space
//H List Box( Text Box( "Full field delta: " ), TextBox( Char( FieldMat ) ) ),
//Spacer Box( size( 1, 10 ) ), // a little vertical space
//H List Box( Text Box( "Edge of field delta: " ), TextBox( Char( 0 ) ) ),
))
);
// Determine X Matrix
xMat = matrix(76200 - (framex_value/2)) |/ matrix(76200 - (framex_value/2)) |/
matrix(76200 + (framex_value/2)) |/ matrix(76200 + (framex_value/2));
// The yMat is static
yMat = [1, 0.92, 0.92, 1];
// The overall delta
overallDelta = Col Max( :Normalized ) - Col Min( :Normalized );
// The delta between the lines
withinOrangeDelta = Col Max(
If( :X coordinate > (76200 - (framex_value / 2)) & :X coordinate < (76200 + (framex_value / 2)),
:Normalize,
.
)
) - Col Max( :Normalized ) - Col Min( :Normalized );
withinOrangeDelta = Col Min(
If( :X coordinate > (76200 - (framex_value / 2)) & :X coordinate < (76200 + (framex_value / 2)),
:Normalize,
.
)
);
// The leftDelta and rightDelta calculations will be similar to the above withinOrangeDelta, but
// I don't know what the upper and lower boundry values of :Normalized are or what the interior
// boundrys for the calclations are
gb = dt << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( :X Coordinate ), Y( :Normalized ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
);
Report( gb )[FrameBox( 1 )] << Add Graphics Script(
Pen Color( "orange" );
Pen Size( 2 );
Line( xmat, ymat );
// Add the results to the chart
text ( 500,.92, "Overall Delta = " || char(format(overallDelta, 7,4)));
text ( 500,.915, "Within Delta = " || char(format(withinOrangeDelta, 7,4)));
);
report(gb)[AxisBox(2)] << min(.91);
w << closeWindow; // just the dialog, not the report
)
)
)
)
);</RETURN>