Choose Language Hide Translation Bar
Community Trekker

## adding text from outside bivariate

Hi all,

I am trying to position a text box on bivariate plot.

The contents of text boxt are extracted from the bivariate report based on fit, so its not ready when I am constructing the bivariate in the first place.

Please let me know the syntax regarding this.
Below is a simplified version of code I am using. I want to add number "this_var" (at end) on bivariate.

					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 ---
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
1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## Re: adding text from outside bivariate

Here is an even more abriviated script that illustrates the answer to what I believe your question was.

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} ) ); Another option would be to use "Add Graphic Text" which will give you better location and features Both of these options are documented int the Scripting Index Help==>Scripting Index==>FrameBox Jim 1 REPLY 1 Super User ## Re: adding text from outside bivariate Here is an even more abriviated script that illustrates the answer to what I believe your question was. 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} ) );

Another option would be to use "Add Graphic Text" which will give you better location and features

Both of these options are documented int the Scripting Index

Help==>Scripting Index==>FrameBox

Jim