Evidenziare determinati punti sul grafico di controlloCIAO,
Voglio evidenziare i punti dati <= i valori limite, il 98% in questo caso, ma qualcosa non sembra funzionare. Non sono sicuro di dove sto commettendo l'errore.

Ecco il mio codice 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] )
)
)
)
);
Automazione e scriptingRe: Evidenziare determinati punti sul grafico di controlloEcco un'opzione che potrebbe fare ciò che stai cercando
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: Evidenziare determinati punti sul grafico di controlloGrazie Jarmo!
Re: Evidenziare determinati punti sul grafico di controlloUn'altra buona opzione sarebbe quella di creare una nuova colonna nella tua tabella e aggiungere stati di riga basati su quella (puoi anche usarla come legenda di riga). Questo metodo non ti consente di modificare facilmente la dimensione del marcatore


Re: Evidenziare determinati punti sul grafico di controlloCiao @jthi ,
Per qualche motivo, evidenzia valori inferiori a 0,007. Tuttavia, la condizione per ottenere le righe è impostata su '>'. Qualcosa non va con xs e ys. Inoltre, non voglio colorare le righe perché si rifletterebbe in un altro grafico. Lo script grafico è la preferenza

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: Evidenziare determinati punti sul grafico di controlloDevi confrontare se corrispondono alle stesse righe. In caso contrario, potresti prima voler riordinare i tuoi dati , ottenere le righe di interesse, creare un grafico di controllo e quindi aggiungere i marcatori.
Re: Evidenziare determinati punti sul grafico di controllocome posso fare un confronto?
Re: Evidenziare determinati punti sul grafico di controlloPrendi i valori dalla tua tabella e confrontali con i valori di xs e ys (ci sono infinite possibilità di eseguire il confronto). Sembra che i tuoi dati abbiano anche un singolo valore duplicato che potrebbe potenzialmente causare problemi, forse dovresti eseguire il confronto su ys invece che sulla tabella dati?
r = Loc(ys > 0.007);