JSLを使用してGraph Builderのポイントやスムーズ凡例を削除する方法?こんにちは、
デフォルトでは、Graph Builderに点とスムージング線がある場合は、両方に凡例があります。時々、2つの伝説を持つことは冗長であり、私は1つを取り除きたいです。この構文は何ですか?
グラフビルダー関数を作りました(下記参照)。しかし、Legend(0)をPointsに入れてもLegendを削除できないようです。
//Variable //Definition
//listin ==> list object which contains the following arguments:
//1. Ncol for Line Up Box output
//2. Frame size length
//3. Frame size height
//4. X axis column
// 5+. Y axis columns
// grp ==> grouping variable for X
//ovl ==> grouping variable for overlay (fitting)
// plotout ==> line up box object output
dgbplot = Function({listin,grp,ovl},{plotout},
plotout=Lineup Box(N Col(listin[1]),);
For (i=5, i<=Nitems(listin), i++,
gb = Graph Builder(
Size( Eval(listin[2]), Eval(listin[3]) ),
Show Control Panel( 0 ),
Variables(
X( Column(Eval(listin[4]))),
Y( Column(Eval(listin[i]))),
Group X(Column(grp)),
Overlay(Column(ovl))
),
Elements( Points( X, Y ), Smoother( X, Y, Legend(0), Lambda(5))),
);
gbr = gb << report;
);
plotout;
);その一方で、私はいくつかの "試用"スクリプトを作成しようとしましたが、それは私が欲しいものを行います。その理由は理解できません。
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
Size( 960, 300 ),
Show Control Panel( 0 ),
Variables(
X( :weight ),
Y( :height ),
Group X( :sex ),
Overlay( :sex )
),
Elements(
Points( X, Y, ),
Smoother( X, Y, Lambda( 5 ) )
)
)
ありがとう、
シェイラ
再:どのようにJSLを使用してグラフビルダーのポイントまたは滑らかな凡例を削除する?私はあなたの機能はそれが戻ってきたものに問題があったと思います。 あなたの "plotout"要素は関数として以下のように定義されていました:
plotout=Lineup Box(N Col(listin[1]),);
これは完成したオブジェクトで、空のラインナップボックスが含まれています。 関数に他に何も追加しません。 ただし、関数から返されるのは、指定した要素です。 以下のスクリプトはあなたが望むプロットを生成します。 Lineup Box()の中にGraph Builderのコードを組み込んだ関数の単純な変更に注意してください。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dgbplot = Function( {listin, grp, ovl},
{plotout},
plotout = Lineup Box( N Col( listin[1] ),
For( i = 5, i <= N Items( listin ), i++,
gb = Graph Builder(
Size( Eval( listin[2] ), Eval( listin[3] ) ),
Show Control Panel( 0 ),
Variables(
X( Column( Eval( listin[4] ) ) ),
Y( Column( Eval( listin[i] ) ) ),
Group X( Column( grp ) ),
Overlay( Column( ovl ) )
),
Elements( Points( X, Y ), Smoother( X, Y, Legend( 0 ), Lambda( 5 ) ) )
// uncomment the lines below to remove smoother legend and keep points
/*,SendToReport(
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {2, [0, 1], 1, [-1, -1]} ), Position( {0, 1, -1, -1} )}
)
)*/
);
gbr = gb << report;
)
);
plotout;
);
listin = {1, 960, 300, "weight", "height"};
nw = New Window( "test", vlb = V List Box() );
myplot = dgbplot( listin, "sex", "sex" );
vlb << append( myplot );