こんにちは、みんな
ユーザー入力スクリプトの次の部分があります。 実際、スクリプトはうまく機能します。 この問題は、jslを使用してプロットにグリッド線を追加しようとしたときに発生し、その部分が機能していないようです。 X1をx1colに、Y1をy1col(など)に置き換えようとしましたが、うまくいかないようです。 たとえば X1 にマウスを置くと、正しい列が表示されます。 ドラッグ アンド ドロップだけで済むことはわかっていましたが、大規模なデータ セットを操作してプロットを生成しているので、それらを自動化できるのは良いことです。 この問題を克服するにはどうすればよいかアドバイスをお願いします。
x1col = Column(dt, X1);
y1col = Column(dt, Y1);
y2col = Column(dt, Y2);
y3col = Column(dt, Y3);
y4col = Column(dt, Y4);
Graph Builder(
Variables(X(Column(dt, X1)), Y(Column(dt, Y1)), Y(Column(dt, Y2)),Y(Column(dt, Y3)),Y(Column(dt, Y4)),
Group X( :Title )
),
Elements( Position( 1, 1 ), Line( X, Y )),
Elements( Position( 1, 2 ), Line( X, Y )),
Elements( Position( 1, 3 ), Line( X, Y )),
Elements( Position( 1, 4 ),
//Bar( X, Y, Legend( 36 ), Summary Statistic( "N" ) )
Bar( X, Y, Summary Statistic( "N" ))),
SendToReport(
Dispatch(
{},
<EM>X1</EM>,
ScaleBox,
{Label Row( Label Orientation( "Vertical" ) )}
),
Dispatch( {}, :<EM>Y1</EM>, ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch(
//{},
<EM>Y2</EM>,
ScaleBox,
{Label Row( Show Major Grid( 1 ) )}
),
Dispatch( {}, <EM>Y3</EM>, ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch( {}, <EM>Y4</EM>, ScaleBox, {Label Row( Show Major Grid( 1 ) )} )
)
),ありがとう。
ありがとう、gzmorgan0、完璧に動作します!!
GraphBuilder Scale Box Dispatch ステートメントには列名が必要です。それを行う簡単な方法は次のとおりです
Colref << getname.
以下は、JMP サンプル データ テーブル Candy Bars.jmp を使用して提供したスクリプトを少し変更したものです。
Names Default to Here(1);
//Open the JMP Sample Data table Candy Bars, create a 4x2 display
dt = Open("$Sample_Data/Candy Bars.jmp");
dt << select where(!Contains({"M&M/Mars","Hershey"}, :Brand) );
dt << delete rows();
:Brand << set name("Title");
x1col = Column(dt, "Carbohydrate g");
y1col = Column(dt, "Sugars g");
y2col = Column(dt, "Total fat g");
y3col = Column(dt, "Saturated fat g");
y4col = Column(dt, "Protein g");
candy_gb1 = dt << Graph Builder(
Variables(
X(x1col), Y(y1col), Y(y2col),Y(y3col),Y(y4col),
Group X( :Title )
),
Elements( Position( 1, 1 ), Line( X, Y ) ),
Elements( Position( 1, 2 ), Line( X, Y ) ),
Elements( Position( 1, 3 ), Line( X, Y ) ),
Elements( Position( 1, 4 ),
//Bar( X, Y, Legend( 36 ), Summary Statistic( "N" ) )
Bar( X, Y, Summary Statistic( "N" )) ),
SendToReport(
Dispatch(
{},
x1col<<GETNAME></GETNAME>