嗨 JMP 們,
我正在嘗試說服一位大客戶使用 JMP。現在,我很難在 JMP 中重現他們的應用程式之一。
我面臨的第一個問題是,我們希望在使用覆蓋選項時保留行狀態的顏色。
我們需要上面的圖表(包括藍色和紅色點)以及每個部分的兩點(Y 軸)之間的連接線。
我可以使用覆蓋層來取得連接線,但隨後我必須手動調整顏色。
同時,我們必須在圖表中新增多個規格上限和下限。
最後我們希望得到如下圖的結果:
我能夠使用多個手動步驟(例如複製和貼上框架內容)生成圖形,但目標是僅使用標準圖形生成器工俱生成此圖 - 特別是為了保持互動。
我很樂意提供任何建議。
謝謝,
賽巴斯蒂安
這將是給定的資料結構:
New Table( "Sample",
Add Rows( 20 ),
New Column( "Part ID",
Numeric,
"Nominal",
Format( "Best", 12 ),
Set Values( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] )
),
New Column( "X1",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] )
),
New Column( "X2",
Character,
"Nominal",
Set Values(
{"cold", "cold", "cold", "cold", "cold", "cold", "cold", "cold", "cold",
"cold", "medium", "medium", "medium", "medium", "medium", "medium",
"medium", "medium", "medium", "medium"}
)
),
New Column( "Y",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
If(
:X2 == "cold", Random Normal() + 10,
:X2 == "medium", Random Normal() + 12,
Random Normal()
)
)
),
New Column( "Y_USL",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16]
)
),
New Column( "Y_LSL",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] )
),
Set Row States(
[768, 768, 1280, 1280, 1280, 1280, 1280, 1280, 768, 768, 768, 768, 1280,
1280, 1280, 1280, 1280, 1280, 768, 768]
)
)
順便說一句:您到「JSL Syntax Highliger」的連結似乎已損壞。 至少我最終得到的是一個空白頁。
您幾乎無需編寫 JSL 腳本即可實現您想要的結果。 首先建立一個帶有範圍誤差線的長條圖。 然後將條形的透明度設為零,這樣它們就會消失。 現在透過按住 Shift 鍵並點擊來新增一組點。 將此 JSL 儲存到腳本視窗。
腳本編寫的唯一一點是使用 Col Maximum()/列最小值()在參考線上繪製的函數。

Graph Builder(
Size( 663, 468 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :Y ), Y( :Part ID ) ),
Elements(
Bar( X, Y, Legend( 16 ), Error Bars( "Range" ) ),
Points( X, Y, Legend( 14 ), Jitter( 0 ) )
),
SendToReport(
Dispatch(
{},
"Y",
ScaleBox,
{Format( "Best", 12 ), Min( 5.64697504725641 ), Max( 16.37329465957 ),
Inc( 2 ), Minor Ticks( 1 ),
Add Ref Line( Col Minimum(:Y_LSL), "Dashed", "Red", "", 2 ),
Add Ref Line( Col Maximum(:Y_USL), "Dashed", "Red", "", 2 ),
Add Ref Line( Col Maximum(:Y_LSL), "Solid", "Blue", "", 2 ),
Add Ref Line( Col Minimum(:Y_USL), "Solid", "Blue", "", 2 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
16,
Properties( 0, {Fill Color( 2 ), Transparency( 0 )} )
)}
),
Dispatch( {}, "Graph Builder", FrameBox, {Marker Size( 4 )} )
)
);這是一個腳本,可建立您想要的輸出圖。 我添加了一個範例資料表,就像您一樣,但添加了一個內容。 讓圖形產生器使用與行狀態顏色相同的顏色的技巧實際上是將 Part_ID 的值顏色設定為您想要的顏色。 然後圖形產生器將這些顏色用於疊加。 圖形生成器程式碼中也新增了軸參考線。 現在,我提供的程式碼是靜態程式碼,但 JSL 可以透過讀取資料表並找出所需的參考線來輕鬆產生您需要的平台程式碼,然後根據需要修改 Graph Builder 程式碼。 最後,我手動修改了實際的線條顏色,然後儲存了整個圖形產生器腳本。 從你的問題來看,我假設你想看看如何獲得你想要的結果。 這就是我的回應。 從通用資料表建立圖表不包含在我的回覆中,但它當然可以編寫腳本。
Names Default to Here( 1 );
New Table( "Sample",
Add Rows( 20 ),
New Column( "Part ID",
Numeric,
"Nominal",
Format( "Best", 12 ),
Set Property( "Value Colors", {1 = 3, 2 = 3, 3 = 5, 4 = 5, 5 = 5, 6 = 5, 7 = 5, 8 = 5, 9 = 3, 10 = 3} ),
Set Values( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] )
),
New Column( "X1",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] )
),
New Column( "X2",
Character,
"Nominal",
Set Values(
{"cold", "cold", "cold", "cold", "cold", "cold", "cold", "cold", "cold", "cold", "medium", "medium", "medium",
"medium", "medium", "medium", "medium", "medium", "medium", "medium"}
)
),
New Column( "Y",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( If( :X2 == "cold", Random Normal() + 10, :X2 == "medium", Random Normal() + 12, Random Normal() ) )
),
New Column( "Y_USL",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16] )
),
New Column( "Y_LSL",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] )
),
Set Row States(
[768, 768, 1280, 1280, 1280, 1280, 1280, 1280, 768, 768, 768, 768, 1280, 1280, 1280, 1280, 1280, 1280, 768, 768]
)
);
Graph Builder(
Size( 509, 443 ),
Show Control Panel( 0 ),
Variables( X( :Y ), Y( :Part ID ), Overlay( :Part ID ) ),
Elements( Line( X, Y, Legend( 4 ), Row order( 1 ) ), Points( X, Y, Legend( 6 ), Jitter( 0 ) ) ),
SendToReport(
Dispatch(
{},
"Y",
ScaleBox,
{Min( 5.43667408790577 ), Max( 16.635593220339 ), Inc( 2 ), Minor Ticks( 0 ),
Add Ref Line( 16, "Dashed", "Red", "", 2 ), Add Ref Line( 15, "Solid", "Medium Dark Blue", "", 2 ),
Add Ref Line( 7, "Solid", "Medium Dark Blue", "", 2 ), Add Ref Line( 6, "Dashed", "Medium Dark Red", "", 2 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
4,
Properties( 0, {Line Color( 0 )} ),
Properties( 1, {Line Color( 0 )} ),
Properties( 2, {Line Color( 0 )} ),
Properties( 3, {Line Color( 0 )} ),
Properties( 4, {Line Color( 0 )} ),
Properties( 5, {Line Color( 0 )} ),
Properties( 6, {Line Color( 0 )} ),
Properties( 7, {Line Color( 0 )} ),
Properties( 8, {Line Color( 0 )} ),
Properties( 9, {Line Color( 0 )} )
), Legend Model(
6,
Properties( 0, {Marker( "FilledCircle" )} ),
Properties( 1, {Marker( "FilledCircle" )} ),
Properties( 2, {Marker( "FilledCircle" )} ),
Properties( 3, {Marker( "FilledCircle" )} ),
Properties( 4, {Marker( "FilledCircle" )} ),
Properties( 5, {Marker( "FilledCircle" )} ),
Properties( 6, {Marker( "FilledCircle" )} ),
Properties( 7, {Marker( "FilledCircle" )} ),
Properties( 8, {Marker( "FilledCircle" )} ),
Properties( 9, {Marker( "FilledCircle" )} )
)}
)
)
);
