그래프 빌더에 Y 변수를 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?다음 예제 스크립트는 이전 스레드 (덕분에 해결됐어요 @jthi ) 내에서는 Y 변수를 목록의 점으로 플롯할 수 있습니다.
추가하고 싶어요 상자 그림 게다가 포인트들 내 차트에. 아래 스크립트에 상자 그림을 추가하는 방법은 무엇입니까?
Names Default To Here(1);
dt = Open("$sample_data\Big Class.jmp");
y_values = {"name", "age", "sex", "weight"};
variables_expr = Expr(Variables(X(:height)));
For Each({y_col}, y_values,
temp_expr = Expr(Y());
Insert Into(temp_expr, Name Expr(AsColumn(dt, y_col)));
Insert Into(variables_expr, Name Expr(temp_expr));
);
gb_expr = Expr(Graph Builder(
Show Control Panel(0)
));
Insert Into(gb_expr, Name Expr(variables_expr));
For Each({y_col, idx}, y_values,
Eval(EvalExpr(
Insert Into(gb_expr,
Name Expr(Elements(Position(1, Expr(idx)), Points(X, Y, Legend(Expr(idx)))))
)
));
);
Show(Name Expr(gb_expr));
Eval(gb_expr);자동화 및 스크립팅윈도우Re: Y 변수를 그래프 빌더에 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?JMP에서 대화형으로 그래프 생성

스크립트를 클립보드/스크립트 창으로 가져가세요.
Graph Builder(
Show Control Panel(0),
Variables(X(:height), Y(:name), Y(:age), Y(:sex), Y(:weight)),
Elements(Position(1, 1), Points(X, Y, Legend(1)), Box Plot(X, Y, Legend(5))),
Elements(Position(1, 2), Points(X, Y, Legend(2)), Box Plot(X, Y, Legend(6))),
Elements(Position(1, 3), Points(X, Y, Legend(3)), Box Plot(X, Y, Legend(7))),
Elements(Position(1, 4), Points(X, Y, Legend(4)), Box Plot(X, Y, Legend(8))),
SendToReport(
Dispatch(
{},
"400",
LegendBox,
{Legend Position(
{1, [0], 5, [4, -3], 2, [1], 6, [5, -3], 3, [2], 7, [6, -3], 4, [3],
8, [7, -3]}
)}
)
)
)
원래 그래프 빌더가 다음과 같을 때 BoxPlot을 포함하려면 무엇을 변경해야 하는지 확인하세요.
Graph Builder(
Show Control Panel(0),
Variables(X(:height), Y(:name), Y(:age), Y(:sex), Y(:weight)),
Elements(Position(1, 1), Points(X, Y, Legend(1))),
Elements(Position(1, 2), Points(X, Y, Legend(2))),
Elements(Position(1, 3), Points(X, Y, Legend(3))),
Elements(Position(1, 4), Points(X, Y, Legend(4)))
)
스크립트로 돌아가서 약간 수정해 보세요. 원본 스크립트를 기반으로 Elements에서 뭔가가 누락되었음을 매우 쉽게 알 수 있습니다.
Name Expr(Elements(Position(1, Expr(idx)), Points(X, Y, Legend(Expr(idx)))))
거기에 올바른 형식으로 Box Plot을 추가해 보아야 할 것 같습니다.
Re: Y 변수를 그래프 빌더에 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?그래프를 실행합니다.
제어판 열기
원하는 상자 그림을 추가하세요.
제어판 닫기
빨간색 삼각형으로 이동하여 선택하세요.
저장=>스크립트 대 스크립트 창
코드를 검사하고 새 스크립트에는 있고 이전 스크립트에는 없는 추가 항목을 추가하도록 스크립트를 변경합니다.
Re: Y 변수를 그래프 빌더에 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?@txnelson 나는 정확히 그 일을 해왔고 대화형으로 상자 그림을 추가한 다음 결과 스크립트를 확인하고 원래 스크립트를 변경했지만 여전히 상자 그림이 작동하도록 할 수 없었습니다.아직 부족한 부분이나 필요한 부분을 잘 찾아내지 못하는 것 같아요.
시도 할 것이다 @jthi 지금 제안.
Re: Y 변수를 그래프 빌더에 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?JSL을 실행한 다음 원하는 모양으로 그래프를 수정하고 새 그래프에서 JSL을 저장합니다.이 토론 트랙에 새 JSL을 추가하면 살펴보겠습니다.
Re: Y 변수를 그래프 빌더에 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?@txnelson 다음은 실제 사례와 가깝습니다.
Names default To Here (1);
Clear Log ();
dt = Open("$sample_data\Semiconductor Capability.jmp");
y_values = {"NPN1", "IVP1", "PNP4", "NPN4"};
variables_expr = Expr(Variables(X(:lot_id)));
For Each({y_col}, y_values,
temp_expr = Expr(Y());
Insert Into(temp_expr, Name Expr(AsColumn(dt, y_col)));
Insert Into(variables_expr, Name Expr(temp_expr));
);
gb_expr = Expr(Graph Builder(
Show Control Panel(0)
));
Insert Into(gb_expr, Name Expr(variables_expr));
For Each({y_col, idx}, y_values,
Eval(EvalExpr(
Insert Into(gb_expr,
Name Expr(Elements(Position(1, Expr(idx)), Points(X, Y, Legend(Expr(idx)))))
)
));
);
Show(Name Expr(gb_expr));
Eval(gb_expr); 이는

