如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?在下面的腳本產生的圖表中,我想將紅色箭頭(「分隔線」)指示的線條的顏色變更為紫色。 另外,我想僅為最低的 y 軸變數(在本例中為 PNP1)添加水平參考線。
如何透過 JSL 執行這些操作?
(請注意,在我的實際情況中,y 軸資料不是來自與本範例情況不同的欄位)
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
Graph Builder(
Size( 960, 695 ),
Variables(
X( :SITE ),
X( :lot_id, Position( 1 ) ),
X( :wafer, Position( 1 ) ),
Y( :NPN1 ),
Y( :NPN2 ),
Y( :PNP3 ),
Y( :PNP1 )
),
Elements( Position( 1, 1 ), Points( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 44 ) ) ),
Elements( Position( 1, 2 ), Points( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 43 ) ) ),
Elements( Position( 1, 3 ), Points( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 38 ) ) ),
Elements( Position( 1, 4 ), Points( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 40 ) ) ),
SendToReport(
Dispatch(
{},
"SITE",
ScaleBox,
{Label Row( 3, {Major Grid Line Color( 8 ), Show Major Grid( 1 )} )}
)
)
);
自動化和腳本編寫視窗回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?透過顏色連結垂直線和軸標籤是個好主意:)
不幸的是,線條太細,很難注意到該功能。
如果你也有同樣的感覺,請支持這個願望:
針對分層 X 類別的最佳化圖形設定 - 2 個選項

或者,您可以將該網站用作 X 群組 - 但很可能您會遇到同步 X 軸標籤的問題。
還有一個希望解決這個問題:
X組:將軸上的值限製到對應的組
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
dt << Graph Builder(
Size( 841, 485 ),
Show Control Panel( 0 ),
Show Title( 0 ),
Show X Axis Title( 0 ),
Variables(
X( :SITE ),
X( :lot_id, Position( 1 ) ),
X( :wafer, Position( 1 ) ),
Y( :NPN1 ),
Y( :NPN2 ),
Y( :PNP3 ),
Y( :PNP1 )
),
Elements( Position( 1, 1 ), Points( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 44 ) ) ),
Elements( Position( 1, 2 ), Points( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 43 ) ) ),
Elements( Position( 1, 3 ), Points( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 38 ) ) ),
Elements( Position( 1, 4 ), Points( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 40 ) ) ),
SendToReport(
Dispatch( {}, "SITE", ScaleBox,
{Label Row(
1,
{Lower Frame( 1 ), Row Title Side( "Start" ), Show Major Grid( 0 ),
Tick Mark Style( "Long Divider" )}
), Label Row(
2,
{Lower Frame( 1 ), Row Title Side( "Start" ), Show Major Grid( 0 ),
Tick Mark Style( "Long Divider" )}
), Label Row(
3,
{Line Color( "Purple" ), Lower Frame( 1 ), Major Grid Line Color( "Purple" ),
Row Title Side( "Start" ), Tick Mark Style( "Long Divider" )}
)}
),
Dispatch( {}, "PNP1", ScaleBox, {Add Ref Line( 300, "Solid", "Black", "", 5 )} ),
Dispatch( {}, "Graph Builder", FrameBox( 4 ), {Reference Line Order( 3 )} )
)
)
回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?你是什麼意思
@尼奧寫道:(請注意,在我的實際情況中,y 軸資料不是來自與本範例情況不同的欄位)
回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?@hogi
>> (請注意,在我的實際情況中,y 軸資料不是來自與本範例情況不同的欄位)
在我的實際情況中,y軸參數來自行參數的本地資料過濾器選擇
(如果它來自一個列,我可以在參考線的規格中設定一個限制(不是我嘗試過這個,但我希望它能工作))
讓我看看是否可以為演示準備一個資料集(我會回來的:))。
回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?你好@尼奧,
的程式碼@hogi發布將解決您在圖形生成器中獲取單個子圖的參考線的問題,但不幸的是,查看樹結構,我沒有找到一種方法來發送僅更改 x- 的一行的命令軸。 在樹狀結構中,整個 x 軸分組在單一 AxisBox(1) 元素中,它不會被分割和嵌套,即使它在圖形產生器中以這種方式顯示。 我在首選項中也找不到任何允許您修改嵌套軸線的內容。
您始終可以右鍵單擊您想要的軸,然後添加參考線,然後轉到圖形生成器旁邊的紅色熱按鈕並將腳本保存到腳本窗口,您可以看到腳本是如何被修改的添加行。
希望這可以幫助!,
DS
編輯:提交請求以更改嵌套軸的顏色可能是值得的。 這應該是可行的,我想很多人都可以從中受益。
回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?哪一行有問題?
目前,最低圖中只有一條水平線。
如果您必須隱藏部分參考線,您可以利用每個子圖都有自己的自訂設定這一事實,因此您可以添加一些矩形並將它們放在參考線前面。
【或者,您也可以直接使用自訂腳本來新增線段。】

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
dt << Graph Builder(
Show Control Panel( 0 ),
Show Title( 0 ),
Show X Axis Title( 0 ),
Variables(
X( :SITE ),
X( :lot_id, Position( 1 ) ),
X( :wafer, Position( 1 ) ),
Y( :NPN1 ),
Y( :NPN2 ),
Y( :PNP3 ),
Y( :PNP1 )
),
Elements( Position( 1, 1 ), Points( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 44 ) ) ),
Elements( Position( 1, 2 ), Points( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 43 ) ) ),
Elements( Position( 1, 3 ), Points( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 38 ) ) ),
Elements( Position( 1, 4 ), Points( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 40 ) ) ),
SendToReport(
Dispatch( {}, "SITE", ScaleBox,
{Add Ref Line( 714.422378299564, "Solid", "Red", "", 4 ),
Label Row(
1,
{Lower Frame( 1 ), Row Title Side( "Start" ), Show Major Grid( 0 ),
Tick Mark Style( "Long Divider" )}
), Label Row(
2,
{Lower Frame( 1 ), Row Title Side( "Start" ), Show Major Grid( 0 ),
Tick Mark Style( "Long Divider" )}
), Label Row(
3,
{Line Color( "Purple" ), Line Width( 3 ), Lower Frame( 1 ),
Major Grid Line Color( "Purple" ), Row Title Side( "Start" ),
Tick Mark Style( "Long Divider" )}
)}
),
Dispatch( {}, "PNP3", ScaleBox, {Add Ref Line( 135, "Solid", "Red", "", 3 )} ),
Dispatch( {}, "PNP1", ScaleBox, {Add Ref Line( 300, "Solid", "Black", "", 5 )} ),
Dispatch( {}, "400", ScaleBox,
{Legend Model( 38, Properties( 0, {Transparency( 0.5 )}, Item ID( "PNP3", 1 ) ) )}
),
Dispatch( {}, "Graph Builder", FrameBox,
{Grid Line Order( 2 ), Reference Line Order( 1 ),
Add Graphics Script(
2,
Description( "" ),
Fill Color( white );
Rect( -10000, 10000, 10000, -10000, 1 );
)}
),
Dispatch( {}, "Graph Builder", FrameBox( 2 ),
{Grid Line Order( 2 ), Reference Line Order( 1 ),
Add Graphics Script(
2,
Description( "" ),
Fill Color( white );
Rect( -10000, 10000, 10000, -10000, 1 );
)}
),
Dispatch( {}, "Graph Builder", FrameBox( 3 ),
{Grid Line Order( 2 ), Reference Line Order( 1 ),
Add Graphics Script(
2,
Description( "" ),
Fill Color( white );
Rect( 290, 10000, 10000, -10000, 1 );
)}
),
Dispatch( {}, "Graph Builder", FrameBox( 4 ), {Reference Line Order( 3 )} )
)
)
回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?@hogi @SDF1附件是一個與我的實際數據類似的煮熟的數據表(內部有繪圖腳本)。 我希望只有在本地資料過濾器中選擇測試階段 3 時才會出現參考線(下圖紅色)。
(參考線 y 位置是預先定義的)

