El código JSL a continuación intenta usar el método "Añadir Elemento" para mostrar un gráfico de contorno en el gráfico del lado derecho. Sin embargo, dado que "Añadir Elemento" es una operación, no puede eliminar ni reemplazar el formato original de puntos en el gráfico del lado derecho, lo que resulta en una imagen generada diferente a la de la figura inferior. Los puntos originales se conservan junto con el contorno añadido. Dado que el eje X solo se puede añadir posteriormente, ¿hay alguna forma de eliminar el formato original de puntos sin dejar de usar "Añadir Elemento"?
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} );

Puedes eliminar el elemento de punto
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 << Remove Element(2, 1, 1);
gb << Remove Element(2, 1, 1);
gb << Add Element(2, 1, {Type("Contour"), X, Y});
o podrías construir la expresión del generador de gráficos para tener esto en cuenta
1. Ya has agregado puntos a tu gráfico aunque no tengas eje x -> es posible que termines con más gráficos de puntos de los que crees.
Ejecutar el script del generador de gráficos -> copiar el script
Graph Builder(
Size(488, 352),
Show Control Panel(0),
Fit to Window("Off"),
Variables(Y(:weight), Overlay(:age)),
Elements(Points(Y, Legend(21)), Points(Y, Legend(23)))
);
Ejecutar << Agregar variable -> Copiar script
Graph Builder(
Size(488, 352),
Show Control Panel(0),
Fit to Window("Off"),
Variables(X(:height), Y(:weight), Overlay(:age)),
Elements(Points(X, Y, Legend(21)), Points(X, Y, Legend(23)))
);
Ejecutar << Agregar variable -> Copiar script
Graph Builder(
Size(488, 352),
Show Control Panel(0),
Fit to Window("Off"),
Variables(X(:height), X(:height), Y(:weight), Overlay(:age)),
Elements(Position(1, 1), Points(X, Y, Legend(21)), Points(X, Y, Legend(23))),
Elements(Position(2, 1), Points(X, Y, Legend(24)), Points(X, Y, Legend(25)))
);
</CODE>Run << Remove Element -> copy script</P>
<BR />
<BR />
<PRE><CODE class=" language-jsl">Graph Builder(
Size(488, 352),
Show Control Panel(0),
Fit to Window("Off"),
Variables(X(:height), X(:height), Y(:weight), Overlay(:age)),
Elements(Position(1, 1), Points(X, Y, Legend(21)), Points(X, Y, Legend(23))),
Elements(Position(2, 1), Points(X, Y, Legend(25)))
);
Ejecutar << Eliminar elemento -> copiar script
Graph Builder(
Size(488, 352),
Show Control Panel(0),
Fit to Window("Off"),
Variables(X(:height), X(:height), Y(:weight), Overlay(:age)),
Elements(Position(1, 1), Points(X, Y, Legend(21)), Points(X, Y, Legend(23))),
Elements(Position(2, 1))
);
etcétera.
Puede tener muchas más posibilidades de éxito si utiliza un generador de gráficos lo más completo posible.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Size(488, 393),
Show Control Panel(0),
Fit to Window("Off"),
Variables(X(:height), Y(:weight), Overlay(:age)),
Elements(Points(X, Y, Legend(2)))
);
gb << Add Variable({:Height, Role("X"), Position(2)});
gb << Remove Element(2, 1, 1);
gb << Add Element(2, 1, {Type("Contour"), X, Y});
2. Puede ajustar el eje x con un script (los ejes son diferentes ya que el gráfico de contorno necesita más espacio que los puntos)
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 << Remove Element(2, 1, 1);
gb << Remove Element(2, 1, 1);
gb << Add Element(2, 1, {Type("Contour"), X, Y});
min2 = Report(gb)[AxisBox(3)] << get min;
max2 = Report(gb)[AxisBox(3)] << get max;
Report(gb)[AxisBox(1)] << Min(min2) << Max(max2);