안녕하세요 JMP 팀,
JSL 스크립트를 사용하여 그래프 빌더 캡션 상자에 사용자 지정 텍스트를 동적으로 할당할 수 있습니까?
저는 Y축 스케일 텍스트 위치 지정(아래 참조)을 사용하여 동적으로 할당된 텍스트로 GB 플롯을 생성하는 JSL 스크립트를 생성해 왔습니다. 이것은 비교적 잘 작동했지만 여전히 배치에 몇 가지 문제가 있습니다. 따라서 Y축 스케일과 무관하게 항상 고정 위치에 유지되는 GB Caption Box를 사용할 수 있는지 알아보고자 합니다.
Names Default to Here (1);
dt = Current Data Table ();
CList = dt << Get Column Names (string);
gbe = Expr (dt << Graph Builder(
Size( 557, 503 ),
Variables(
X( :DURATION ),
Y( _YS_ ),
Overlay( :ARM ),
Interval( _ES_ )
),
Elements( Points( X, Y, Legend( 9 ) ), Line( X, Y, Legend( 11 ) ) ),
SendToReport(
Dispatch(
{},
_LABEL_,
ScaleBox,
{Add Ref Line( 0, "Dotted", "Black", "", 2 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
9,
Base( 0, 0, 0, Item ID( "CTRL", 1 ) ),
Base( 1, 0, 0, Item ID( "GROUP 1", 1 ) ),
Base( 2, 0, 0, Item ID( "GROUP 2", 1 ) ),
Base( 3, 0, 0, Item ID( "GROUP 3", 1 ) )
)}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Marker Size( 6 ), Add Graphics Script(
2,
Description( "Script" ),
Text Size( 12 );
Text Color (21); // ABBV-105
Text( Center Justified, {-0.25, _TP1_}, "105" );
Text( Center Justified, {4.0, _TP1_}, _TXT1_ );
Text( Center Justified, {12.0, _TP1_}, _TXT2_ );
Text color (19); // UPA
Text( Center Justified, {-0.25, _TP2_}, "494" );
Text( Center Justified, {4.0, _TP2_}, _TXT3_ );
Text( Center Justified, {12.0, _TP2_}, _TXT4_ );
Text color (24); // ABBV-599
Text( Center Justified, {-0.25, _TP3_}, "599" );
Text( Center Justified, {4.0, _TP3_}, _TXT5_ );
Text( Center Justified, {12.0, _TP3_}, _TXT6_ );
), Grid Line Order( 4 ), Reference Line Order( 5 )}
)
)
)
);
For (i = 5, i <= 188, i++, //188
YCOL = Column (dt, i);
ECOL = Column (dt, i+184);
PCOL = Column (dt, i+368);
LBL = CList [i];
YMax = Col Mean (YCOL) + (Col Std Dev (YCOL)/sqrt(Col Number(YCOL)));
YMin = Col Mean (YCOL) - (Col Std Dev (YCOL)/sqrt(Col Number(YCOL)));
YRANGE = abs (YMax - Y Min);
If (YRANGE < 1.5,
YMax = YMax + 0.9;
YMin = YMin - 0.4
);
TOPY1 = YMax*0.90;
TOPY2 = YMax*0.75;
TOPY3 = YMax*0.60;
PVAL1 = "p VAL " || CHAR(Format(PCOL[5], "PValue"));
PVAL2 = "p VAL " || CHAR(Format(PCOL[6], "PValue"));
PVAL3 = "p VAL " || CHAR(Format(PCOL[8], "PValue"));
PVAL4 = "p VAL " || CHAR(Format(PCOL[9], "PValue"));
PVAL5 = "p VAL " || CHAR(Format(PCOL[11], "PValue"));
PVAL6 = "p VAL " || CHAR(Format(PCOL[12], "PValue"));
gbx = Substitute (Name Expr (gbe), Expr (_YS_), YCOL,
Expr (_ES_), ECOL,
Expr (_LABEL_), LBL,
Expr (_TP1_), TOPY1,
Expr (_TP2_), TOPY2,
Expr (_TP3_), TOPY3,
Expr (_TXT1_), PVAL1,
Expr (_TXT2_), PVAL2,
Expr (_TXT3_), PVAL3,
Expr (_TXT4_), PVAL4,
Expr (_TXT5_), PVAL5,
Expr (_TXT6_), PVAL6
);
gb = Eval (gbx);
Yaxis = report (gb)[Axis Box (2)];
LocYMin = Yaxis << Get Min;
LocYMax = Yaxis << Get Max;
LocRange = LocYMax - LocYMin;
mytitle = LBL;
report (gb) [OutlineBox (1)] << Set Title (mytitle);
if(abs (LocRange) < 1.5,
Yaxis << Max (LocYMax + 1.0);
Yaxis << Min (LocYMin - 0.6);
Yaxis << Inc (0.2),.);
gb << Journal;
gb << close window;
); 감사,
TS
적합선 및 관련 정보를 지정하기 위해 설정된 인수와 함께 << 요소 메시지를 사용하십시오. 이 예를 참조하십시오.
Names Default to Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = dt << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :height ), Y( :weight ) )
);
gb << Elements(
Points( X, Y, Legend( 3 ) ),
Line Of Fit(
X,
Y,
Legend( 5 ),
Root Mean Square Error( 1 ),
R²( 1 ),
Equation( 1 ),
F Test( 1 )
)
);