그래프 빌더 요소 루프 함수여러 위치 정의에 루프 함수를 어떻게 사용할 수 있나요?
아래와 같이 분리하면 작동합니다.
Eval(
Substitute(
Expr(
gb = cdt << Graph Builder(
Size( 600, 800 ),
Show Control Panel( 0 ),
vvv,
Elements(Position( 1, 1 ),
Points( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 3 ) ),
Smoother( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 4 ) )
),
Elements(
Position( 2, 1 ),
Box Plot( X, Y, Outliers( 0 ) ),
Points( X, Y ),
Bar( X, Y, Bar Style( "Float" ), Label( "Label by Value" ) ),
Legend( 6 )
),
Elements(
Position( 2, 2 ),
Box Plot( X, Y, Outliers( 0 ) ),
Points( X, Y ),
Bar( X, Y, Bar Style( "Float" ), Label( "Label by Value" ) ),
Legend( 7 )
),
Elements(
Position( 2, 3 ),
Box Plot( X, Y, Outliers( 0 ) ),
Points( X, Y ),
Bar( X, Y, Bar Style( "Float" ), Label( "Label by Value" ) ),
Legend( 8 )
)
)
),
Expr( vvv ),
Name Expr( var expr )
)
);하지만 이런 루프를 사용하면 막대만 있는데, 이 코드에서 무엇이 빠졌을까요?
Eval(
Substitute(
Expr(
gb = cdt << Graph Builder(
Size( 600, 800 ),
Show Control Panel( 0 ),
vvv,
Elements(Position( 1, 1 ),
Points( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 3 ) ),
Smoother( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 4 ) )
),
For( j = 1, j <= n_mydatecol, j++,
Elements(
Position( 2, j ),
Box Plot( X, Y, Outliers( 0 ) ),
Points( X, Y ),
Bar( X, Y, Bar Style( "Float" ), Label( "Label by Value" ) ),
Legend(eval( 5 + j ))
),
),
)
),
Expr( vvv ),
Name Expr( var expr )
)
);
자동화 및 스크립팅윈도우Re: 그래프 빌더 요소 루프 함수요소 표현식을 별도로 빌드한 다음 그래프 빌더 표현식 내에서 평가할 수 있습니다. 또는 어떤 경우에는 << Add Element를 사용하면 더 쉬울 수 있습니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = Graph Builder(Variables(X(:height), Y(:weight)), Elements(Points(X, Y), Smoother(X, Y)));
Wait(0.5);
gb << Add Element(1, 1, {Type("Line Of Fit"), X, Y, Degree("Quadratic")});Re: 그래프 빌더 요소 루프 함수제 차트를 이렇게 만들고 싶은데, 위치를 정의해야 하나요?

Re: 그래프 빌더 요소 루프 함수Add element를 사용하면 X와 Y 위치를 설정할 수 있습니다. 사용 사례에 맞는지 시도해 보셨나요?
Re: 그래프 빌더 요소 루프 함수안녕하세요, Jarmo,
아래 코드를 사용해 보세요. 하지만 여전히 상자 그림만 표시하고 싶은데, 막대와 레이블은 어떻게 표시할 수 있을까요?

Eval(
Substitute(
Expr(
gb = cdt << Graph Builder(
Size( 1200, 800 ),
Show Control Panel( 0 ),
vvv,
Elements(
Position( 1, 1 ),
Points( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 3 ) ),
Smoother( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 4 ) )
)
);
// Loop to add repetitive elements
For( i = 2, i <= 10, i++,
gb << Add Elements(
Position( 2, i ),
Box Plot( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 2 * i + 1 ) ),
Bar( X, Y, Legend( 2 * i + 2 ), Bar Style( "Float" ), Label( "Label by Value" ), Label Format( "Fixed Dec", 5, 2 ) )
);
);
),
Expr( vvv ),
Name Expr( var expr )
)
);
Re: 그래프 빌더 요소 루프 함수예제 데이터를 생성해야 하거나(또는 적절한 데이터를 찾아야 하거나) 그래프를 다시 생성해야 하므로 시간이 좀 걸릴 것입니다.
Re: 그래프 빌더 요소 루프 함수모든 이미지가 이전과는 전혀 다른 것으로 바뀐 걸 볼 수 있어요... 제공된 스크립트가 새 이미지에 얼마나 잘 대응하는지 잘 모르겠어요. 어떤 열을 동적으로 추가해야 하고 어디에 추가해야 할까요?
이를 위한 그래프 빌더 스크립트