그러나 나는 다음과 같은 것을 원합니다

JMP 생성 스크립트는 다음과 같습니다.
Graph Builder(
Show Control Panel( 0 ),
Variables( X( :lot_id ), Y( :NPN1 ), Y( :IVP1 ), Y( :PNP4 ), Y( :NPN4 ) ),
Elements(
Position( 1, 1 ),
Points( X, Y, Legend( 1 ), Jitter( "None" ) ),
Box Plot( X, Y, Legend( 5 ), Jitter( "None" ) )
),
Elements(
Position( 1, 2 ),
Points( X, Y, Legend( 2 ), Jitter( "None" ) ),
Box Plot( X, Y, Legend( 6 ), Jitter( "None" ) )
),
Elements(
Position( 1, 3 ),
Points( X, Y, Legend( 3 ), Jitter( "None" ) ),
Box Plot( X, Y, Legend( 7 ), Jitter( "None" ) )
),
Elements(
Position( 1, 4 ),
Points( X, Y, Legend( 4 ), Jitter( "None" ) ),
Box Plot( X, Y, Legend( 8 ), Jitter( "None" ) )
),
SendToReport(
Dispatch(
{},
"400",
LegendBox,
{Legend Position(
{1, [0], 5, [4, -3], 2, [1], 6, [5, -3], 3, [2], 7, [6, -3], 4, [3],
8, [7, -3]}
)}
)
)
);문제는 포인트 외에 상자 그림을 포함하도록 이 게시물의 상단 스크립트를 수정하는 방법입니다.
Points() 바로 아래에 Box Plots()를 추가하면 둘 다 제공되지 않습니다.
Box Plots()의 배치가 잘못된 것 같습니다. 여기에 도움이 필요합니다.
Re: Y 변수를 그래프 빌더에 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?기본 "상자 그림" 이상값을 사용한 것 같습니다.
모든 점을 연결하는 "Box Plot" Quantile 방법을 찾고 계십니까?

