안녕
그래프 내의 데이터 포인트를 특정 순서로 연결하려고 합니다(다이아몬드 플롯 생성 등). line을 사용하여 수동으로 연결하고 스크립트를 내보내면 (X,Y) 좌표의 line 함수를 사용하는 것을 볼 수 있습니다. 누구든지 저를 도와주세요
1. (X,Y)가 프레임 좌표라고 가정합니까?
2. 1.이 사실이라면 JSL을 사용하여 (X,Y)를 어떻게 찾을 수 있습니까? 더 구체적으로, 그래프의 각 데이터 포인트에 대해 프레임(X,Y)을 추출하는 방법에 대한 구문을 알아야 합니까?
JMP에서 데이터 포인트를 연결하는 효율적인 방법이 있나요?


감사합니다
귀하의 스크립트를 약간 조정했지만 주요 문제는 귀하의 코드가 Group1, Group2 및 Group3의 모든 조합을 가지고 있다고 가정하고 귀하가 제공한 데이터에는 그렇지 않기 때문에 프로그램이 분석할 데이터를 찾을 수 없다는 것입니다. .
names default to here(1);
dtt = Current Data Table();
Summarize( dtt, byGroup1 = by( :var1 ) );
Summarize( dtt, byGroup2 = by( :var2 ) );
Summarize( dtt, byGroup3 = by( :var3 ) );
For( ii = 1, ii < N Items( byGroup1 ), ii++,
For( jj = 1, jj < N Items( byGroup2 ), jj++,
For( kk = 1, kk < N Items( byGroup3 ), kk++,
dtt << select where( :var1 == byGroup1[ii] & :var2 == byGroup2[jj] & :var3 == byGroup3[kk] );
show(ii,jj,kk,bygroup1[ii],bygroup2[jj],bygroup3[kk]);
sel = dtt << get selected rows;
If( n rows(sel) > 0,
show("inside",ii,jj,kk);
dt = dtt << subset( selected rows(1), selected columns(0));
gb = dt << Graph Builder(
Size( 531, 456 ),
Show Control Panel( 0 ),
Variables( X( :x axis ), Y( :y axis ), Overlay( :legend ) ),
Elements( Points( X, Y, Legend( 5 ) ) ),
SendToReport(
Dispatch(
{},
"x axis",
ScaleBox,
{Format( "Best", 12 ), Min( 2.273568 ), Max( 3.00134902479339 ), Inc( 0.1 ), Minor Ticks( 0 )}
)
)
);
// Add a simple graphics script to connect the points
Report( gb )[FrameBox( 1 )] << add graphics script(
Summarize( dt, byGroup = by( :legend ) );
colorList = {"Blue", "Red", "Green"};
Fill Pattern( [0] );
For( i = 1, i <= N Items( byGroup ), i++,
Pen Color( colorList[i] );
theRows = dt << get rows where( :legend == byGroup[i] & :Label != "i" );
// Add the first value as the last value to complete the object
theRows = theRows |/ theRows[1];
xMatrix = :x axis[theRows];
yMatrix = :y axis[theRows];
Line( xMatrix, yMatrix );
);
););
)
)
);도움을 주셔서 정말 감사드립니다. 진심으로 감사드립니다. 질문이 하나 더 있는데 도와주시면 감사하겠습니다.
나는 많은 하위 집합(내가 보낸 테이블)으로 구성되고 세 개의 추가 열로 제어되는 큰 테이블을 가지고 있습니다. 나는 테이블의 하위 집합(각각 내가 보낸 것과 유사)을 만들고 세 개의 For 루프 내에 아래 코드를 적용하려고 했습니다. 어떻게 든 하위 집합 테이블 생성이 작동하지 않습니다.
dtt = Current Data Table();
Summarize( dtt, byGroup1 = by( :var1 ) );
Summarize( dtt, byGroup2 = by( :var2 ) );
Summarize( dtt, byGroup3 = by( :var3 ) );
For( ii = 1, ii < N Items( byGroup1 ), ii++,
For( jj = 1, jj < N Items( byGroup2 ), jj++,
For( kk = 1, kk < N Items( byGroup3 ), kk++,
dt = dtt << subset(
select where( :var1 == byGroup1[ii] & :var2 == byGroup2[jj] & :var3 == byGroup3[kk] )
);
gb = dt << Graph Builder(
Size( 531, 456 ),
Show Control Panel( 0 ),
Variables( X( :x axis ), Y( :y axis ), Overlay( :legend ) ),
Elements( Points( X, Y, Legend( 5 ) ) ),
SendToReport(
Dispatch(
{},
"x axis",
ScaleBox,
{Format( "Best", 12 ), Min( 2.273568 ), Max( 3.00134902479339 ), Inc( 0.1 ),
Minor Ticks( 0 )}
)
)
);
// Add a simple graphics script to connect the points
Report( gb )[FrameBox( 1 )] << add graphics script(
Summarize( dt, byGroup = by( :legend ) );
colorList = {"Blue", "Red", "Green"};
Fill Pattern( [0] );
For( i = 1, i <= N Items( byGroup ), i++,
Pen Color( colorList[i] );
theRows = dt << get rows where( :legend == byGroup[i] & :Label != "i" );
// Add the first value as the last value to complete the object
theRows = theRows |/ theRows[1];
xMatrix = :x axis[theRows];
yMatrix = :y axis[theRows];
Line( xMatrix, yMatrix );
);
);
);
);
);
| x축 |
y축 |
상표 |
전설 |
var1 |
var2 |
var3 |
| 2.385649 |
2.260832 |
ㅏ |
세트1 |
콘1 |
콘11 |
콘111 |
| 2.385782 |
2.261566 |
ㅏ |
세트2 |
콘1 |
콘11 |
콘111 |
| 2.418368 |
2.291898 |
ㅏ |
세트3 |
콘1 |
콘11 |
콘111 |
| 2.297858 |
2.445948 |
비 |
세트1 |
콘1 |
콘11 |
콘111 |
| 2.297908 |
2.446336 |
비 |
세트2 |
콘1 |
콘11 |
콘111 |
| 2.331846 |
2.475788 |
비 |
세트3 |
콘1 |
콘11 |
콘111 |
| 2.385649 |
2.649821 |
씨 |
세트1 |
콘1 |
콘11 |
콘111 |
| 2.385782 |
2.649944 |
씨 |
세트2 |
콘1 |
콘11 |
콘111 |
| 2.418368 |
2.674239 |
씨 |
세트3 |
콘1 |
콘11 |
콘111 |
| 2.587473 |
2.730171 |
디 |
세트1 |
콘1 |
콘11 |
콘111 |
| 2.587765 |
2.730239 |
디 |
세트2 |
콘1 |
콘11 |
콘111 |
| 2.618502 |
2.753243 |
디 |
세트3 |
콘1 |
콘11 |
콘111 |
| 2.817405 |
2.649821 |
이자형 |
세트1 |
콘1 |
콘11 |
콘111 |
| 2.817657 |
2.649944 |
이자형 |
세트2 |
콘1 |
콘11 |
콘111 |
| 2.839774 |
2.674239 |
이자형 |
세트3 |
콘1 |
콘11 |
콘111 |
| 2.905865 |
2.445948 |
에프 |
세트1 |
콘1 |
콘11 |
콘111 |
| 2.90615 |
2.446336 |
에프 |
세트2 |
콘1 |
콘11 |
콘111 |
| 2.925915 |
2.475788 |
에프 |
세트3 |
콘1 |
콘11 |
콘111 |
| 2.817405 |
2.260832 |
g |
세트1 |
콘1 |
콘11 |
콘111 |
| 2.817657 |
2.261566 |
g |
세트2 |
콘1 |
콘11 |
콘111 |
| 2.839774 |
2.291898 |
g |
세트3 |
콘1 |
콘11 |
콘111 |
| 2.587473 |
2.181713 |
시간 |
세트1 |
콘1 |
콘11 |
콘111 |
| 2.587765 |
2.182677 |
시간 |
세트2 |
콘1 |
콘11 |
콘111 |
| 2.618502 |
2.213788 |
시간 |
세트3 |
콘1 |
콘11 |
콘111 |
| 2.587473 |
2.445948 |
나 |
세트1 |
콘1 |
콘11 |
콘111 |
| 2.587765 |
2.446336 |
나 |
세트2 |
콘1 |
콘11 |
콘111 |
| 2.618502 |
2.475788 |
나 |
세트3 |
콘1 |
콘11 |
콘111 |
| 2.624214 |
2.486915 |
ㅏ |
세트1 |
콘2 |
콘22 |
콘222 |
| 2.62436 |
2.487723 |
ㅏ |
세트2 |
콘2 |
콘22 |
콘222 |
| 2.660205 |
2.521088 |
ㅏ |
세트3 |
콘2 |
콘22 |
콘222 |
| 2.527644 |
2.690543 |
비 |
세트1 |
콘2 |
콘22 |
콘222 |
| 2.527699 |
2.69097 |
비 |
세트2 |
콘2 |
콘22 |
콘222 |
| 2.565031 |
2.723367 |
비 |
세트3 |
콘2 |
콘22 |
콘222 |
| 2.624214 |
2.914803 |
씨 |
세트1 |
콘2 |
콘22 |
콘222 |
| 2.62436 |
2.914938 |
씨 |
세트2 |
콘2 |
콘22 |
콘222 |
| 2.660205 |
2.941663 |
씨 |
세트3 |
콘2 |
콘22 |
콘222 |
| 2.84622 |
3.003188 |
디 |
세트1 |
콘2 |
콘22 |
콘222 |
| 2.846542 |
3.003263 |
디 |
세트2 |
콘2 |
콘22 |
콘222 |
| 2.880352 |
3.028567 |
디 |
세트3 |
콘2 |
콘22 |
콘222 |
| 3.099146 |
2.914803 |
이자형 |
세트1 |
콘2 |
콘22 |
콘222 |
| 3.099423 |
2.914938 |
이자형 |
세트2 |
콘2 |
콘22 |
콘222 |
| 3.123751 |
2.941663 |
이자형 |
세트3 |
콘2 |
콘22 |
콘222 |
| 3.196452 |
2.690543 |
에프 |
세트1 |
콘2 |
콘22 |
콘222 |
| 3.196765 |
2.69097 |
에프 |
세트2 |
콘2 |
콘22 |
콘222 |
| 3.218507 |
2.723367 |
에프 |
세트3 |
콘2 |
콘22 |
콘222 |
| 3.099146 |
2.486915 |
g |
세트1 |
콘2 |
콘22 |
콘222 |
| 3.099423 |
2.487723 |
g |
세트2 |
콘2 |
콘22 |
콘222 |
| 3.123751 |
2.521088 |
g |
세트3 |
콘2 |
콘22 |
콘222 |
| 2.84622 |
2.399884 |
시간 |
세트1 |
콘2 |
콘22 |
콘222 |
| 2.846542 |
2.400945 |
시간 |
세트2 |
콘2 |
콘22 |
콘222 |
| 2.880352 |
2.435167 |
시간 |
세트3 |
콘2 |
콘22 |
콘222 |
| 2.84622 |
2.690543 |
나 |
세트1 |
콘2 |
콘22 |
콘222 |
| 2.846542 |
2.69097 |
나 |
세트2 |
콘2 |
콘22 |
콘222 |
| 2.880352 |
2.723367 |
나 |
세트3 |
콘2 |
콘22 |
콘222 |
| 2.743496 |
2.599957 |
ㅏ |
세트1 |
콘3 |
con32 |
con33 |
| 2.743649 |
2.600801 |
ㅏ |
세트2 |
콘3 |
con32 |
con33 |
| 2.781123 |
2.635683 |
ㅏ |
세트3 |
콘3 |
con32 |
con33 |
| 2.642537 |
2.81284 |
비 |
세트1 |
콘3 |
con32 |
con33 |
| 2.642594 |
2.813286 |
비 |
세트2 |
콘3 |
con32 |
con33 |
| 2.681623 |
2.847156 |
비 |
세트3 |
콘3 |
con32 |
con33 |
| 2.743496 |
3.047294 |
씨 |
세트1 |
콘3 |
con32 |
con33 |
| 2.743649 |
3.047436 |
씨 |
세트2 |
콘3 |
con32 |
con33 |
| 2.781123 |
3.075375 |
씨 |
세트3 |
콘3 |
con32 |
con33 |
| 2.975594 |
3.139697 |
디 |
세트1 |
콘3 |
con32 |
con33 |
| 2.97593 |
3.139775 |
디 |
세트2 |
콘3 |
con32 |
con33 |
| 3.011277 |
3.166229 |
디 |
세트3 |
콘3 |
con32 |
con33 |
| 3.240016 |
3.047294 |
이자형 |
세트1 |
콘3 |
con32 |
con33 |
| 3.240306 |
3.047436 |
이자형 |
세트2 |
콘3 |
con32 |
con33 |
| 3.26574 |
3.075375 |
이자형 |
세트3 |
콘3 |
con32 |
con33 |
| 3.341745 |
2.81284 |
에프 |
세트1 |
콘3 |
con32 |
con33 |
| 3.342073 |
2.813286 |
에프 |
세트2 |
콘3 |
con32 |
con33 |
| 3.364802 |
2.847156 |
에프 |
세트3 |
콘3 |
con32 |
con33 |
| 3.240016 |
2.599957 |
g |
세트1 |
콘3 |
con32 |
con33 |
| 3.240306 |
2.600801 |
g |
세트2 |
콘3 |
con32 |
con33 |
| 3.26574 |
2.635683 |
g |
세트3 |
콘3 |
con32 |
con33 |
| 2.975594 |
2.50897 |
시간 |
세트1 |
콘3 |
con32 |
con33 |
| 2.97593 |
2.510079 |
시간 |
세트2 |
콘3 |
con32 |
con33 |
| 3.011277 |
2.545856 |
시간 |
세트3 |
콘3 |
con32 |
con33 |
| 2.975594 |
2.81284 |
나 |
세트1 |
콘3 |
con32 |
con33 |
| 2.97593 |
2.813286 |
나 |
세트2 |
콘3 |
con32 |
con33 |
| 3.011277 |
2.847156 |
나 |
세트3 |
콘3 |
con32 |
con33 |
Graph Builder 개체에 간단한 그래픽 스크립트를 추가하면 원하는 것을 얻을 수 있습니다.

