是否可以编写脚本让 Graph Builder 将参考线显示在最前面?是否可以通过 JSL 将参考线移动到图表的前面,使其清晰地显示在数据点上方?
我知道我可以右键单击,在单个框架框内进行自定义,并手动重新排列列表中的项目,但如果可能的话,我希望通过 JSL 来完成此操作。
欢迎提出任何建议/反馈。
谢谢,
射线

用于复现上图的代码。
names default to here(1);<BR />dt = open ( "$SAMPLE_DATA/Aircraft Incidents.jmp" );<BR />dt << Graph Builder(
Size( 964, 585 ),
Show Control Panel( 0 ),
Graph Spacing( 3 ),
Spacing Borders( 1 ),
Variables( X( :Event Date ), X( :Amateur Built ), Y( :Latitude ) ),
Elements(
Position( 1, 1 ),
Points( X, Y, Legend( 94 ) ),
Smoother( X, Y, Legend( 95 ) )
),
Elements(
Position( 2, 1 ),
Points( X, Y, Legend( 96 ) ),
Box Plot( X, Y, Legend( 97 ), Outliers( 0 ) )
),
SendToReport(
Dispatch(
{},
"Latitude",
ScaleBox,
{Min( 0 ), Max( 110.494221427167 ), Inc( 20 ), Minor Ticks( 3 ),
Add Ref Line( 42.1037140060617, "Solid", "Red", "", 1 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Marker Size( 4 ), Marker Drawing Mode( "Outlined" )}
),
Dispatch(
{},
"Graph Builder",
FrameBox( 2 ),
{Marker Size( 4 ), Marker Drawing Mode( "Outlined" )}
)
)
)
自动化和脚本编写大规模定制回复:是否可以编写脚本让图表构建器将参考线显示在最前面?如果您在自定义图表中更改顺序,JMP 会将参考线顺序添加到您的脚本中(至少在 JMP19 中是这样)。然后,您可以从脚本索引中搜索该参考线顺序,以了解您可以执行的操作。
回复:是否可以编写脚本让图表构建器将参考线显示在最前面?这个修改后的脚本能用吗?
Graph Builder(
Size( 964, 585 ),
Show Control Panel( 0 ),
Graph Spacing( 3 ),
Spacing Borders( 1 ),
Variables( X( :Event Date ), X( :Amateur Built ), Y( :Latitude ) ),
Elements(
Position( 1, 1 ),
Points( X, Y, Legend( 94 ) ),
Smoother( X, Y, Legend( 95 ) )
),
Elements(
Position( 2, 1 ),
Points( X, Y, Legend( 96 ) ),
Box Plot( X, Y, Legend( 97 ), Outliers( 0 ) )
),
SendToReport(
Dispatch( {}, "Latitude", ScaleBox,
{Min( 0 ), Max( 110.494221427167 ), Inc( 20 ), Minor Ticks( 3 ),
Add Ref Line( 42.1037140060617, "Solid", "Red", "", 1 )}
),
Dispatch( {}, "Graph Builder", FrameBox,
{Marker Size( 4 ), Marker Drawing Mode( "Outlined" ),
Reference Line Order( 3 )}
),
Dispatch( {}, "Graph Builder", FrameBox( 2 ),
{Marker Size( 4 ), Marker Drawing Mode( "Outlined" ),
Reference Line Order( 3 )}
)
)
);
如果是这样,我只需点击 GB 顶部的红色三角形,然后选择“保存脚本”>“到剪贴板”,之后交互式地更改渲染顺序,使参考线跟随标记。
回复:是否可以编写脚本让图表构建器将参考线显示在最前面?@jthi和@Mark_Bailey - 谢谢你们两位。
这些答案让我得出了这个结论。
r = current report();
frameBoxList = r << XPath( "//FrameBox" );
// Giving a large enough number as input to Reference Line Order( )
// to ensure reference lines are brought to the front.
frameBoxList << Reference Line Order( 100 );
// Or alternatively, I found seg count() which returns the number <BR />// of segs in a frame so could use that to set specific count for each one if needed.
frameBoxList[1] << seg count();