I am a relatively new JMP and JSL user, and I'm trying to produce a report with multiple graphs. I want to link the x-axis of both graphs together, so that when one x-axis is scaled or otherwise changed (reference line added, etc.), the other axis changes as well.
Some of the built-in platforms already do this, such as the Control Chart, which links the x-axis for the "Individual Measurement" and "Moving Range" graphs.
Names Default To Here( 1 ); dt = Open( "$SAMPLE_DATA/Big Class.jmp" ); dt << Control Chart( Chart Col( Height, "Individual Measurement", "Moving Range" ), K Sigma( 3 ) );
How can I reproduce this for my own reports/custom platforms/etc.? I haven't been able to figure out how the Control Chart report is accomplishing this, despite looking at the tree structure and the properties for the display boxes.
For example, how could I link the two x-axis in the following report using JSL?
Names Default To Here( 1 ); dt = Open( "$SAMPLE_DATA/Big Class.jmp" ); dt << Distribution( Stack( 1 ), Continuous Distribution( Column( :height ), Horizontal Layout( 1 ), Vertical( 0 ), Count Axis( 1 ) ), By( :sex ) );
I am using JMP 13.2.
I think you might be able to use uniform scaling.
Names Default To Here( 1 ); dt = Open( "$SAMPLE_DATA/Blood Pressure.jmp" ); obj = Distribution( Column( :BP 8M, :BP 12M, :BP 6M, :BP 8W, :BP 12W ) ); obj << Uniform Scaling( 1 ); obj << Lock Scales( 1 ); obj << Stack( 1 );
Thanks for the response. This seems to set the scales to be the same initially, but if I grab one of the axes and change the scale, the other axes don't update, which is what I was trying to accomplish. I.e. I'm hoping to link them so that they are always in sync with each other, like with the Control Chart platform's report.
Any other ideas?
You can attach a script to the frame box() that can detect changes in the Axis Box() and then reset all of the axes to the new values from the Axis Box() that was reset.
See the Scripting Index for details.
I typically use in the Frame Box << Add Graphics Script a check on the X Origin, and X Range changing in the Axis Box().