names default to here(1);
// Create the data table
dt = New Table( "Example",
Add Rows( 27 ),
New Script(
"Source",
Data Table( "Untitled 60" ) << Split(
Split By( :Column 2 ),
Split( :Column 1 ),
Sort by Column Property
)
),
New Column( "x axis",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[2.3856, 2.3858, 2.4184, 2.2979, 2.2979, 2.3318, 2.3856, 2.3858, 2.4184,
2.5875, 2.5878, 2.6185, 2.8174, 2.8177, 2.8398, 2.9059, 2.9062, 2.9259,
2.8174, 2.8177, 2.8398, 2.5875, 2.5878, 2.6185, 2.5875, 2.5878, 2.6185]
)
),
New Column( "y axis",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[2.2608, 2.2616, 2.2919, 2.4459, 2.4463, 2.4758, 2.6498, 2.6499, 2.6742,
2.7302, 2.7302, 2.7532, 2.6498, 2.6499, 2.6742, 2.4459, 2.4463, 2.4758,
2.2608, 2.2616, 2.2919, 2.1817, 2.1827, 2.2138, 2.4459, 2.4463, 2.4758]
)
),
New Column( "label",
Character,
"Nominal",
Set Values(
{"a", "a", "a", "b", "b", "b", "c", "c", "c", "d", "d", "d", "e", "e",
"e", "f", "f", "f", "g", "g", "g", "h", "h", "h", "i", "i", "i"}
)
),
New Column( "legend",
Character,
"Nominal",
Set Values(
{"set1", "set2", "set3", "set1", "set2", "set3", "set1", "set2", "set3",
"set1", "set2", "set3", "set1", "set2", "set3", "set1", "set2", "set3",
"set1", "set2", "set3", "set1", "set2", "set3", "set1", "set2", "set3"}
)
)
);
// Draw the scatterplot
gb = dt << Graph Builder(
Size( 531, 456 ),
Show Control Panel( 0 ),
Variables( X( :x axis ), Y( :y axis ), Overlay( :legend ) ),
Elements( Points( X, Y, Legend( 5 ) ) ),
SendToReport(
Dispatch(
{},
"x axis",
ScaleBox,
{Format( "Best", 12 ), Min( 2.273568 ), Max( 3.00134902479339 ),
Inc( 0.1 ), Minor Ticks( 0 )}
)
)
);
// Add a simple graphics script to connect the points
Report( gb )[FrameBox( 1 )] << add graphics script(
Summarize( dt, byGroup = by( :legend ) );
colorList = {"Blue","Red","Green"};
fill pattern( [0] );
For( i = 1, i <= N Items( byGroup ), i++,
Pen Color(colorList[i]);
theRows = dt << get rows where( :legend == byGroup[i] & :Label != "i" );
// Add the first value as the last value to complete the object
theRows = theRows |/ theRows[1];
xMatrix = :x axis[theRows];
yMatrix = :y axis[theRows];
line( xMatrix, yMatrix );
);
);