我剛開始使用 JMP 17(不確定這是否相關),但在某些情況下我無法更改生命分佈平台中線路的任何屬性。
我在資料表中附加了一個腳本來產生威布爾圖。 請注意,我最初更改腳本中的顏色以反映行狀態,這顯然是有效的。但一旦平台開放,我就無法再改變任何事。 在腳本中,我已經嘗試將線寬設為 3,但這也不起作用(這確實適用於 JMP16.2 中的此腳本)。

編輯:
下面的程式碼實現了我想要的功能,與 JMP16 相比,它不是很漂亮,但我想它可以工作。
dt = open ("$SAMPLE_DATA\reliability\blenders.jmp");
New Column( "By",
Character,
"Nominal",
Set Selected,
Set Values(
{"A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A",
"A", "A", "A", "B", "B", "B", "B", "B", "B", "B", "B", "B", "B", "B",
"B", "B", "B", "B", "B", "B", "B", "B", "A", "A", "A", "A", "A", "A",
"A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A",
"A", "A", "A", "A", "A", "A", "B", "B", "B", "B", "B", "B", "B", "B",
"B", "B", "B", "B", "B", "B", "B", "B", "B", "B", "B", "B", "B", "B",
"B", "B", "B", "B", "B", "B"}
)
);
ld = dt << Life Distribution(
Perspective( Compare Groups ),
Y( :Time Cycles ),
Grouping( :Group ),
Confidence Interval Method( Wald ),
Select Distribution( Distribution, Weibull ),
Select Scale( Weibull ),
Tabbed Report( 0 ),
By("By")
);
Summarize( uniqueGroups = by( "Group" ) );
numGroups = N Items( uniqueGroups );
Summarize( uniqueBy = by( "By" ) );
numPlatforms = N Items( uniqueBy );
For( i = 1, i < numPlatforms + 1, i++,
For( j = 1, j < numPlatforms + 1, j++,
ld[i] << SendToReport(Dispatch(
"Compare Distribution",
"11111",
ScaleBox,
{Legend Model(
11111,
Properties(
0,
{Line Color( 6 ), Line Style( "Dashed" ), Line Width( 6 )}, // <-- Change line properties
Item ID( Eval( "Group=" || uniqueGroups[j] ), 1 )
)
);
};
);
);
);
);您好,感謝您的建議,但您的程式碼中有硬編碼名稱(group=Automatic 在調度中)。 這些列值事先是未知的,因此就自動腳本而言,這是行不通的。
我們可以使用 box 路徑或 xpath 來消除命名依賴嗎? 當我將下面的程式碼放在您的腳本之後時,它不起作用(為了方便閱讀,我取出了您的一些調度)
dt = open ("$SAMPLE_DATA\reliability\blenders.jmp");
ld = dt << Life Distribution(
Perspective( Compare Groups ),
Y( :Time Cycles ),
Grouping( :Group ),
Confidence Interval Method( Wald ),
Select Distribution( Distribution, Weibull ),
Select Scale( Weibull ),
Tabbed Report( 0 ),
);
Report(ld)["Compare Distribution",AxisBox(2)]<<{Min(200)}; // Changing x-axis range works as expected
Report(ld)["Compare Distribution",LegendBox(1)] << {Line Width(3)}; // doesn't work, wrong syntax?
legendBoxes = Report( ld )["Life Distribution - Compare Groups - Time Cycles"]["Compare Distribution"] <<
Xpath( "//LegendBox" );
legendBoxes << {"Line Width",3}; // Also doesn't work
是的,可以透過腳本實現。 下面程式碼的第 33 行有一個範例。
dt = open ("$SAMPLE_DATA\reliability\blenders.jmp");
ld = dt << Life Distribution(
Perspective( Compare Groups ),
Y( :Time Cycles ),
Grouping( :Group ),
Confidence Interval Method( Wald ),
Select Distribution( Distribution, Weibull ),
Select Scale( Weibull ),
Tabbed Report( 0 ),
SendToEmbeddedScriptable(
Dispatch(
{"Individual Group", "Life Distribution Group=Automatic"},
{Y( :Time Cycles ), <<FIT weibull=""></FIT>您好,在 JMP 16 中我自動產生了這些圖表。 因此,右鍵單擊圖例並手動更改所有線寬不是一種選擇。
有沒有辦法將此線寬屬性傳送到 legendBox?
你是對的。 JMP17 中的行為已改變。 在 JMP17 中,圖例是可點選的,對應的圖形元素可以隱藏/顯示。 這可能導致自訂中發生意外的行為變化。
但目前,我建議使用圖例來客製化。 即右鍵單擊圖例,將顯示一個彈出式選單,讓您變更顏色、線條樣式、線條寬度。
當我在生命分佈平台中選擇「生命分佈」標籤時,我可以對圖表進行更改,但當我選擇生命分佈平台的「比較組」標籤時,我無法對圖表進行更改。 這也許可以解釋為什麼@馬克貝利和@mvanderaa得到不同的結果,因為馬克的範例使用“生命分佈”選項卡。 同樣,在 Fit Life by X 平台中,我無法更改線寬或顏色(不過我可以更改點的顏色)。 我想知道這是否是開發人員所期望的行為。
在常規分佈平台中可以有一個潛在的解決方法,您可以在其中擬合威布爾分佈,查看QQ 圖,然後單獨自訂圖,之後您可以從一個圖中複製框架內容並將其貼上到另一個圖中以取得它們兩者都疊加在一張圖表上。 下面的腳本準備好在您提供的數據表上進行複製/粘貼(我沒有包括複製/粘貼位,因為最終產品中的圖表看起來很混亂——太多了,以至於我幾乎沒有包括這個作為可能的解決方法)。
Distribution(
SendToByGroup( {:Side == "Bottom"} ),
Continuous Distribution(
Column( :Y ),
Histogram( 0 ),
Fit Weibull( QQ Plot( 1 ) )
),
Histograms Only,
By( :Side ),
SendToByGroup(
{:Side == "Bottom"},
SendToReport(
Dispatch(
{"Distributions Side=Bottom", "Y"},
"Compare Distributions",
OutlineBox,
{Close( 1 )}
)
)
),
SendToByGroup(
{:Side == "Top"},
SendToReport(
Dispatch(
{"Distributions Side=Top", "Y"},
"Compare Distributions",
OutlineBox,
{Close( 1 )}
),
Dispatch(
{"Distributions Side=Top", "Y", "Fitted Weibull Distribution",
"QQ Plot"},
"FitDistributions",
FrameBox,
{DispatchSeg( Line Seg( 1 ), {Line Color( "Green" )} ),
DispatchSeg( Line Seg( 2 ), {Line Color( "Green" )} )}
)
)
)
)
我以前從未執行過這些更改,但您可以使用 JMP 17 完成這些更改。 我手動自訂了估計行,然後儲存了腳本。 這裡是:
Names Default to Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
obj = dt << Life Distribution(
Y( :weight ),
<<FIT weibull=""></FIT>