Resaltar ciertos puntos en el gráfico de controlHola,
Quiero resaltar los puntos de datos que son menores que los valores límite, 98 % en este caso, pero algo no parece funcionar. No estoy seguro de dónde estoy cometiendo el error.

Aquí está mi código jsl:
Names Default To Here( 1 );
dt2 = Current Data Table();<BR />
dt2 << begin data update;
fairows = dt2 << get rows where( As Column( "1" ) <= 0.98 );
dt2 << end data update;<BR />
vc1 = dt2 << Control Chart Builder(
Size( 890, 273 ),
Show Two Shewhart Charts( 0 ),
Test Excluded Subgroups( 0 ),
Include Missing Categories( 0 ),
Show Excluded Region( 0 ),
Show Limit Summaries( 0 ),
Variables( Subgroup( :Date ), Y( :"1"n ) ),
Chart(
Points( Statistic( "Individual" ) ),
Limits( Sigma( "Moving Range" ), Show Center Line( 0 ), Show Lower Limit( 0 ), Show Upper Limit( 0 ) )
),
Show Control Panel( 0 ),
SendToReport(
Dispatch( {}, "Control Chart Builder", OutlineBox, {Set Title( "1" )} ),
Dispatch( {}, "Date", ScaleBox, {Label Row( {Label Orientation( "Angled" ), Set Font Size( 8 )} )} ),
Dispatch(
{},
"1",
ScaleBox,
{Add Ref Line( 0.928901607373389, "Dotted", "Medium Light Magenta", "Suggested (92.89%)", 3 ),
Add Ref Line( 0.897380548253792, "Solid", "Orange", "4.5 sigma(89.74%)", 2 ), Add Ref Line(
0.865859489134196, "Solid", "Medium Dark Green", "6 sigma(86.59%)", 2
), Add Ref Line( 0.9, "Dense Dash", "Medium Dark Red", "90.00%", 3 )}
),
Dispatch( {}, "graph display 1 title", TextEditBox, {Set Text( "" )} ),
Dispatch( {}, "Subgroup display 1 title", TextEditBox, {Set Text( "" ), Set Font Size( 10 ), Set Font Style( "Bold" )} ),
Dispatch( {}, "Y display 1 title", TextEditBox, {Set Text( "" )} ),
Dispatch( {}, "Control Chart Builder", FrameBox, {Background Color( -15658734 ), Marker Size( 2 ), Marker Drawing Mode( "Outlined" )} )
)
);
//Highlight data points < 98%
Eval(
Eval Expr(
Report( vc1 )[Framebox( 1 )] << add graphics script(
Marker(
Marker Size( 10 );
Color State( "red" );,
Expr( :"1"n[fairows] ),
Expr( :Date[fairows] )
)
)
)
);
Automatización y scriptingRe: Resaltar ciertos puntos en el gráfico de controlAquí hay una opción que podría hacer lo que estás buscando.
Names Default To Here(1);
dt = Open("$DOWNLOADS/data.jmp");
fairows = dt << get rows where(As Column("1") <= 0.98);
vc1 = dt << Control Chart Builder(
Size(890, 273),
Show Two Shewhart Charts(0),
Test Excluded Subgroups(0),
Include Missing Categories(0),
Show Excluded Region(0),
Show Limit Summaries(0),
Variables(Subgroup(:Date), Y(:"1"n)),
Chart(Points(Statistic("Individual")), Limits(Sigma("Moving Range"), Show Center Line(0), Show Lower Limit(0), Show Upper Limit(0))),
Show Control Panel(0),
SendToReport(
Dispatch({}, "Control Chart Builder", OutlineBox, {Set Title("1")}),
Dispatch({}, "Date", ScaleBox, {Label Row({Label Orientation("Angled"), Set Font Size(8)})}),
Dispatch({}, "1", ScaleBox,
{Add Ref Line(0.928901607373389, "Dotted", "Medium Light Magenta", "Suggested (92.89%)", 3),
Add Ref Line(0.897380548253792, "Solid", "Orange", "4.5 sigma(89.74%)", 2), Add Ref Line(
0.865859489134196, "Solid", "Medium Dark Green", "6 sigma(86.59%)", 2
), Add Ref Line(0.9, "Dense Dash", "Medium Dark Red", "90.00%", 3)}
),
Dispatch({}, "graph display 1 title", TextEditBox, {Set Text("")}),
Dispatch({}, "Subgroup display 1 title", TextEditBox, {Set Text(""), Set Font Size(10), Set Font Style("Bold")}),
Dispatch({}, "Y display 1 title", TextEditBox, {Set Text("")}),
Dispatch({}, "Control Chart Builder", FrameBox, {Background Color(-15658734), Marker Size(2), Marker Drawing Mode("Outlined")})
)
);
ms = Report(vc1)[FrameBox(1)] << Find Seg(MarkerSeg(1));
xs = ms << Get X Values;
ys = ms << Get Y Values;
Eval(Eval Expr(
Report(vc1)[Framebox(1)] << add graphics script(
Marker Size(10);
Marker(
Color State("red"),
Expr(xs[fairows]),
Expr(ys[fairows])
)
);
));Re: Resaltar ciertos puntos en el gráfico de control¡Gracias Jarmo!
Re: Resaltar ciertos puntos en el gráfico de controlOtra buena opción sería crear una nueva columna en su tabla y agregar estados de fila en función de ella (también puede usarla como leyenda de fila). Sin embargo, este método no le permite modificar el tamaño del marcador tan fácilmente.


