使用 JSL 繪圖後如何為圖形添加文字?在圖像座標(100,100)的左上角添加文字“txt1”
謝謝!

dt = Current Data Table();
P1 = dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :age ), Y( :sex ) ),
Elements( Heatmap( X, Y, Legend( 2 ) ) )
//, Text( Center Justified, {100, 100 }, "txt1"); ??
);自動化和腳本編寫回覆:如何在使用 JSL 繪圖後為圖形添加文字?Dispatch(
{},
"Graph Builder",
FrameBox( 2 ),
{Add Graphics Script(
9,
Description( "" ),
Text( Center Justified, {20, 70}, Char( gm ) || "——" || na9 )
)}
),回覆:如何在使用 JSL 繪圖後為圖形添加文字?有幾種方法可以做你想做的事。您可以使用註釋,也可以使用圖形腳本。

使用註釋,您可以指定文字和文字方塊的位置。在下面的 JSL 中,我在 Graph Builder JSL 的定義中加入了註釋。可以看出,文字方塊的位置是由我記得的框架框中的像素位置決定的。
新增圖形腳本用法,使用其位置的實際 X 和 Y 軸值。然而,這對於你的圖表來說並不是真正的直接。由於兩個軸都不是連續列,而是序數列和名目列,因此 JMP 為資料中找到的每個級別分配整數值,從 0 開始。因此,由於年齡有 6 個級別,X 軸從 0 到 5因此,在Text()函數中引用X值時,需要在-.5到5.5的範圍內才可見。同樣,Y 軸值需要在-.5 到1.5 範圍內。 如果圖表中使用的欄位是連續的,則 X、Y 位置規格中將使用資料的實際值。對於此範例,我使用 << Add Graphics Script() 作為平台執行後將圖形新增至 Frame Box()。見下文。
gb = Graph Builder(
Show Control Panel( 0 ),
Variables( X( :age ), Y( :sex ) ),
Elements( Heatmap( X, Y, Legend( 2 ) ) ),
SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox,
{Add Text Annotation(
Text( "Using Annotation" ),
Fixed Size( 0 ),
Text Box( {169, 137, 224, 200} ),
Font( "Segoe UI", 14, "Bold" ),
Filled( 0 )
), Add Text Annotation(
Text( "" ),
Fixed Size( 0 ),
Text Box( {269, 171, 286, 179} ),
Filled( 0 )
)}
)
)
);
Report( gb )[framebox( 1 )] << add graphics script(
Text Font( "Arial", 14, "Bold" );
Text( Center Justified, {1.5, .90}, "Using Add Graphics" );
);
回覆:如何在使用 JSL 繪圖後為圖形添加文字?我還沒有學會如何為我的繪圖添加文字。
例如如何從左上角添加文字100、100?
感謝專家!
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
p1 = dt << Graph Builder(
Size( 507, 440 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :weight ), Y( :height ), Color( :sex ) ),
Elements( Bar( X, Y, Legend( 5 ), Bar Style( "Needle" ), Response Axis( "X" ) ) ),
SendToReport(
Dispatch(
{},
"weight",
ScaleBox,
{Label Row(
{Automatic Tick Marks( 0 ), Show Major Labels( 0 ), Show Major Ticks( 0 ),
Show Minor Ticks( 0 )}
)}
),
Dispatch(
{},
"height",
ScaleBox,
{Label Row(
{Automatic Tick Marks( 0 ), Show Major Labels( 0 ), Show Major Ticks( 0 ),
Show Minor Ticks( 0 )}
)}
),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "Big Class" )} ),
Dispatch( {}, "X title", TextEditBox, {Hide( 1 )} ),
Dispatch( {}, "Y title", TextEditBox, {Hide( 1 )} )
)
);
回覆:如何在使用 JSL 繪圖後為圖形添加文字?以下是對腳本的修改,透過在 100,100 處放置一個文字方塊 () 來在圖形上新增註釋,文字為「Big Class」。註解函數使用像素來放置值。

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
Size( 776, 457 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :weight ), Y( :height ), Color( :sex ) ),
Elements(
Bar( X, Y, Legend( 5 ), Bar Style( "Needle" ), Response Axis( "X" ) )
),
SendToReport(
Dispatch(
{},
"weight",
ScaleBox,
{Label Row(
{Automatic Tick Marks( 0 ), Show Major Labels( 0 ),
Show Major Ticks( 0 ), Show Minor Ticks( 0 )}
)}
),
Dispatch(
{},
"height",
ScaleBox,
{Label Row(
{Automatic Tick Marks( 0 ), Show Major Labels( 0 ),
Show Major Ticks( 0 ), Show Minor Ticks( 0 )}
)}
),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "Big Class" )} ),
Dispatch( {}, "X title", TextEditBox, {Hide( 1 )} ),
Dispatch( {}, "Y title", TextEditBox, {Hide( 1 )} ),
Dispatch(
{},
"Graph Builder",
FrameBox,
Add Text Annotation(
Text( "Big Class" ),
Fixed Size( 0 ),
Text Box( {100,100, 150, 150} ),
Filled( 0 )
)
)
)
);
回覆:如何在使用 JSL 繪圖後為圖形添加文字?透過文字方塊新增的文字無法與原始圖像一起保存在其他位置。
回覆:如何在使用 JSL 繪圖後為圖形添加文字?將原始圖像保存到其他地方是什麼意思?
文字好像跟這張圖片一起保存就好了?
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Size(776, 457),
Show Control Panel(0),
Show Legend(0),
Variables(X(:weight), Y(:height), Color(:sex)),
Elements(Bar(X, Y, Legend(5), Bar Style("Needle"), Response Axis("X"))),
SendToReport(
Dispatch(
{},
"weight",
ScaleBox,
{Label Row({Automatic Tick Marks(0), Show Major Labels(0), Show Major Ticks(0), Show Minor Ticks(0)})}
),
Dispatch(
{},
"height",
ScaleBox,
{Label Row({Automatic Tick Marks(0), Show Major Labels(0), Show Major Ticks(0), Show Minor Ticks(0)})}
),
Dispatch({}, "graph title", TextEditBox, {Set Text("Big Class")}),
Dispatch({}, "X title", TextEditBox, {Hide(1)}),
Dispatch({}, "Y title", TextEditBox, {Hide(1)}),
Dispatch(
{},
"Graph Builder",
FrameBox,
Add Text Annotation(Text("Big Class"), Fixed Size(0), Text Box({100, 100, 150, 150}), Filled(0))
)
)
);
pic = gb << Get Picture;
gb << Close Window;
Close(dt, no save);
nw = new window("",
pic
);
pic << Save Picture("$TEMP/textbox.png", "PNG");
Open("$TEMP/textbox.png");回覆:如何在使用 JSL 繪圖後為圖形添加文字?您試圖將圖像保存到哪裡?下面的 JSL 保存到多個位置,添加的文字與圖像一起保存
report(gb)<<JOURNAL></JOURNAL>
回覆:如何在使用 JSL 繪圖後為圖形添加文字?如何使用jsl
謝謝吉姆!
</CODE></P><P><CODE class=" language-jsl">
,SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox,
{Add Graphics Script( 2, Description:( "" ), Text( Center Justified, {50, 50}, "Big Class" ) )}
)
);</CODE></P></LINGO-BODY><LINGO-SUB id="lingo-sub-703023" slang="en-US" mode="NONE">回覆:如何在使用 JSL 繪圖後為圖形添加文字?</LINGO-SUB><LINGO-BODY id="lingo-body-703023" slang="en-US" mode="NONE"><PRE><CODE class=" language-jsl">nw = Report( gb )[Graph Builder Box( 1 )];
dy = New Table( "K", Add Rows( 2 ), New Column( "A", Expression ), New Column( "B", Expression ) );
dy[1, 1] = nw;
回覆:如何在使用 JSL 繪圖後為圖形添加文字?我懂了
gb << 取得圖片;
需要剪去多餘的部分。

回覆:如何在使用 JSL 繪圖後為圖形添加文字?您可以刪除軸設置,然後複製圖片。 以互動方式進入軸設置,然後您可以刪除軸。然後儲存腳本看看JLS是刪除軸的。