回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?@SDF1

這會為所有子圖添加參考線,這不是我想要的。
回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?這是一個簡單的情況,由於 Y 組,圖形被分成不同的框架框。 然後您可以透過自訂新增單獨的參考線。

Graph Builder(
Y Group Edge( "Left" ),
Variables( X( :PartNumber ), Y( :Median ), Group Y( :TestStage ) ),
Elements( Points( X, Y, Legend( 33 ) ), Smoother( X, Y, Legend( 34 ) ) ),
SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox( 3 ),
{Add Graphics Script(
2,
Description( "" ),
Pen Color( "red" );
Pen Size( 3 );
Y Function( 0.4, x );
)}
)
)
)回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?你好@尼奧,
我會做@hogi建議並在右鍵單擊感興趣的圖形時使用“自訂”選項,按一下“+”將新腳本新增至 GB,然後輸入 JSL 以新增行。



現在,要動態響應本地數據過濾器,我認為會更具挑戰性。 如果您需要這種功能,我會產生自己的報告窗口,其中內建了圖形生成器,然後可能使用複選框為用戶提供在選擇不同 TestStage 複選框時使用參考線更新子圖的選項。
我確實也找到了一種改變嵌套線條顏色的方法。 我不知道這是否是“正確”的方法,或者即使它是最快的方法,但是如果您右鍵單擊嵌套軸然後選擇顯示屬性,如果您單擊嵌套軸然後單擊AxisBox 旁邊的紅色熱按鈕,選擇複製軸設置,然後可以將其貼上到腳本視窗中並進行編輯。 選擇感興趣的軸,然後將線條顏色從“無”變更為您想要的任何顏色。 然後,您必須複製此編輯過的程式碼,返回紅色熱按鈕,選擇貼上軸設置,它將更新圖形。 這將完成工作,但我不確定如何動態地完成這項工作。



