你好,
我試圖讓我的腳本繪製不在資料表中但在執行腳本時產生的值的圖表。 該程式首先在兩列中導入數據,與此類似:
| 位置 | 焦點度量 |
| 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)))
);
我認為將最小值添加為表中的一行會更容易。 樣條點將具有 Spline 值,額外點具有 Backlash 值,然後將其稱為特殊類型的 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 Analysis 和 Grpah 平台需要參考表中的欄位。
根據計算的、偏移、反向間隙等矩陣值建立一個表,然後使用這個新表定義 GraphBuilder。