Reference Line Order not workingHello. I am using a table script to create a few bivariate plots. For each plot, I create some reference lines but then I use a Dispatch on the framebox to change the Reference Line Order to something higher so that the reference lines are drawn in front of the data. However, this does not seem to be changing anything. Here is a simple example of what I am trying to do. When I do this, the Reference Line Order does not change.
Am I missing something?
myWin = New Window( "plots",
H List Box(
Bivariate(
Y( :Name( "y1" ) ),
X( :Name( "x1" ) ),
SendToReport(
Dispatch(
{},
"1",
ScaleBox,
{Add Ref Line( 329, "Solid", "Black", "a line", 2 ),
Add Ref Line( 349, "Solid", "Blue", "b line", 2 )}
),
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Frame Size( 400, 300 ), Grid Line Order( 1 ), Reference Line Order( 5 )}
),
),
Bivariate(
Y( :Name( "y2" ) ),
X( :Name( "x2" ) ),
SendToReport(
Dispatch(
{},
"1",
ScaleBox,
{Add Ref Line( 329, "Solid", "Black", "a line", 2 ),
Add Ref Line( 349, "Solid", "Blue", "b line", 2 )}
),
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Frame Size( 400, 300 ), Grid Line Order( 1 ), Reference Line Order( 5 )}
),
)
)
)
)
)Re: Reference Line Order not workingActually as it turns out, if you do not specify hierarchy in the add graphics part of dispatch then it draws it on top. So that is what I did. I do want to mention that it seems that the background/foreground is ignored when using dispatch.
Re: Reference Line Order not workingMark's script draws the lines on top of all other reference line and grid lines and fitted line for me.
The only ordering for the framebox that I know of, other than scripting, is Grid Line Order and Reference Line Order.
Depending upon how and when you add items to the framebox, you might need to send an Inval then an Update Window message. It works for me. See below. You should mention what version of JMP you are using and MAC vs PC.
Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
biv = Bivariate( Y( :weight ), X( :height ), FitLine );
rbiv = biv << report;
axisbox = rbiv[axis box( 1 )];
axisbox << Add Ref Line( 108.3182, "Solid", blue, "M mean", 2 );
axisbox << Add Ref Line( 100.9444, "Solid", purple, "F mean", 2 );
rbiv[axis box( 1 )] << {Min( 60 ), Max( 180 ), Inc( 10 ), Minor Ticks( 1 ),
Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )};
rbiv[axis box( 2 )] << {Min( 50 ), Max( 72.5 ), Inc( 4 ), Minor Ticks( 1 ),
Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )};
biv_fb = rbiv[frame box( 1 )];
biv_fb << Reference Line Order( 1 );
biv_fb<<INVAL></INVAL>
Re: Reference Line Order not workingHmm. I added a graphics script with V Line at the two points and made it at a higher drawing level but it still did not bring those lines forward or draw them on top of everything. I am still using Send To Report despite the recommendation because I have lots more plots that I plan to include and this way the script is already written for me. But this does not seem to work.
Re: Reference Line Order not workingHere is one solution:
Names Default to Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "My Plots",
H List Box(
biv1 = dt << Bivariate( Y( :Weight ), X( :Height ) ),
biv2 = dt << Bivariate( Y( :Weight ), X( :Height ) )
)
);
{biv1_rep, biv2_rep} = {biv1, biv2} << Report;
{biv1_rep[FrameBox( 1 )], biv2_rep[FrameBox( 1 )]} << Frame Size( 400, 300 );
{biv1_rep[FrameBox( 1 )], biv2_rep[FrameBox( 1 )]} << Add Graphics Script(
H Line( 120 );
);Re: Reference Line Order not workingThe Axis Box is responsible for managing reference lines.The reference line order is relative to other reference lines, not the other graphics. I believe that the lines are drawn first (background visual context), along with any other scale customization, before the graphics scripts in the Frame Box (the actual visual information).
You could use H Line() or V Line() functions instead and then you have control over when they are drawn with respect to any other graphics elements. They are associated with the Frame Box, not the Axis Box.
We do not recommend using the Send to Report directive. It is better to send the message directly to the target object.