使用 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是删除轴的。