<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to add text to a graph after drawing using JSL? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/702910#M88727</link>
    <description>&lt;P&gt;I still haven't learned how to add text to my drawings.&lt;BR /&gt;For example, how to add text from the top left corner 100, 100?&lt;/P&gt;&lt;P&gt;Thanks Experts!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
p1 = dt &amp;lt;&amp;lt; 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 )} )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-11-27_07-27-42.png" style="width: 584px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/59075iCFD2D976D434FD2F/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-11-27_07-27-42.png" alt="2023-11-27_07-27-42.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Nov 2023 23:42:22 GMT</pubDate>
    <dc:creator>lala</dc:creator>
    <dc:date>2023-11-26T23:42:22Z</dc:date>
    <item>
      <title>How to add text to a graph after drawing using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/695442#M88050</link>
      <description>&lt;P&gt;Add the text "txt1" at the top left of the image coordinates (100,100)&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-11-08_7-14-18.png" style="width: 543px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58429i1101F255A5FEB80E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-11-08_7-14-18.png" alt="2023-11-08_7-14-18.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
P1 = dt &amp;lt;&amp;lt; Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :age ), Y( :sex ) ),
	Elements( Heatmap( X, Y, Legend( 2 ) ) )
	//, Text( Center Justified, {100, 100  }, "txt1"); ??
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Nov 2023 23:29:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/695442#M88050</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-11-07T23:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text to a graph after drawing using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/695512#M88053</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Dispatch(
	{},
	"Graph Builder",
	FrameBox( 2 ),
	{Add Graphics Script(
		9,
		Description( "" ),
		Text( Center Justified, {20, 70}, Char( gm ) || "——" || na9 )
	)}
),&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Nov 2023 03:43:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/695512#M88053</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-11-08T03:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text to a graph after drawing using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/695513#M88054</link>
      <description>&lt;P&gt;There are a couple of ways to do what you want.&amp;nbsp; You can use Annotation or you can use a Graphic Script.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1699413894852.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58438i38235415F5A11810/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1699413894852.png" alt="txnelson_0-1699413894852.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;With Annotation, you specify the Text and the location of the Text Box.&amp;nbsp; In the JSL below, I added the Annotation within the definition of the Graph Builder JSL.&amp;nbsp; As can be seen, the Text Box location is determined by&amp;nbsp; what I remember as being the pixel location within the frame box.&lt;/P&gt;
&lt;P&gt;Add Graphics Script usage, uses the actual X and Y axis values for it's location.&amp;nbsp; However, this is not real straight forward with your graph.&amp;nbsp; Since both axes are not Continuous columns, but rather are Ordinal and Nominal, JMP assigns&amp;nbsp; integer values to each of the levels found in the data, starting with 0.&amp;nbsp; Therefore since there are 6 levels of Age, the X axis goes from 0 to 5.&amp;nbsp; Therefore, when referencing the X value in the Text() function, it needs to be within the range of -.5 to 5.5 to be visible.&amp;nbsp; Similarly, the&amp;nbsp; Y axis value needs to be within -.5 to 1.5. If a column used in the graph is Continuous, the actual values of the data are used in the X,Y location specification.&amp;nbsp; For this example, I used a &amp;lt;&amp;lt; Add Graphics Script() as an after Platform Execution to add the graphic to the Frame Box().&amp;nbsp; See below.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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 )] &amp;lt;&amp;lt; add graphics script(
	Text Font( "Arial", 14, "Bold" );
	Text( Center Justified, {1.5, .90}, "Using Add Graphics" );
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 03:49:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/695513#M88054</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-08T03:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text to a graph after drawing using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/702910#M88727</link>
      <description>&lt;P&gt;I still haven't learned how to add text to my drawings.&lt;BR /&gt;For example, how to add text from the top left corner 100, 100?&lt;/P&gt;&lt;P&gt;Thanks Experts!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
