反白顯示控製圖上的某些點你好,
我想突出顯示數據點 <= 極限值,在本例中為 98%,但有些東西似乎不起作用。我不確定我在哪裡犯了錯。

這是我的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] )
)
)
)
);
自動化和腳本編寫回覆:突出顯示控製圖上的某些點這是一個可能滿足您需求的選項
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])
)
);
));回覆:突出顯示控製圖上的某些點謝謝賈莫!
回覆:突出顯示控製圖上的某些點其他不錯的選擇是在表中建立新列並基於該列新增行狀態(您也可以將其用作行圖例)。但此方法不允許您輕鬆修改標記大小


回覆:突出顯示控製圖上的某些點嗨@jthi ,
由於某種原因,它突出顯示小於 0.007 的值。但是,獲取行的條件設定為“>”。 xs 和 ys 有點不正確。另外,我不想對行進行著色,因為它會反映在另一個圖表中。圖形腳本是首選

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] ) );
)
)
);
回覆:突出顯示控製圖上的某些點您必須比較它們是否符合相同的行。如果沒有,您可能首先需要重新排序數據,獲取感興趣的行,建立控製圖,然後添加標記。
回覆:突出顯示控製圖上的某些點我該如何比較?
回覆:突出顯示控製圖上的某些點從表中取出值並將它們與 xs 和 ys 的值進行比較(執行比較的方法有無限種)。您的資料似乎也有單一重複值,這可能會導致問題,也許您應該在 ys 而不是資料表上執行比較?
r = Loc(ys > 0.007);