Re: Resaltar ciertos puntos en el gráfico de controlHola @jthi ,
Por alguna razón, resalta los valores menores a 0,007. Sin embargo, la condición para obtener filas está establecida en ">". Algo no está bien con xs e ys. Además, no quiero colorear las filas porque se reflejará en otro gráfico. La secuencia de comandos gráfica es la preferencia

Names Default To Here( 1 );
dt = Current Data Table();
fairows = dt << get rows where( As Column( "861" ) > 0.007 );
vc1 = dt << Control Chart Builder(
Size( 890, 273 ),
Show Two Shewhart Charts( 0 ),
Test Excluded Subgroups( 0 ),
Include Missing Categories( 0 ),
Show Excluded Region( 0 ),
Show Limit Summaries( 0 ),
Variables( Subgroup( :Date ), Y( :"861"n ) ),
Chart( Points( Statistic( "Average" ) ), Limits( Sigma( "Moving Range" ), Show Center Line( 0 ), Show Lower Limit( 0 ), Show Upper Limit( 0 ) ) ),
Show Control Panel( 0 ),
SendToReport(
Dispatch(
{},
"Control Chart Builder",
OutlineBox,
{Set Title( "861 Percent Fail: 1.45%" )}
),
Dispatch( {}, "Date", ScaleBox, {Label Row( {Label Orientation( "Angled" ), Set Font Size( 8 )} )} ),
Dispatch(
{},
"861",
ScaleBox,
{Add Ref Line( 0.00435435825878142, "Solid", "Blue", "3 sigma(0.44%)", 2 ), Add Ref Line(
0.00653153738817213, "Dotted", "Medium Light Magenta", "Suggested (0.65%)", 3
), Add Ref Line( 0.00870871651756283, "Solid", "Medium Dark Green", "6 sigma(0.87%)", 2 ), Add Ref Line(
0.007, "Dense Dash", "Medium Dark Red", "0.70%", 3
)}
),
Dispatch( {}, "graph display 1 title", TextEditBox, {Set Text( "" )} ),
Dispatch( {}, "Subgroup display 1 title", TextEditBox, {Set Text( "" ), Set Font Size( 10 ), Set Font Style( "Bold" )} ),
Dispatch( {}, "Y display 1 title", TextEditBox, {Set Text( "" )} )
)
);
ms = Report( vc1 )[FrameBox( 1 )] << Find Seg( Marker Seg( 1 ) );
xs = ms << Get X Values;
ys = ms << Get Y Values;
Eval(
Eval Expr(
Report( vc1 )[Framebox( 1 )] << add graphics script(
Marker Size( 10 );
Marker( Color State( "red" ), Expr( xs[fairows] ), Expr( ys[fairows] ) );
)
)
);
Re: Resaltar ciertos puntos en el gráfico de controlDebes comparar si coinciden con las mismas filas. Si no es así, es posible que primero quieras reordenar los datos , obtener las filas de interés, crear un gráfico de control y luego agregar los marcadores.
Re: Resaltar ciertos puntos en el gráfico de control¿Cómo puedo comparar?
Re: Resaltar ciertos puntos en el gráfico de controlTome los valores de su tabla y compárelos con los valores de xs e ys (existe una cantidad ilimitada de formas de realizar la comparación). Parece que sus datos también tienen un único valor duplicado que podría causar problemas. ¿Quizás debería realizar la comparación en ys en lugar de en la tabla de datos?
r = Loc(ys > 0.007);