Hola,
Utilizo la función "por" para dibujar gráficos una sola vez.
¿Cómo podría usar un script para establecer una escala diferente?
Intenté usar "si" pero no funcionó.
Aquí está mi guión:
d_graph=dt3 << Graph Builder(
Size( 1200, 300 ),
Show Control Panel( 0 ),
Variables(
X( :Lot ),
X( :ReadPoint, Position( 1 ) ),
Y( :drift% ),
Group X( :Rel_Test ),
Color( :Lot )
),
Elements( Box Plot( X( 1 ), X( 2 ), Y, Legend( 1 ) ) ),
By( :Label ),
SendToReport(
If(:Label == "IGSS" | :Label == "IGSSR" | :Label == "IDSS",
(Dispatch(
{},
"drift%",
ScaleBox,
{Min( 0 ), Max( 20 ), Inc( 5 ), Minor Ticks( 1 ),
Add Ref Line( 10, "Solid", "Medium Dark Red", "1000%", 1 ),
Add Ref Line( 5, "Dotted", "Medium Dark Red", "500%", 1 )})),
(Dispatch(
{},
"drift%",
ScaleBox,
{Min( -0.25 ), Max( 0.25 ), Inc( 0.05 ), Minor Ticks( 1 ),
Add Ref Line( 1.2, "Solid", "Medium Dark Red", "20%", 1 ),
Add Ref Line( 0.8, "Solid", "Medium Dark Red", "-20%", 1 )})))
)
);Con Graph Builder es posible que desee utilizar Página en lugar de Por. Debe configurar todos los ejes por separado o utilizar soluciones de secuencias de comandos que pueden resultar un poco complicadas.
Con página
Graph Builder(
Size(525, 2954),
Show Control Panel(0),
Variables(X(:weight), Y(:height), Page(:age)),
Elements(Points(X, Y, Legend(12)), Smoother(X, Y, Legend(13))),
SendToReport(
Dispatch({}, "height", ScaleBox(2), {Min(49.55686), Max(71.1300045339471), Inc(5), Minor Ticks(1)}),
Dispatch({}, "height", ScaleBox(3), {Min(39.2571438997966), Max(67.3579268825169), Inc(5), Minor Ticks(1)}),
Dispatch({}, "height", ScaleBox(4), {Min(59.60392), Max(70.2079010526316), Inc(2), Minor Ticks(1)}),
Dispatch({}, "height", ScaleBox(5), {Min(60.2030935251799), Max(67.27), Inc(1), Minor Ticks(0)}),
Dispatch({}, "height", ScaleBox(6), {Min(58.60392), Max(69.3254618181818), Inc(2), Minor Ticks(1)}),
Dispatch({}, "height", ScaleBox(7), {Min(60.1377273502176), Max(70.192348647039), Inc(2), Minor Ticks(1)})
)
);
con por
Graph Builder(
SendToByGroup({:age == 12}),
Size(525, 454),
Show Control Panel(0),
Variables(X(:weight), Y(:height)),
Elements(Points(X, Y, Legend(1)), Smoother(X, Y, Legend(2))),
By(:age),
SendToByGroup({:age == 12}, SendToReport(Dispatch({}, "height", ScaleBox, {Min(46.2708484375), Max(64.6984984375), Inc(5), Minor Ticks(1)}))),
SendToByGroup({:age == 13}, SendToReport(Dispatch({}, "height", ScaleBox, {Min(54), Max(66.3534322916667), Inc(2), Minor Ticks(0)}))),
SendToByGroup({:age == 14}, SendToReport(Dispatch({}, "height", ScaleBox, {Min(58.1802560677083), Max(70.9932314583333), Inc(2), Minor Ticks(1)}))),
SendToByGroup({:age == 15}, SendToReport(Dispatch({}, "height", ScaleBox, {Min(61), Max(66.5205305091258), Inc(1), Minor Ticks(0)}))),
SendToByGroup({:age == 16}, SendToReport(Dispatch({}, "height", ScaleBox, {Min(57.1194704166667), Max(68.432), Inc(2), Minor Ticks(1)}))),
SendToByGroup({:age == 17}, SendToReport(Dispatch({}, "height", ScaleBox, {Min(59.0567933224374), Max(69.0987213244912), Inc(2), Minor Ticks(1)})))
);Aquí hay una solución de secuencias de comandos cuando se usa By. Dependiendo de dónde obtenga los valores de línea mínimo/máximo y de referencia, lo más probable es que los mueva fuera del bucle For Each.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gbs = dt << Graph Builder(
SendToByGroup({:age == 12}),
Size(525, 454),
Show Control Panel(0),
Variables(X(:weight), Y(:height)),
Elements(Points(X, Y, Legend(1)), Smoother(X, Y, Legend(2))),
By(:age)
);
For Each({gb}, gbs,
rep = Report(gb);
yaxis = rep[AxisBox(2)];
gbtitle = rep[Outline Box(1)] << Get title;
category = Word(-1, gbtitle, "=");
If(Contains({"12", "14", "15", "16"}, category),
minval = 50;
maxval = 70;
ref1 = 55;
ref2 = 65;
ref1title = "500%";
ref2title = "1000%";
, Contains({"13"}, category),
minval = 0;
maxval = 100;
ref1 = 5;
ref2 = 95;
ref1title = "-20%";
ref2title = "20%";
);
yaxis << Min(minval) << Max(maxval);
yaxis << Add Ref Line(ref1, "Solid", "Medium Dark Red", ref1title, 1);
yaxis << Add Ref Line(ref2, "Solid", "Medium Dark Red", ref2title, 1);
);Es posible que pueda adaptar el enfoque de @jthi utilizando XPath(). Envíe este mensaje a Graph Builder así:
xAxis = d_graph << XPath( "//AxisBox" );
xAxis[2::N Items(xAxis)::2] << Min( min ) << Max( max ) ...;
Debería obtener una lista de referencias a todos los cuadros de visualización de Axis. Quiere abordar los ejes X, los elementos pares de la lista. Puede utilizar la función Índice para subíndice la lista y enviar los mensajes de Axis a la lista en cascada. La lista distribuirá los mensajes a cada elemento por usted.