Come rimuovere punti o Smooth Legend per Graph Builder usando JSL?Ciao,
Per impostazione predefinita se ci sono punti e linee di levigatura in Graph Builder, ci sono legende per entrambi. A volte, avere due leggende è ridondante e vorrei liberarmene una. Qual è la sintassi per questo?
Ho creato una funzione di creazione di grafici (vedi sotto). Ma non riesco a rimuovere la legenda anche se inserisco la legenda (0) in Punti.
//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;
);D'altra parte, ho provato a fare qualche script di "prova" e fa quello che voglio. Non riesco a capire perché.
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 ) )
)
)
Grazie,
shaira
Ri: Come rimuovere punti o Smooth Legend per Graph Builder usando JSL?Credo che la tua funzione abbia avuto un problema con quello che stava tornando. Il tuo elemento "plotout" è stato definito con la funzione come:
plotout=Lineup Box(N Col(listin[1]),);
Questo è un oggetto completato, che contiene una finestra di dialogo vuota. Nient'altro nella funzione si aggiunge ad esso. Tuttavia, è l'elemento che si specifica che deve essere restituito dalla funzione. Lo script seguente genererà i grafici desiderati. Si noti la semplice modifica della funzione, che incorpora il codice Graph Builder all'interno della finestra di dialogo ()
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 );