下面的代碼片段的目標是繪製當前的反對時間. 我有多種不同的設備串行.
在 GraphBuilder 上,我將串行通過“頁面”。 因為我有可變數量的設備,所以我有可變數量的頁面。
在設置比例時,每個頁面(設備)數都有一個“調度”行——所以下面我有四個調度行來更新每個設備的四個圖表。
如何在所有 GraphBuilder 頁面上實現相同的比例和圖表設置? 謝謝!
//t0 is minimum time
//tn is maximum time
Graph Builder(
Size(700, 5000),
Show Control Panel(0),
Variables(
X(:Column(Time)),
Y(:Column(Current)),
Page(:Serial)
),
Elements(
Points(X, Y(2), Legend(1)),
Points(X, Y(1), Legend(2))
),
SendToReport(
Dispatch({}, "Time (H)", ScaleBox(2),
{Min(t0), Max(tn), Inc(inc);}),
Dispatch({}, "Time (H)", ScaleBox(3),
{Min(t0), Max(tn), Inc(inc);}),
Dispatch({}, "Time (H)", ScaleBox(4),
{Min(t0), Max(tn), Inc(inc);}),
Dispatch({}, "Time (H)", ScaleBox(5),
{Min(t0), Max(tn), Inc(inc);})
);
);
您很可能將 Eval(EvalExpr()) 與 Expr() 一起使用使用 Eval Insert、Eval Expr、Parse 和 Substitute 將一個表達式插入另一個表達式,但我會嘗試使用 XPath(或沒有 XPath 的類似方法)來解決這個問題,因為這更靈活且更容易修改(在我看來)。
下面是使用 :age 作為頁面列並修改 x 軸 (:weight) min、max 和 inc 的 Big Class 表示例。 它也有一些調試打印,出於某種原因,有 7 個 scalebox,但只有 6 個組
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Size(529, 2957),
Show Control Panel(0),
Variables(X(:weight), Y(:height), Page(:age)),
Elements(Points(X, Y, Legend(7)), Smoother(X, Y, Legend(8)))
);
Summarize(dt, uniq_groups = by(:age));
Show(N Items(uniq_groups));
rep = Report(gb);
//Show(rep << Get XML);
scale_boxes = rep << XPath("//ScaleBox[@charID='weight']");
Show(N Items(scale_boxes)); //this has one extra when compared to groups, not sure (yet) why
scale_boxes << Min(10);
scale_boxes << Max(200);
scale_boxes << Inc(5);