p1 = dt &amp;lt;&amp;lt; 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 )} )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-11-27_07-27-42.png" style="width: 584px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/59075iCFD2D976D434FD2F/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-11-27_07-27-42.png" alt="2023-11-27_07-27-42.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Nov 2023 23:42:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/702910#M88727</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-11-26T23:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text to a graph after drawing using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/702990#M88730</link>
      <description>&lt;P&gt;Below is a modification to your script that adds an annotation to the graph by placing a text box() at 100,100, with the text being "Big Class".&amp;nbsp; The annotation functions use pixels to place the values.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_1-1701056423217.png" style="width: 668px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/59080iAD59B46929E4E41E/image-dimensions/668x489?v=v2" width="668" height="489" role="button" title="txnelson_1-1701056423217.png" alt="txnelson_1-1701056423217.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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 )
			)
		)
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 03:41:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/702990#M88730</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-27T03:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text to a graph after drawing using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/703013#M88733</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Text added through the text box cannot be saved elsewhere with the original image.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 06:33:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/703013#M88733</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-11-27T06:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text to a graph after drawing using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/703020#M88734</link>
      <description>&lt;P&gt;What do you mean by saving elsewhere with the original image?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Text seems to be saved with this picture just fine?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt &amp;lt;&amp;lt; 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 &amp;lt;&amp;lt; Get Picture;

gb &amp;lt;&amp;lt; Close Window;
Close(dt, no save);

nw = new window("",
	pic
);

pic &amp;lt;&amp;lt; Save Picture("$TEMP/textbox.png", "PNG");

Open("$TEMP/textbox.png");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Nov 2023 06:43:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/703020#M88734</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-27T06:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text to a graph after drawing using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/703021#M88735</link>
      <description>&lt;P&gt;Where are you attempting to save the image to?&amp;nbsp; The below JSL saves to multiple places, with the added text being saved with the image&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;report(gb)&amp;lt;&amp;lt;journal;

report(gb)&amp;lt;&amp;lt;save presentation("$TEMP/jmp_example.pptx" );
Open( "$TEMP/jmp_example.pptx" );

report(gb)[framebox(1)]&amp;lt;&amp;lt;journal;

report(gb) &amp;lt;&amp;lt; Save Interactive HTML( "$TEMP/jmp_example.html" );
open( "$TEMP/jmp_example.html");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Nov 2023 06:48:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/703021#M88735</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-27T06:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text to a graph after drawing using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/703022#M88736</link>
      <description>&lt;P&gt;how can use the jsl&lt;/P&gt;&lt;P&gt;Thank Jim!&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;,SendToReport(
	Dispatch(
		{},
		"Graph Builder",
		FrameBox,
		{Add Graphics Script( 2, Description：( "" ), Text( Center Justified, {50, 50}, "Big Class" ) )}
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 06:51:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/703022#M88736</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-11-27T06:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text to a graph after drawing using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/703023#M88737</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Nov 2023 07:02:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/703023#M88737</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-11-27T07:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text to a graph after drawing using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/703025#M88738</link>
      <description>&lt;P&gt;I see&lt;/P&gt;&lt;P&gt;gb &amp;lt;&amp;lt; Get Picture;&lt;BR /&gt;Need to cut the excess.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-11-27_15-06-43.png" style="width: 860px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/59081i4C120E52A24412CB/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-11-27_15-06-43.png" alt="2023-11-27_15-06-43.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 07:09:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/703025#M88738</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-11-27T07:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text to a graph after drawing using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/703026#M88739</link>
      <description>&lt;P&gt;You can delete the axis settings and then copy the picture. Go interactively into the Axis Settings, and then you can delete the axes.&amp;nbsp; Then Save the Script to see what the JLS is to delete the axes.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 07:24:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-text-to-a-graph-after-drawing-using-JSL/m-p/703026#M88739</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-27T07:24:23Z</dc:date>
    </item>
  </channel>
</rss>

