格式化多个寿命分布图大家好,我正在尝试格式化轴刻度并将目标应用于 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)。当您在平台中使用 By 列时,您可以返回一个平台列表,然后可以循环遍历该列表(您也可以使用 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)
);
);

回复:格式化多个寿命分布图谢谢,我很感激。