이런 것 같아요
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Size(528, 454),
Show Control Panel(0),
Variables(X(:height), X(:sex), Y(:weight)),
Elements(
Position(1, 1),
Points(X, Y, Legend(5)),
Smoother(X, Y, Legend(6)),
Line Of Fit(X, Y, Legend(8))
),
Elements(
Position(2, 1),
Points(X, Y, Legend(18)),
Bar(X, Y, Legend(19), Bar Style("Float"), Label("Label by Value"))
)
);
이와 같은 플롯이 있고 오른쪽에 포인트가 있는 플로트 막대형 차트를 추가하려는 경우

add 요소를 사용할 수 있습니다
gb << Add Element(2, 1, {Type("Bar"), X, Y, Bar Style("Float"), Label("Label by Value")});
더 보기...
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Size(528, 454),
Show Control Panel(0),
Variables(X(:height), X(:sex), Y(:weight)),
Elements(
Position(1, 1),
Points(X, Y, Legend(5)),
Smoother(X, Y, Legend(6)),
Line Of Fit(X, Y, Legend(8))
),
Elements(
Position(2, 1),
Points(X, Y, Legend(18))
)
);
gb << Add Element(2, 1, {Type("Bar"), X, Y, Bar Style("Float"), Label("Label by Value")});
Re: 그래프 빌더 요소 루프 함수안녕하세요, Jarmo,
도와주셔서 감사합니다. y축이 하나뿐인 경우에는 작동할 수 있지만, 제가 원하는 것은 y축이 여러 개 있는 경우에도 루프 함수를 사용하여 상자 그림과 막대가 있는 요소를 가질 수 있습니까? 첫 번째 것과 같이 시도했지만 막대가 없는 상자 그림만 표시되었습니다.
Re: 그래프 빌더 요소 루프 함수당신이 무엇을 플로팅하고 있는지 잘 모르겠지만, 작동할 수도 있고 작동하지 않을 수도 있습니다. 여기서 Add Element를 사용하여 X축 2와 Y축 1, 2에 막대형 차트를 추가합니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Size(528, 454),
Show Control Panel(0),
Variables(X(:height), X(:sex), Y(:name), Y(:weight)),
Elements(Position(1, 1), Points(X, Y, Legend(20))),
Elements(
Position(1, 2),
Points(X, Y, Legend(5)),
Smoother(X, Y, Legend(6)),
Line Of Fit(X, Y, Legend(8))
),
Elements(Position(2, 1), Points(X, Y, Legend(19))),
Elements(Position(2, 2), Points(X, Y, Legend(18)))
);
gb << Add Element(2, 1, {Type("Bar"), X, Y, Bar Style("Float"), Label("Label by Value")});
gb << Add Element(2, 2, {Type("Bar"), X, Y, Bar Style("Float"), Label("Label by Value")});

Re: 그래프 빌더 요소 루프 함수효과가 있어서 이렇게 시도해 봅니다.
정말 감사합니다
Eval(
Substitute(
Expr(
gb = cdt << Graph Builder(
Size( 600, 800 ),
Show Control Panel( 0 ),
vvv,
Elements(Position( 1, 1 ),
Points( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 3 ) ),
Smoother( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 4 ) )
),
);
For( i = 1 , i <= n_mymetric , i++,
gb << Add Element(2, i, {Type("Bar"), X, Y, Bar Style("Float"), Label("Label by Value")});
),
),
Expr( vvv ),
Name Expr( var expr )
)
);