The JSL code below attempts to use the add Element method to display a Contour plot on the graph on the right side. However, because add Element is an Add Element operation, it cannot remove or replace the original Points format on the right-side graph, resulting in the generated image being different from the figure below. The original Points remain along with the added Contour. Since the X-axis can only be appended afterwards, is there any way to remove the original Points format while still using add Element?
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = dt << Graph Builder(
Size( 488, 352 ),
Show Control Panel( 0 ),
Fit to Window( "Off" ),
Variables( Y( :weight ), Overlay( :age ) ),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 21 ) ), Points( X, Y, Legend( 23 ) ) ),
//Elements( Position( 2, 1 ), Contour( X, Y, Legend( 22 ) ) ),
);
gb << Add Variable( {:height, Role( "X" )} );
gb << Add Variable( {:Height, Role( "X" )} );
gb << Add Element( 1, 1, {Type( "Points" ), X, Y} );
gb << Add Element( 2, 1, {Type( "Contour" ), X, Y} );
