我尝试在图表构建器中将列和函数线的数据点叠加在一起。但是,每当我将变量放在同一坐标轴上并叠加时,最终都会出现以下两种结果之一:
- 数据点和函数都以点的形式绘制出来,或者
- 两者都用线条表示。
我想要的很简单:
- 列数据应以点的形式显示,并且
- 该函数应以线条形式显示。
在同一张图中叠加显示。
下面这段 JSL 脚本会生成一个包含两列随机数据和一列函数数据的小型示例表格。其中,第 1 列和第 2 列是随机值,函数列是第 1 列的多项式函数。当我使用图形生成器时,除非我手动将它们重叠,否则 JMP 会将它们放置在不同的图形上;而一旦我将它们重叠,图形生成器就会强制所有 Y 变量共享相同的元素类型。
似乎当多个 Y 变量在叠加图中共享同一轴时,图形生成器无法混合点和线。
附件是我目前看到的图表,展示了图形生成器如何将函数和数据点放置在不同的坐标轴上,或者在叠加时强制将它们放在同一元素类型中。我使用的是 JMP 18 版本。
请问有人知道在图形生成器中,是否可以将函数线和数据点叠加在同一张图上,同时保持不同的元素类型吗?或者图形生成器在这方面有限制吗?
New Table( "Function_plot",
Add Rows( 10 ),
New Script(
"plot_function",
Graph Builder(
Variables( X( :Column 1 ), Y( :function ), Y( :Column 2 ) ),
Elements( Position( 1, 1 ), Formula( X, Y, Legend( 13 ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 7 ) ) ),
SendToReport(
Dispatch( {}, "400", LegendBox,
{Legend Position( {13, [1], 7, [0]} )}
)
)
)
),
New Column( "Column 1",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [3, 1, 5, 9, 3, 12, 15, 19, 21, 17] ),
Set Display Width( 53 )
),
New Column( "Column 2",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [22, 76, 34, 19, 9, 45, 78, 63, 19, 5] ),
Set Display Width( 53 )
),
New Column( "function",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( :Column 1 ^ 3 + 5 ),
Set Selected,
Set Display Width( 47 )
)
);
Graph Builder(
Variables( X( :Column 1 ), Y( :function ), Y( :Column 2 ) ),
Elements( Position( 1, 1 ), Formula( X, Y, Legend( 13 ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 7 ) ) ),
SendToReport(
Dispatch( {}, "400", LegendBox, {Legend Position( {13, [1], 7, [0]} )} )
)
);