그래프를 배열하는 방법을 이해하고 싶습니다.
사용자가 각 행에 3개의 그래프를 포함하여 2개 행으로 정렬하려는 경우 아래 스크립트를 사용하면 됩니다.
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 ) ) )
)
),
)
);
그러나 for 루프를 사용하면 아래에서 보이는 것처럼 동일한 효과를 얻을 수 없습니다.
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 ) ) )
)
)
)
)
);
for 루프의 출력이 그래프를 올바르게 표시하도록 하려면 무엇을 수정해야 합니까?
H List Boxes 대신 Lineup Box(N Col(3))를 사용하는 것이 좋습니다.
편집하다:
간단한 예는 다음과 같습니다.
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
);