Je veux comprendre comment organiser les graphiques.
Lorsqu'un utilisateur souhaite les organiser sur deux lignes avec trois graphiques dans chaque ligne, je peux y parvenir en utilisant le script ci-dessous :
New Window( "Test",
H List Box(
For( i = 1, i < 4, i++,
Graph Builder(
Size( 528, 450 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
)
),
),
H List Box(
For( i = 1, i < 4, i++,
Graph Builder(
Size( 528, 450 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
)
),
)
);
Cependant, lorsque j'utilise une boucle for, je ne parviens pas à obtenir le même effet, comme indiqué ci-dessous :
New Window( "Test",
For( k = 1, k < 3, k++,
H List Box(
For( i = 1, i < 4, i++,
Graph Builder(
Size( 528, 450 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
)
)
)
)
);
Que dois-je modifier pour que la sortie de la boucle for affiche correctement les graphiques ?
Je vous suggère d'utiliser la zone de liste (N Col (3)) au lieu des zones de liste H
Modifier:
Voici un exemple simple
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
lub = Lineup Box(N Col(3));
For(i = 1, i <= 10, i++,
lub << Append(
dt << Graph Builder(
Show Control Panel(0),
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
);
)
);
nw = New Window("report",
lub
);