將相應的腳本儲存到腳本視窗中,您可以看到發送圖形產生器和標籤行所需的命令,以獲得您想要的結果。
Graph Builder(
Size( 592, 526 ),
Y Group Edge( "Left" ),
Graph Spacing( 4 ),
Variables(
X( :TestStage ),
X( :TestParameter, Position( 1 ) ),
Y( :Median ),
Group Y( :TestStage )
),
Elements(
Points( X( 1 ), X( 2 ), Y, Legend( 33 ) ),
Smoother( X( 1 ), X( 2 ), Y, Legend( 34 ) )
),
Local Data Filter(
Conditional,
Add Filter( columns( :TestStage ), Where( :TestStage == {1, 2, 3} ) )
),
SendToReport(
Dispatch(
{},
"TestStage",
ScaleBox,
{Label Row( 2, Line Color( "Purple" ) )}
),
Dispatch(
{},
"Graph Builder",
FrameBox( 3 ),
{Add Graphics Script(
2,
Description( "" ),
Pen Color( "red" );
Pen Size( 3 );
Y Function( 0.3, x );
)}
)
)
);使用這些資訊並使用 Semiconductor Capability.jmp 檔案返回您的原始帖子,您可以實現您最初的要求,嵌套軸是紫色的,垂直網格線是紫色的,並且有一條參考線僅用於最底部的圖表。 在這種特殊情況下,雙擊要新增參考線的軸將會起作用,因為您正在圖形產生器的子圖中繪製不同的列。 對於您共用的範例資料表,您必須使用「自訂」以另一種方式進行操作,並新增 Y Function()。

