你好,
我试图让我的脚本绘制不在数据表中但在执行脚本时生成的值。 该程序首先在两列中导入数据,类似于:
| 位置 | 焦点度量 |
| 0 | 120 |
| -4 | 140 |
| -8 | 165 |
| -4 | 160 |
| -0 | 130 |
然后我向上/向下拟合数据并确定两者之间的偏移量。 当我尝试绘制数据图表时,问题就出现了。 GraphBuilder 找不到变量,因为它们不在数据表中。 这是我的代码,在 GraphBuilder 之前一切似乎都有效。 我正在尝试获取偏移量线图 splineEval 和反冲标记 splineMin。 任何其他建议表示赞赏,这对我来说是一种新语言!
//Setup arrays for creating spline over data
x = Index(-100,0,1);
offset = Index(-20,20,0.1);
//Determine position minimum index
rPosMin = dt << GetRowsWhere(:Position == ColMin(:Position));
//Create spline coeficients over up/down scan of data
splineUp = SplineCoef(:Position[1::rPosMin-1], :FocusMetric[1::rPosMin-1], 1);
splineDown = SplineCoef(:Position[rPosMin+1::NRow()], :FocusMetric[rPosMin+1::NRow()], 1);
//Create array of least squares
for( i=1, i<=length(offset), i++,
s[i] = Sum(Abs(SplineEval(x,splineDown) - SplineEval((x-offset[i]),splineUp))),
);
//Create spline coefficient over regressed data
si = SplineCoef(offset,s,1);
//Find minimum from regressed data and determine backlash
rSplineMin = Loc(SplineEval(offset,si) == Minimum(SplineEval(offset,si)));
backlash = offset[rSplineMin];
print(backlash);
GraphBuilder(
ShowControlPanel(0),
Variables(
X(offset),
X(backlash, Position(1)),
Y(Values(SplineEval(offset,si))),
Y(rSplineMin, Position(1))
),
Elements(Line(X(1), X(2), Y(1), Y(2), Legend(5)))
);
我认为将最小值添加为表中的一行会更容易。 样条点将具有样条值,而额外点将具有反冲值,然后将其称为特殊类型的 GraphBuilder 元素。这条曲线可能看起来很奇怪,因为它使用了您的示例数据。附上脚本。

好的,我可以做到。一旦我将它们放在数据表中,是否可以选择一个点作为标记,而不必为每个单独的点创建一个新列? 我试图在最小点上放置一个标记,但是当我尝试在 GraphBuilder 中的该索引处设置 X,Y 时,我收到错误“在数据表中找不到指定的列”
GraphBuilder(
ShowControlPanel(0),
Variables(
X(:xoff),
X(:xoff[rSplineMin], Position(1)),
Y(:spline),
Y(:spline[rSplineMin], Position(1))
),
Elements(Line(X(1), X(2), Y(1) Y(2), Legend(3))),
我将如何编写脚本来选择那个单点并在那里放置一个标记?
JMP 分析和 Grpah 平台需要参考表中的列。
从计算的、偏移量、反向间隙等矩阵值创建一个表,然后使用这个新表定义 GraphBuilder。