嗨 JMP 们,
我正在尝试说服一位大客户使用 JMP。现在,我很难在 JMP 中重现他们的应用程序之一。
我面临的第一个问题是,我们希望在使用覆盖选项时保留行状态的颜色。
我们需要上面的图表(包括蓝色和红色点)以及每个部分的两点(Y 轴)之间的连接线。
我可以使用覆盖层获取连接线,但随后我必须手动调整颜色。
同时,我们必须向图表添加多个规格上限和下限。
最后我们希望得到如下图所示的结果:
我能够使用多个手动步骤(例如复制和粘贴框架内容)生成图形,但目标是仅使用标准图形生成器工具生成此图 - 特别是为了保持交互性。
我很乐意提供任何建议。
谢谢,
塞巴斯蒂安
这将是给定的数据结构:
New Table( "Sample",
Add Rows( 20 ),
New Column( "Part ID",
Numeric,
"Nominal",
Format( "Best", 12 ),
Set Values( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] )
),
New Column( "X1",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] )
),
New Column( "X2",
Character,
"Nominal",
Set Values(
{"cold", "cold", "cold", "cold", "cold", "cold", "cold", "cold", "cold",
"cold", "medium", "medium", "medium", "medium", "medium", "medium",
"medium", "medium", "medium", "medium"}
)
),
New Column( "Y",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
If(
:X2 == "cold", Random Normal() + 10,
:X2 == "medium", Random Normal() + 12,
Random Normal()
)
)
),
New Column( "Y_USL",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16]
)
),
New Column( "Y_LSL",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] )
),
Set Row States(
[768, 768, 1280, 1280, 1280, 1280, 1280, 1280, 768, 768, 768, 768, 1280,
1280, 1280, 1280, 1280, 1280, 768, 768]
)
)
顺便说一句:您到“JSL Syntax Highliger”的链接似乎已损坏。 至少我最终得到的是一个空白页。
您几乎无需编写 JSL 脚本即可获得所需的结果。 首先创建一个带有范围误差线的条形图。 然后将条形的透明度设置为零,以便它们消失。 现在通过按住 Shift 键并单击来添加一组点。 将此 JSL 保存到脚本窗口。
脚本编写的唯一一点是使用 Col Maximum()/列最小值()在参考线上绘制的函数。

Graph Builder(
Size( 663, 468 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :Y ), Y( :Part ID ) ),
Elements(
Bar( X, Y, Legend( 16 ), Error Bars( "Range" ) ),
Points( X, Y, Legend( 14 ), Jitter( 0 ) )
),
SendToReport(
Dispatch(
{},
"Y",
ScaleBox,
{Format( "Best", 12 ), Min( 5.64697504725641 ), Max( 16.37329465957 ),
Inc( 2 ), Minor Ticks( 1 ),
Add Ref Line( Col Minimum(:Y_LSL), "Dashed", "Red", "", 2 ),
Add Ref Line( Col Maximum(:Y_USL), "Dashed", "Red", "", 2 ),
Add Ref Line( Col Maximum(:Y_LSL), "Solid", "Blue", "", 2 ),
Add Ref Line( Col Minimum(:Y_USL), "Solid", "Blue", "", 2 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
16,
Properties( 0, {Fill Color( 2 ), Transparency( 0 )} )
)}
),
Dispatch( {}, "Graph Builder", FrameBox, {Marker Size( 4 )} )
)
);这是一个脚本,可创建您想要的输出图。 我添加了一个示例数据表,就像您一样,但添加了一个内容。 让图形生成器使用与行状态颜色相同的颜色的技巧实际上是将 Part_ID 的值颜色设置为您想要的颜色。 然后图形生成器将这些颜色用于叠加。 图形生成器代码中还添加了轴参考线。 现在,我提供的代码是静态代码,但 JSL 可以通过读取数据表并找出所需的参考线来轻松生成您需要的平台代码,然后根据需要修改 Graph Builder 代码。 最后,我手动修改了实际的线条颜色,然后保存了整个图形生成器脚本。 从你的问题来看,我假设你想看看如何获得你想要的结果。 这就是我的回应。 从通用数据表创建图表不包含在我的回复中,但它当然可以编写脚本。
Names Default to Here( 1 );
New Table( "Sample",
Add Rows( 20 ),
New Column( "Part ID",
Numeric,
"Nominal",
Format( "Best", 12 ),
Set Property( "Value Colors", {1 = 3, 2 = 3, 3 = 5, 4 = 5, 5 = 5, 6 = 5, 7 = 5, 8 = 5, 9 = 3, 10 = 3} ),
Set Values( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] )
),
New Column( "X1",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] )
),
New Column( "X2",
Character,
"Nominal",
Set Values(
{"cold", "cold", "cold", "cold", "cold", "cold", "cold", "cold", "cold", "cold", "medium", "medium", "medium",
"medium", "medium", "medium", "medium", "medium", "medium", "medium"}
)
),
New Column( "Y",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( If( :X2 == "cold", Random Normal() + 10, :X2 == "medium", Random Normal() + 12, Random Normal() ) )
),
New Column( "Y_USL",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16] )
),
New Column( "Y_LSL",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] )
),
Set Row States(
[768, 768, 1280, 1280, 1280, 1280, 1280, 1280, 768, 768, 768, 768, 1280, 1280, 1280, 1280, 1280, 1280, 768, 768]
)
);
Graph Builder(
Size( 509, 443 ),
Show Control Panel( 0 ),
Variables( X( :Y ), Y( :Part ID ), Overlay( :Part ID ) ),
Elements( Line( X, Y, Legend( 4 ), Row order( 1 ) ), Points( X, Y, Legend( 6 ), Jitter( 0 ) ) ),
SendToReport(
Dispatch(
{},
"Y",
ScaleBox,
{Min( 5.43667408790577 ), Max( 16.635593220339 ), Inc( 2 ), Minor Ticks( 0 ),
Add Ref Line( 16, "Dashed", "Red", "", 2 ), Add Ref Line( 15, "Solid", "Medium Dark Blue", "", 2 ),
Add Ref Line( 7, "Solid", "Medium Dark Blue", "", 2 ), Add Ref Line( 6, "Dashed", "Medium Dark Red", "", 2 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
4,
Properties( 0, {Line Color( 0 )} ),
Properties( 1, {Line Color( 0 )} ),
Properties( 2, {Line Color( 0 )} ),
Properties( 3, {Line Color( 0 )} ),
Properties( 4, {Line Color( 0 )} ),
Properties( 5, {Line Color( 0 )} ),
Properties( 6, {Line Color( 0 )} ),
Properties( 7, {Line Color( 0 )} ),
Properties( 8, {Line Color( 0 )} ),
Properties( 9, {Line Color( 0 )} )
), Legend Model(
6,
Properties( 0, {Marker( "FilledCircle" )} ),
Properties( 1, {Marker( "FilledCircle" )} ),
Properties( 2, {Marker( "FilledCircle" )} ),
Properties( 3, {Marker( "FilledCircle" )} ),
Properties( 4, {Marker( "FilledCircle" )} ),
Properties( 5, {Marker( "FilledCircle" )} ),
Properties( 6, {Marker( "FilledCircle" )} ),
Properties( 7, {Marker( "FilledCircle" )} ),
Properties( 8, {Marker( "FilledCircle" )} ),
Properties( 9, {Marker( "FilledCircle" )} )
)}
)
)
);