下面是產生上圖的 JSL 程式碼。 您可以查看需要在哪裡針對您的具體情況進行適當的編輯。
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
dt<<GRAPH builder=""></GRAPH>
希望這可以幫助!,
DS
回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?您可以根據數值本身計算平均值:
Graph Builder(
Y Group Edge( "Left" ),
Variables( X( :PartNumber ), Y( :Median ), Group Y( :TestStage ) ),
Elements( Points( X, Y, Legend( 33 ) ), Smoother( X, Y, Legend( 34 ) ) )
);
myFB = Current Report()[FrameBox( 3 )];
myFB << Add Graphics Script(
2,
Description( "" ),
<STRONG> mySeg = myFB << Find Seg( Marker Seg( 1 ) );
value = Mean( mySeg << Get Y Values );</STRONG>
Pen Color( "red" );
Pen Size( 3 );
Y Function( value, x );
);
回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?@SDF1謝謝。 我將檢查您如何設法將嵌套軸的顏色變更為紫色。 同時我用了@hogi建議和 Make Filter Change Handler () 在使用者變更過濾器選擇時動態變更 JMP 放置參考線的位置。 我還沒有解決這兩個問題。
1. 第一次繪製圖表時,過濾器變更處理程序不會觸發,而是僅在選擇下一個 TestStage 時觸發。
2. 當更換過濾器時,較早的參考線仍保留在不同的測試階段,我明白原因,但還無法刪除。
Names Default To Here (1);
clear log ();
gb = Graph Builder(
Y Group Edge( "Left" ),
Variables( X( :PartNumber ), Y( :Median ), Group Y( :TestStage ) ),
Elements( Points( X, Y, Legend( 33 ) ), Smoother( X, Y, Legend( 34 ) ) ),
Local Data Filter(
Conditional,
Add Filter( columns( :TestStage ), Where( :TestStage == {1} ) )
)
);
ldf = Current Report()["Local Data Filter"] << get scriptable object;
getTestStage = Function( {this}, //print (this);
testStateFiltered = Associative Array(:TestStage [ldf << get filtered rows]) << get keys;
gb << SendToReport(
Dispatch({},"Graph Builder",
FrameBox(N Items (testStateFiltered)), {Add Graphics Script( 2, Description( "" ), Pen Color( "red" ); Line Style ("dashed"); Pen Size( 0.25 );
Y Function( 0.2, x );
)}
)
);
show (N Items (testStateFiltered)); Print(testStateFiltered);
);
rs = ldf << Make Filter Change Handler( getTestStage() ); 回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?順便一提 - Jmp17 中有一個新功能:
根據統計值新增動態參考線
Graph Builder(
Y Group Edge( "Left" ),
Summary Statistic( "Median" ),
Variables( X( :PartNumber ), Y( :Median ), Group Y( :TestStage ) ),
Elements(
Points( X, Y, Legend( 33 ) ),
Smoother( X, Y, Legend( 34 ) ),
Caption Box(
X,
Y,
<STRONG> Summary Statistic( "Median" ),
Location( "Axis Reference Line" )</STRONG>
)
),
Local Data Filter(
Conditional,
Add Filter( columns( :TestStage ), Where( :TestStage == 1 ) )
)
)
回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?你好@尼奧,
這是一個非常酷的想法@hogi關於使用過濾器更改處理程序。 我沒想到這一點。 我修改了您的上述程式碼來解決您遇到的兩個問題。 該腳本現在將使用參考線建立第一個圖表,然後相應地更新每個圖表,即使選擇多個資料過濾器也是如此。 這能解決問題嗎?
Names Default To Here( 1 );
dt = Current Data Table();
//this creates a string list of the column names
ColNamesList = dt << Get Column Names( "string" );
//This tests if the there exist a :Mean Column. If not, it runs a summary to generate this data, updates the main table with the means and then deletes a column and closes out the summary table.
If( Contains( ColNamesList, "Mean" ) == 0,
dtMeans = dt << Summary(
Group( :TestParameter ),
Mean( :Median ),
Freq( "None" ),
Weight( "None" ),
statistics column name format( "stat" ),
Link to original data table( 0 ),
output table name( "MeanStats" )
);
dt << Update( With( dtMeans ), Match Columns( :TestParameter = :TestParameter ) );
dt << Delete Columns( :N Rows );
Close( dtMeans, NoSave );
);
//this makes the original graph with the reference line of the first row in column :Mean
gb = dt << Graph Builder(
Y Group Edge( "Left" ),
Variables( X( :PartNumber ), Y( :Median ), Group Y( :TestStage ) ),
Elements( Points( X, Y, Legend( 33 ) ), Smoother( X, Y, Legend( 34 ) ) ),
Dispatch(
{},
"Graph Builder",
FrameBox( N Items( testStateFiltered ) ),
{Add Graphics Script(
2,
Description( "" ),
Pen Color( "red" );
Line Style( "dashed" );
Pen Size( 0.25 );
Y Function( Eval( :Mean[1] ), x );
)}
),
Local Data Filter( Conditional, Add Filter( columns( :TestStage ), Where( :TestStage == 1 ) ) )//no {} around the 1 here.
);
ldf = Current Report()["Local Data Filter"] << get scriptable object;
getTestStage = Function( {this}, //print (this);
testStateFiltered = Associative Array( :TestStage[ldf << get filtered rows] ) << get keys;
//this finds which row to grab the mean from
mrows = dt << Get Rows where( :TestStage == testStateFiltered[1] );
//this defines the mean to Eval() in the Y Function()
gbmean = :Mean[mrows[1]];
If( N Items( testStateFiltered ) == 1, //only does this if only one data filter is selected
gbreport = gb << Report; //makes a report reference for the graph builder
fb = gbreport[GraphBuilderComponentBox( 17 )];//accesses the frame to remove the script from
fb << Remove Graphics Script( 1 );//removes most recent script from the frame
);
gb << SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox( N Items( testStateFiltered ) ),
{Add Graphics Script(
2,
Description( "" ),
Pen Color( "red" );
Line Style( "dashed" );
Pen Size( 0.25 );
Y Function( Eval( GBMean ), x );
)}
)
);
Show( N Items( testStateFiltered ) );
Print( testStateFiltered );
);
rs = ldf << Make Filter Change Handler( getTestStage() );
希望這可以幫助!,
DS
回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?第一次,你可以運行取得測試階段(1)手動。
請注意,使用資料過濾器時,GraphBuilder 中有 1-3 個 FrameBox(大多數時候,只有 1 個?)。 因此,您要么確定要將訊息發送到哪個 FB,要么只選擇一個 TestStage 並始終將命令發送到 Framebox 1。
回覆:如何 (1) 更改 AxisBox 中的預設顏色和 (2) 在分組 Y 圖中僅在一個 Y 軸變數中新增參考線?@SDF1 @hogi
我分享的數據表就是一個快速拼湊起來的例子。 我應該提到,我不能使用 LSL/USL 或此表中的任何其他數字來產生參考線。
無論如何,以下內容對我有用。
- 呼喚getTestStage(1) 在 Make Filter Change Handler 呼叫之前。
- 在 getTestStage 函數內新增帶有適當句柄的RemoveGraphicsScript (N),其中 N 是從更改 TestStage 過濾器時產生的最後選定的 TestStage 框架框編號獲得的框架框編號。
我現在就解決這個問題。 然而,還存在一個問題。 如果選擇一個 TestStage,然後選擇第二個,然後第三個,一切都會按預期工作,但如果我從 3 個選擇返回到一個,我的腳本將無法按預期工作。
當我有機會時,我將發布具有代表性的數據集以及解釋問題的腳本。