早安,
我在 Y 軸上疊加了 3 個變數。
是否可以新增一條垂直線,連接 X 軸上每個標識符的最小值和最大值?我們應該能夠選擇垂直線的顏色、粗細和透明度。
請參閱圖片中圓圈內的範例。
真摯地
您可以嘗試使用範圍誤差線

或者您可以新增間隔條形圖並停用“中間”值(這可能需要一些額外的計算/列)

當然還有使用圖形腳本的腳本選項,這更複雜

以下是腳本選項的一個可能範例
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << New Formula Column(Operation(Category("Aggregate"), "Minimum"), Columns(:height), Group By(:age));
dt << New Formula Column(Operation(Category("Aggregate"), "Maximum"), Columns(:height), Group By(:age));
gb = dt << Graph Builder(
Size(525, 448),
Show Control Panel(0),
Variables(
X(:age),
Y(:height),
Y(:"Maximum[height][age]"n, Position(1)),
Y(:"Minimum[height][age]"n, Position(1))
),
Elements(Points(X, Y(1), Y(2), Y(3), Legend(3), Summary Statistic("Mean")))
);
segs = Report(gb)[FrameBox(1)] << Find Segs();
ys = [];
xs = {};
For Each({seg}, segs,
If(seg << Class Name == "MarkerSeg",
ys = ys |/ (seg << get y values)`;
Insert Into(xs, seg << get x values);
)
);
For Each({{ymin, ymax, x}}, Across(V Min(ys), V Max(ys), xs[1]),
Eval(EvalExpr(
Report(gb)[FrameBox(1)] << Add Graphics Script(
"Back",
Pen Color("Purple");
Pen Size(20);
Transparency(0.2);
V Line(Expr(x), Expr(ymin), Expr(ymax));
);
));
);
Write();
這個「簡單」的例子不適用於過濾器。
然後是標記繪製表達式,您可以在其中控製圖例的顏色和透明度以及繪製表達式的寬度
看更多...
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << New Formula Column(Operation(Category("Aggregate"), "Minimum"), Columns(:height), Group By(:age));
dt << New Formula Column(Operation(Category("Aggregate"), "Maximum"), Columns(:height), Group By(:age));
gb = dt << Graph Builder(
Size(746, 818),
Show Control Panel(0),
Variables(
X(:age),
Y(:height),
Y(:"Maximum[height][age]"n, Position(1)),
Y(:"Minimum[height][age]"n, Position(1))
),
Elements(
Points(X, Y(1), Y(2), Y(3), Legend(3), Summary Statistic("Mean")),
Points(X, Y(1), Legend(4), Summary Statistic("Mean"))
),
Local Data Filter(Add Filter(columns(:age), Display(:age, N Items(6)))),
SendToReport(
Dispatch({}, "400", ScaleBox,
{Legend Model(
4,
Properties(
0,
{Line Color(35), Transparency(0.2)},
Item ID("Mean(height)", 1)
)
)}
)
)
);
frame = Report(gb)[FrameBox(1)];
seg = (frame << FindSeg(Marker Seg(4)));
seg << Set Marker Draw Expr(
Function({this seg, this row, x, y, size, row state},
size = 0.1;
Rect(
x - size,
:"Maximum[height][age]"n[this row],
x + size,
:"Minimum[height][age]"n[this row],
1
);
);
);