Graph Builder(
Size( 1135, 705 ),
Show Control Panel( 0 ),
Variables(
X( :“S-b"n ),
Y( :C),
Color( :“S-b"n )
),
Elements( Box Plot( X, Y, Legend( 4 ), Box Type( "Quantile" ) ) )
);
Re: Y 변수를 그래프 빌더에 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?원하는 그래프를 생성하려면 아주 사소한 변경이 필요했습니다.
그래프 빌더를 실행하는 초기 스크립트에 의해 생성된 JSL은 다음과 같습니다.
Graph Builder(
Show Control Panel( 0 ),
Variables( X( :lot_id ), Y( :NPN1 ), Y( :IVP1 ), Y( :PNP4 ), Y( :NPN4 ) ),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 1 ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 2 ) ) ),
Elements( Position( 1, 3 ), Points( X, Y, Legend( 3 ) ) ),
Elements( Position( 1, 4 ), Points( X, Y, Legend( 4 ) ) )
);
위의 Graph Builder 코드를 생성한 JSL을 보면 실제 작업을 수행하는 섹션은 2개뿐입니다.
gb_expr = Expr(Graph Builder(
Show Control Panel(0)
));
그래프 빌더용 셸을 만듭니다.
Graph Builder(
Show Control Panel( 0 ),
);
JSL
variables_expr = Expr(Variables(X(:lot_id)));
For Each({y_col}, y_values,
temp_expr = Expr(Y());
Insert Into(temp_expr, Name Expr(AsColumn(dt, y_col)));
Insert Into(variables_expr, Name Expr(temp_expr));
);
코드를 생성합니다
Variables( X( :lot_id ), Y( :NPN1 ), Y( :IVP1 ), Y( :PNP4 ), Y( :NPN4 ) )
그 다음에,
Insert Into(gb_expr, Name Expr(variables_expr));
Graph Builder() 코드에 Variables( X(....) JSL을 삽입합니다.
Graph Builder(
Show Control Panel( 0 ),
Variables( X( :lot_id ), Y( :NPN1 ), Y( :IVP1 ), Y( :PNP4 ), Y( :NPN4 ) )
);
이제 해야 할 일은 빌드하는 것입니다.
Elements( Position( 1, 1 ), Points( X, Y, Legend( 1 ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 2 ) ) ),
Elements( Position( 1, 3 ), Points( X, Y, Legend( 3 ) ) ),
Elements( Position( 1, 4 ), Points( X, Y, Legend( 4 ) ) )
이러한 코드 줄을 생성하는 JSL은 다음과 같습니다.
For Each({y_col, idx}, y_values,
Eval(EvalExpr(
Insert Into(gb_expr,
Name Expr(Elements(Position(1, Expr(idx)), Points(X, Y, Legend(Expr(idx)))))
)
));
);
각 Y 값을 반복하고 한 번에 하나씩 요소 줄을 만든 다음 이를 Graph Builder() JSL에 삽입합니다.
마지막으로,
Eval(gb_expr);
완성된 Graph Builder JSL을 실행합니다.
그렇다면 이제 무엇을 바꿔야 할까요?
기본적으로 원본 스크립트가 생성한 JSL과 새로운 수정 사항이 포함된 그래프 빌더에서 저장된 JSL 사이의 차이점을 살펴보면 원본 스크립트 출력에서 요소 구조는 다음과 같습니다.
Elements( Position( 1, 1 ), Points( X, Y, Legend( 1 ) ) )
저장된 코드의 요소 섹션에는 포인트와 상자 플롯 모두에 대한 섹션이 있습니다.
Elements(
Position( 1, 1 ),
Points( X, Y, Legend( 1 ), Jitter( "None" ) ),
Box Plot( X, Y, Legend( 5 ), Jitter( "None" ) )
)
따라서 변경해야 할 작업은 Elements 섹션을 생성하는 코드에 이 두 번째 섹션을 추가하는 것뿐입니다.
For Each( {y_col, idx}, y_values,
Eval(
Eval Expr(
Insert Into(
gb_expr,
Name Expr(
Elements(
Position( 1, Expr( idx ) ),
Points( X, Y, Legend( Expr( idx ) ), jitter( "None" ) ),
Box Plot( X, Y, Legend( Expr( N Items( y_values ) + idx ), jitter( "None" ) ) )
)
)
)
)
)
);
이 모든 것을 종합하면 새 스크립트는 다음과 같습니다.
Names Default To Here( 1 );
Clear Log();
dt = Open( "$sample_data\Semiconductor Capability.jmp" );
y_values = {"NPN1", "IVP1", "PNP4", "NPN4"};
variables_expr = Expr(
Variables( X( :lot_id ) )
);
For Each( {y_col}, y_values,
temp_expr = Expr( Y() );
Insert Into( temp_expr, Name Expr( As Column( dt, y_col ) ) );
Insert Into( variables_expr, Name Expr( temp_expr ) );
);
gb_expr = Expr(
Graph Builder( Show Control Panel( 0 ) )
);
Insert Into( gb_expr, Name Expr( variables_expr ) );
For Each( {y_col, idx}, y_values,
Eval(
Eval Expr(
Insert Into(
gb_expr,
Name Expr(
Elements(
Position( 1, Expr( idx ) ),
Points( X, Y, Legend( Expr( idx ) ), jitter( "None" ) ),
Box Plot( X, Y, Legend( Expr( N Items( y_values ) + idx ), jitter( "None" ) ) )
)
)
)
)
)
);
Show( Name Expr( gb_expr ) );
Eval( gb_expr );Re: Y 변수를 그래프 빌더에 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?@txnelson 감사해요.
나는 이것을 쉽게 생각하지 못했을 것입니다.
Box Plot( X, Y, Legend( Expr( N Items( y_values ) + idx ), jitter( "None" ) ) )
Points의 기본 마커를 "+" 또는 "사각형"으로 변경하려면 어떻게 해야 합니까? 이것은 트릭을 수행하지 않습니다
Points( X, Y, Legend( Expr( idx ) ), jitter( "None" ), marker ("square") )변경 채점자 각 Y 변수에 대해 sendToReport()를 통해 마커 변경을 지시해야 함을 대화식으로 보여줍니다. 모든 Y 변수에 대해 이 작업을 한 번에 수행하는 방법은 무엇입니까?
Re: Y 변수를 그래프 빌더에 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?어디서 하느냐에 따라, 어디서 무엇을 보느냐에 따라 달라집니다. 범례에서 수행하는 경우의 예는 다음과 같습니다.
범례에서 변경하면 다음과 같은 결과가 나타납니다.
{Legend Model(4, Properties(0, {Marker("Circle")}, Item ID("NPN4", 1)))}
따라서 Scripting Index에서 Legend Model을 검색하세요.

거기에서 스크립트를 가져와서 필요에 맞게 수정하되 최대한 단순하게 유지하고(두 번째 Y축 추가) 테스트해 보세요.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Size(528, 448),
Show Control Panel(0),
Variables(X(:sex), Y(:height), Y(:weight)),
Elements(Position(1, 1), Points(X, Y, Legend(3))),
Elements(Position(1, 2), Points(X, Y, Legend(1)))
);
server = gb << Get Legend Server;
item = server << Get Legend Item(1, 1);
item << Set Properties({Marker("Circle")});
한 플롯에서 마커를 변경했습니다. 그런 다음 질문합니다. 모든 플롯에서 어떻게 변경합니까? 그런 다음 스크립트를 더 자세히 살펴보면 몇 가지 색인이 제공되는 것 같습니다.
item = server << Get Legend Item(1, 1);
<< 스크립팅 인덱스에서 범례 항목 가져오기를 확인하고 해당 항목이 있기를 바랍니다. 다른 범례 관련 개체를 탐색하지 않으면 비슷한 방식으로 작동하기를 바랍니다(또는 서버에 메시지를 보내보세요. << get Lege Ctrl+Space 여기).
server << Get Legend Items;
{{LegendModelItem(Label("height"), Type("Marker"))},
{LegendModelItem(Label("weight"), Type("Marker"))}}
이제 범례 항목 목록이 생겼습니다. 해당 목록을 반복해서 살펴보고 무슨 일이 일어나는지 확인하세요.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Size(528, 448),
Show Control Panel(0),
Variables(X(:sex), Y(:height), Y(:weight)),
Elements(Position(1, 1), Points(X, Y, Legend(3))),
Elements(Position(1, 2), Points(X, Y, Legend(1)))
);
server = gb << Get Legend Server;
For Each({item}, server << Get Legend Items,
item << Set Properties({Marker("Circle")});
);
더 쉬운 옵션은 마커를 데이터 테이블의 행 상태로 설정하는 것입니다.
Re: Y 변수를 그래프 빌더에 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?@jthi 감사해요. 나중에 범례 서버에 대한 핸들을 얻은 다음 각 Y 변수에 대한 마커를 변경하는 대신 포인트가 먼저 플롯될 때 마커를 변경하는 방법이 있습니까?
Re: Y 변수를 그래프 빌더에 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?이후에 변경이 안되는 이유가 있나요?
SendToReport를 사용하고 스크립트의 다른 부분이 구축된 것과 유사한 아이디어로 Dispatch 부분 내에 Legend 모델을 구축할 수 있습니다.
Re: Y 변수를 그래프 빌더에 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?@jthi 물론 이후에는 상황이 바뀔 수 있습니다. 포인트가 표시되는 동안 마커를 변경하는 것이 나에게는 더 간단한 경로처럼 보였습니다.
Re: Y 변수를 그래프 빌더에 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?@jthi @txnelson 아래 기본 스크립트에서는 의도한 대로 작동하는 Eval() 아래에 로컬 데이터 필터()를 추가했습니다.
Eval( gb_expr <<LOCAL data="https://community.jmp.com/" filter=""></LOCAL>
하지만 마커를 업데이트하기 위한 스크립트를 추가하면 차트가 두 번 표시됩니다!
Eval(
server = gb_expr << Get Legend Server;
For Each( {item}, server << Get Legend Items, item << Set Properties( {Marker( "Circle" )} ) );
);<BR />
Names Default To Here( 1 );
Clear Log();
dt = Open( "$sample_data\Semiconductor Capability.jmp" );
y_values = {"NPN1", "IVP1", "PNP4", "NPN4"};
variables_expr = Expr(
Variables( X( :lot_id ) )
);
For Each( {y_col}, y_values,
temp_expr = Expr( Y() );
Insert Into( temp_expr, Name Expr( As Column( dt, y_col ) ) );
Insert Into( variables_expr, Name Expr( temp_expr ) );
);
gb_expr = Expr(
Graph Builder( Show Control Panel( 0 ) )
);
Insert Into( gb_expr, Name Expr( variables_expr ) );
For Each( {y_col, idx}, y_values,
Eval(
Eval Expr(
Insert Into(
gb_expr,
Name Expr(
Elements(
Position( 1, Expr( idx ) ),
Points( X, Y, Legend( Expr( idx ) ), jitter( "None" ) ),
Box Plot( X, Y, Legend( Expr( N Items( y_values ) + idx ), jitter( "None" ) ) )
)
)
)
)
)
);
//Show( Name Expr( gb_expr ) );
Eval( gb_expr <<LOCAL data="https://community.jmp.com/" filter=""></LOCAL>두 번째 차트에는 업데이트된 마커가 있습니다.
로컬 데이터 필터와 함께 업데이트된 마커를 사용하여 단일 차트를 그리는 방법은 무엇입니까?
도움을 요청하는 곳에 마커 변경을 위한 마지막 부분을 올바르게 배치할 수 없는 것 같습니다.
Re: Y 변수를 그래프 빌더에 목록으로 제공할 때 점에 상자 그림을 추가하는 방법은 무엇입니까?gb_expr을 두 번 실행하고 싶지는 않습니다. gb_expr에서 얻은 참조를 가져와 해당 메시지를 보내고 싶습니다.
gb = Eval( gb_expr );
gb << Local data Filter(...)
server = gb << get legend server;