分析の一環として、最大8つの非常によく似たプロットを作成するスクリプトがあります。プロット数は、対応する列が存在するかどうかによって異なります。プロットの唯一の違いは、y軸データとタイトルに使用されている列です。効率のために、私は各プロットを順番にスクリプティングすることを避けようとしていました。列名とタイトルの事前に確立されたリストから抜粋したforループを使用しようとしましたが、うまくいきませんでした。これはJMP 13で実際に可能ですか?試した内容のスクリプトセクションを添付しました。
助けてくれてありがとう!スクリプトが動作しました。
いくつかの問題
1。あなたのグラフビルダーのコードは、構文解析エラーでコードを終わらせていた ")"の位置を間違えていました。
2。:Name()関数は要素を解決しないので、関数の値として:cols [f]のようなものを持つことはできません。 引用符付きの文字列だけを渡す必要があります。
以下のコードは両方の問題を解決します
For( f = 1, f <= N Items( plots ), f++,
Eval(
Substitute(
Expr(
__plots__ = Graph Builder(
Size( 1267, 905 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :RPN, Order By( __col__ ), Descending, Order Statistic( "Mean" ) ) ),
Y( __col__ ),
Elements( Bar( X, Y, Legend( 4 ), Label( "Label by Value" ) ) ),
SendToReport(
Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( outline titles[f] )} ),
Dispatch( {}, "RPN", ScaleBox, {Max( 10.5 ), Label Row( Label Orientation( "Angled" ) )} ),
Dispatch( {}, "400", ScaleBox, {Legend Model( 4, Properties( 0, {Fill Color( 53 )} ) )} ),
Dispatch( {}, "graph title", TextEditBox, {Set Text( plot titles[f] )} ),
Dispatch( {}, "X title", TextEditBox, {Set Text( "RPN" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "Affected Lots" )} ),
Dispatch( {}, "400", LegendBox, {Set Title( "" )} )
)
)
),
Expr( __plots__ ), Parse( "Plots" || Char( f ) ),
Expr( __col__ ), Parse( ":Name(\!"" || Char( cols[f] ) || "\!")" )
)
)
);