圖表區域外的註釋
如果您在圖形區域內進行註釋(使用“工具”>“註釋”),則復制時該文本將成為圖形的一部分 - 圖形區域外部的註釋似乎不會隨圖形一起復制。
我想要的是一行代碼,我可以將其放入每個腳本中,在每個圖表的右下角(X 軸下方)用小文本標註 N,並將其與圖表一起復制。
偽代碼類似於 Text (<右下>, “n=” || char(<非排除行>))
所以多個子問題:
- 有沒有技巧可以獲取與圖表一起復制的註釋(通過“工具”>“註釋”)?
- 您使用什麼 JSL 代碼將文本放置在圖表背景的右下角? (例如,有沒有辦法在右下角定義原點?)
- 您使用什麼 JSL 代碼來獲取表中未排除的行數? 看起來這應該是顯而易見的(類似於 Rows() - Excluded Rows()),但我沒有看到它......
JMP 17、macOS
是的,有一種方法可以將其放在圖表區域下方,假設您有 JMP 17,並假設您正在使用圖形生成器而不是 Fit Y by X 平台。 訣竅是添加一個標題框,然後將其設置為軸表,然後通過刪除除一個標籤之外的所有標籤來覆蓋默認值(另外,我必須將刻度標籤更改為“短分隔符”以使每個標籤都顯示列在列聯表中)。 這也可以通過腳本來完成;下面的例子。


dt = open ("$SAMPLE_DATA\Big Class.jmp");
//Caption box as regular axis table
graph_one = dt << Graph Builder(
Size( 534, 464 ),
Show Control Panel( 0 ),
Variables( X( :sex ), Y( :age ) ),
Elements(
Mosaic( X, Y, Legend( 6 ) ),
Caption Box(
X,
Y,
Legend( 7 ),
Summary Statistic( "N" ),
Location( "Axis Table" )
)
),
SendToReport(
Dispatch(
{},
"sex",
ScaleBox,
{Label Row( 1, Tick Mark Style( "Short Mark" ) ),
Label Row( 2, Tick Mark Style( "Short Divider" ) )}
)
)
);
//overwritten axis label with custom number (500)
graph_two = dt << Graph Builder(
Size( 534, 464 ),
Show Control Panel( 0 ),
Variables( X( :sex ), Y( :age ) ),
Elements(
Mosaic( X, Y, Legend( 6 ) ),
Caption Box(
X,
Y,
Legend( 7 ),
Summary Statistic( "N" ),
Location( "Axis Table" )
)
),
SendToReport(
Dispatch(
{},
"sex",
ScaleBox,
{Label Row( 1, Tick Mark Style( "Short Mark" ) ),
Label Row(
2,
{Tick Mark Style( "Short Divider" ),
Tick Mark( Label( "18" ), Label( "" ) ), //<----here
Tick Mark( Label( "22" ), Label( "500" ) )} //<--here
)}
)
)
);
謝謝! 這對於將數字放入圖表本身非常有效(下面的示例)。 有沒有辦法把它放在圖表區域下方?
它似乎是 LineupBox (或 AxisBox)的右下角,但我無法讓你的方法與這些一起工作。 建議?

不確定問題 1,但這是一個使用 << 添加圖形腳本將文本添加到圖形生成器右下角的腳本
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
);
Report(gb)[FrameBox(1)] << Add Graphics Script(
included_rows = N Rows(dt) - N Items(dt << Get Excluded Rows());
Text Color("Black");
Text(Right Justified,
{X Origin() + X Range(), Y Origin()},
Eval Insert("n=^included_rows^");
);
);

您應該能夠將該腳本轉換為表達式/函數/插件,然後可以輕鬆地重複使用。