Wie entferne ich Points oder Smooth Legend for Graph Builder mit JSL?Hallo,
Wenn es Punkte und Glättungslinien im Graph Builder gibt, gibt es standardmäßig Legenden für beide. Manchmal ist es überflüssig, zwei Legenden zu haben, und ich würde gerne eine loswerden. Wie ist die Syntax dafür?
Ich habe eine Graph-Builder-Funktion erstellt (siehe unten). Aber ich kann die Legende anscheinend nicht entfernen, selbst wenn ich Legende (0) in Punkte einfüge.
//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;
);Andererseits habe ich versucht, ein "Testskript" zu erstellen, und es tut, was ich will. Ich kann nicht verstehen, warum.
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 ) )
)
)
Danke,
Schaira
Re: Wie entferne ich Points oder Smooth Legend für Graph Builder mit JSL?Ich glaube, dass Ihre Funktion ein Problem mit der Rückgabe hatte.Ihr "Plotout" -Element wurde innerhalb der Funktion wie folgt definiert:
plotout=Lineup Box(N Col(listin[1]),);
Dies ist ein abgeschlossenes Objekt, das eine leere Aufstellungsbox enthält.Nichts anderes in der Funktion trägt dazu bei.Es ist jedoch das von Ihnen angegebene Element, das von der Funktion zurückgegeben werden soll.Das folgende Skript generiert die gewünschten Diagramme.Bitte beachten Sie die einfache Änderung in der Funktion, die den Graph Builder-Code in das Lineup-Feld integriert ()
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 );