动态地将分布图添加到表中我有一个包含大约 180 列数据的表。
我想通过 JSL 中的 for 循环为每列动态添加分布图(到表中)(使用特定于每列的本地数据过滤器)。
这可能吗? 在我的尝试中发生的情况是所有附加的图都是 for 循环的最后一个值。 可能我缺少一些简单的东西。
谢谢!
自动化和脚本编写回复:动态地将分布图添加到表中这是可能的。如果您可以附加脚本的清理版本,那么提供帮助会更容易、更快捷。
回复:动态地将分布图添加到表中我不确定你到底在寻找什么。这是一个简单的脚本,它使用本地数据过滤器创建所有分布。
Names Default To Here( 1 );
dt =
// Open Data Table: Blood Pressure.jmp
// → Data Table( "Blood Pressure" )
Open( "$SAMPLE_DATA/Blood Pressure.jmp" );
ColNames = dt << get column names( string, numeric );
nw = New Window( "Distributions",
H List Box(
For Each( {Col}, ColNames,
Eval(
Eval Expr(
Distribution(
Continuous Distribution( Column( Eval( col ) ) ),
Local Data Filter( Add Filter( columns( Eval( col )) ) )
)
)
)
)
)
);

回复:动态地将分布图添加到表中这是一个缩短的版本:
Clear Log();
Clear Globals();
dt = current data table ();
myTests = {:Name ("Cont_VDD"), :Name ("Cont_OUTP")};
for (i=1, i<= 2, i++,
dt << Add Properties to Table(
{New Script(
"Distribution",
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( myTests[i] ) ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Outlier Box Plot( 0 ),
Process Capability( Use Column Property Specs )
)
)
});
);
回复:动态地将分布图添加到表中您的脚本没有完全充实表脚本运行所需的 JSL。myTests 的引用需要解析为准确的列名称,以便表脚本能够正常运行。下面的 JSL 在将代码保存到数据表之前强制对其进行扩展。我还添加了本地过滤器,并且还更改了代码以使脚本名称成为列名称
Names Default To Here( 1 );
Clear Log();
Clear Globals();
dt =
// Open Data Table: Blood Pressure.jmp
// → Data Table( "Blood Pressure" )
Open( "$SAMPLE_DATA/Blood Pressure.jmp" );
myTests = dt << get column names( string, numeric );
For( i = 1, i <= N Items( myTests ), i++,
Eval(
Eval Expr(
dt << Add Properties to Table(
{New Script(
expr(myTests[i]),
Distribution(
Stack( 1 ),
Continuous Distribution( Column( Expr( myTests[i] ) ) ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Outlier Box Plot( 0 ),
Process Capability( Use Column Property Specs ),
Local Data Filter( Add Filter( columns( Expr( myTests[i] )) ) )
)
)}
)
)
)
);
回复:动态地将分布图添加到表中如果您在分发的启动脚本中使用全局变量,那么它将使用该变量中存储的当前值。 您需要将其转换为启动脚本的文字值。
回复:动态地将分布图添加到表中非常感谢!!!我自学了 JSL...并且一路上遇到了一些障碍...现在我清楚了 Eval 的使用,...再次感谢!
——马特
回复:动态地将分布图添加到表中此外,如果您只是寻找简单的直方图,从 JMP 15 开始,只需选择数据表中的直方图图标即可在每列上方显示直方图
