設定多個生命分佈圖的格式大家好,我正在嘗試格式化軸刻度並將目標應用於 4 個壽命分佈圖,JMP 將其顯示為此程式碼的輸出。
myld 引用了具有 4 個生命分佈的視窗。
我試圖透過在標題中搜尋「視窗有生命分佈」來循環遍歷這 4 個生命分佈。
然後我想更改每個威布爾圖的 x 軸和 y 軸。
不知何故,程式碼只更改了第一個圖,其餘 3 個圖沒有更改,可能我無法正確抓住其餘圖的句柄。
有人可以幫助糾正此程式碼以實現我想要做的事情。
Better if the "Add Ref Line(2 " can be turned into a variable so I can supply 2 as an argument.
所以我可以為 for 迴圈內的所有 4 個圖添加不同的參考線。在運行循環之前,可以將這些值儲存在清單中。
謝謝
myld = Life Distribution(
Perspective( Compare Groups ),
Y( :Voltage ),
Grouping( :flavor ),
By( :A, :B, :C, :D),
Confidence Interval Method( Likelihood ),
Select Distribution( Distribution, Weibull ),
Select Scale( Weibull ),
Tabbed Report( 0 ),
Show Confidence Area( 0 )
);
report_windows = Get Window List( "myld" );//; << Get Window Title
report_of_interest = Empty();
For Each( {report_window}, report_windows,
outline_title = Try( report_window[Outline Box( 1 )] << get title, "" );
If( Starts With( outline_title, "Life Distribution" ),
print(outline_title);
report_of_interest = report_window;
ref = report_window[Outline Box( 1 )] << Get Scriptable Object;
xaxis = Report( ref )[axis box( 2 )];
xaxis << Axis Settings(
Format( "Precision", 6, 2 ),
Min( 1 ),
Max( 5 ),
Inc( 0.01 ),
Minor Ticks( 1 ),
Add Ref Line(2, "Dotted", "Black", "", 2 ),
Label Row( {Major Grid Line Color( "Light Yellow" ), Show Major Grid( 1 )} )
);
yaxis = Report( ref )[axis box( 1 )];
yaxis << Axis Settings(
Min( 0 ),
Max( 1 ),
Inc( 0.1 ),
Minor Ticks( 0 ),
Add Ref Line(0.5, "Dotted", "Black", "", 2 )
);
);
);自動化和腳本編寫基礎資料分析與建模可靠度分析回覆:格式化多個生命分佈圖 所有平台物件的列表?
有許多物件帶有輔助鍵“生命分佈” - 只需選擇最上面的一個。
從那裡開始就是第一個 FrameBox。
OBs = (Current Report() << xpath( "//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]" ))
For Each({OB}, OBs,
xaxis = OB[axis box( 2 )];
xaxis << Axis Settings(
Format( "Precision", 6, 2 ),
Min( 1 ),
Max( 5 ),
Inc( 0.01 ),
Minor Ticks( 1 ),
Add Ref Line(2, "Dotted", "Black", "", 2 ),
Label Row( {Major Grid Line Color( "Light Yellow" ), Show Major Grid( 1 )} )
);
yaxis = OB[axis box( 1 )];
yaxis << Axis Settings(
Min( 0 ),
Max( 1 ),
Inc( 0.1 ),
Minor Ticks( 0 ),
Add Ref Line(0.5, "Dotted", "Black", "", 2 )
);
);回覆:格式化多個生命分佈圖根據 JMP 版本,您有不同的選項(我假設使用 JMP18)。當您在平台中使用「按列」時,您可以獲得平台列表,然後可以循環遍歷該列表(您也可以使用 XPath 獲取該列表)。通常我會嘗試找到一些非常強大的 OutlineBox,然後用它來「綁定」索引。
這與您正在做的不完全相同,但應該給出一些關於可以做什麼的想法。
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Reliability/Fan.jmp");
dt << New Column("Group", Nominal, Numeric, Formula(Row() <= 35));
lds = dt << Life Distribution(Y(:Time), Censor(:Censor), By(:Group));
refs = Associative Array();
refs["0"] = 0.2;
refs["1"] = 0.4;
// show(lds);
For Each({ld}, lds,
rep = Report(ld);
grouptitle = rep << get title;
// show(rep << get title);
groupname = Word(-1, grouptitle, "=");
// Be careful with axis indices as there can be "hidden" axis
yaxis = rep[Outline Box("Compare Distributions"), AxisBox(1)];
xaxis = rep[Outline Box("Compare Distributions"), AxisBox(2)];
// Two methods shown here
xaxis << Min(1000) << Max(12000) << Inc(1000) << Format("Precision", 6, 2) << Minor Ticks(1) << Label Row(
{Major Grid Line Color("Light Yellow"), Show Major Grid(1)}
);
yaxis << Axis Settings(
Format("Precision", 6, 2),
Min(0),
Max(1),
Inc(0.1),
Minor Ticks(1),
Add Ref Line(refs[groupname], "Dotted", "Black", "", 2)
);
);

回覆:格式化多個生命分佈圖謝謝你,我很感激。