大家好,
我正在嘗試在二元圖上放置一個文本框。
文本框的內容是根據擬合從雙變量報告中提取的,因此當我首先構建雙變量時它還沒有準備好。
請讓我知道與此相關的語法。
下面是我正在使用的代碼的簡化版本。 我想在雙變量上添加數字“this_var”(最後)。
biv=Dt << Fit Y by X(
Robust Fit,
X( Eval( Column( Dt, "X" )[rows[i]] ) ),
Y( Eval( Column( Dt, "Y" )[rows[i]] ) ),
Fit Robust( {Line Color( {213, 72, 87} ), Line Style( "Dotted" )} ),
SendToReport(
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Frame Size( 799, 464 ), Marker Size( 12 ),
Marker Drawing Mode( "Outlined" ),
DispatchSeg( Line Seg( 1 ), {Line Style( "Dotted" )} ),
Row Legend(
:WAFER,
Color( 0 ),
Color Theme( "" ),
Marker( 1 ),
Marker Theme( "Standard" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
),
//--display Value column entry here from Dt ---
Add Text Annotation(
Text( "Value:" || char(Format(Eval( Column( Dt, "Value" )[rows[i]] ), "Scientific", 10))),
Text Box( {100, 10, 404, 200} )
)
}
)
),
)
/* get the report into a variable */
reportbiv = biv << Report;
this_var = Report( biv )[Outline Box( "Fit" )][NumberColBox(1)][2];
//----Need to add above variable in a text box in bivariate plot above這是一個更簡短的腳本,它說明了我認為您的問題的答案。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
Biv = Bivariate( Y( :weight ), X( :height ), Fit Robust( {Line Color( {213, 72, 87} )} ) );
this_var = (Report( biv )[Outline Box( "Robust Fit" )][Number Col Box( 1 )] << get)[1];
biv( report ) << Add Text Annotation( Text( Char( this_var ) ), Text Box( {65, 35, 200, 77} ) );
另一種選擇是使用“添加圖形文本”,這將為您提供更好的位置和功能
這兩個選項都記錄在腳本索引中
幫助==>腳本索引==>FrameBox