<?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: Use variable in graph builder customize script window in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Use-variable-in-graph-builder-customize-script-window/m-p/524158#M74882</link>
    <description>&lt;P&gt;Thanks, I adapted this a bit and included&amp;nbsp;&lt;SPAN&gt;Col Max&lt;/SPAN&gt; (Column 2) &amp;nbsp;as the upper limit so this all goes into the smaller script environment of script builder without having to define an entire graph builder script. &amp;nbsp;Thanks for the help&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Pen Size( 4 );
Line Style( dashed );
Pen Color( "black" );
Y Function( x, x );
Pen Size( 4 );
Line Style( dashed );
Pen Color( "red" );
Y Function( 1.1 * x, x );
Pen Size( 4 );
Line Style( dashed );
Pen Color( "red" );
Y Function( .9 * x, x );
Transparency( 0.5 );
Fill Color( {0.38, 0.84, 0.67} );
xMat = [0];
yMat = [0];
xMax = 2*Col Max (Column 1);
yMax = 2*Col Max (Column 2);
xMat = xMat || xMax || xMax || [0];
yMat = yMat || xMax * 1.1 || xMax * .9 || [0];
Polygon( xMat, yMat );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 Jul 2022 23:31:07 GMT</pubDate>
    <dc:creator>jeffsecor</dc:creator>
    <dc:date>2022-07-20T23:31:07Z</dc:date>
    <item>
      <title>Use variable in graph builder customize script window</title>
      <link>https://community.jmp.com/t5/Discussions/Use-variable-in-graph-builder-customize-script-window/m-p/523181#M74796</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to plot 3 lines and a shaded area between the outer lines using the customize script in graph builder. &amp;nbsp;The first is the line y0=x. &amp;nbsp;The second and third lines are y1= a*x and y2 = b*x. &amp;nbsp;(example a = 1.05 and b = 0.95 I want to shade between the lines y1 and y2. &amp;nbsp;I use a polygon fill to do this, but the polygon function requires fixed values and does not scale with the graph axes. &amp;nbsp;How can I make the shaded region scale with the graph as do the three lines? i.e. put a variable in the polygon function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jeffsecor_0-1658202661957.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44112i7CA1EB733DD279BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jeffsecor_0-1658202661957.png" alt="jeffsecor_0-1658202661957.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Pen Size( 4 );
Line Style( dashed );
Pen Color( "black" );
Y Function( x, x );
Pen Size( 4 );
Line Style( dashed );
Pen Color( "red" );
Y Function( 1.1 * x, x );
Pen Size( 4 );
Line Style( dashed );
Pen Color( "red" );
Y Function( .9 * x, x );
Transparency( 0.5 );
Fill Color( {0.38, 0.84, 0.67} );
Polygon( [0.05, 1, 1, .05], [.045, .95, 1.05, .055] );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:25:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-variable-in-graph-builder-customize-script-window/m-p/523181#M74796</guid>
      <dc:creator>jeffsecor</dc:creator>
      <dc:date>2023-06-11T11:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable in graph builder customize script window</title>
      <link>https://community.jmp.com/t5/Discussions/Use-variable-in-graph-builder-customize-script-window/m-p/523198#M74799</link>
      <description>&lt;P&gt;Here is a simple example of how you can change the polygon to match the axis settings.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1658206272327.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44115i4A9CA5A2A72E3E59/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1658206272327.png" alt="txnelson_0-1658206272327.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_1-1658206312256.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44116iE474614CCBD817D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_1-1658206312256.png" alt="txnelson_1-1658206312256.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = New Table( "Sample",
	Add Rows( 7 ),
	New Column( "Column 1",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.65] )
	),
	New Column( "Column 2",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [0.2, 0.3, 0.25, 0.3, 0.55, 0.68, 0.9] )
	)
);

gb = Graph Builder(
	Size( 528, 454 ),
	Show Control Panel( 0 ),
	Variables( X( :Column 1 ), Y( :Column 2 ) ),
	Elements( Points( X, Y, Legend( 5 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Column 1",
			ScaleBox,
			{Min( -0.0389121338912134 ), Max( 1.21814306472226 ), Inc( 0.2 ), Minor Ticks( 1 ),
			Label Row(
				{Major Grid Line Color( 1 ), Minor Grid Line Color( 1 ), Show Major Grid( 1 ),
				Show Minor Grid( 1 )}
			)}
		),
		Dispatch(
			{},
			"Column 2",
			ScaleBox,
			{Min( -0.05302734375 ), Max( 1.20978927612305 ), Inc( 0.2 ), Minor Ticks( 2 ),
			Label Row(
				{Major Grid Line Color( 1 ), Minor Grid Line Color( 1 ), Show Major Grid( 1 ),
				Show Minor Grid( 1 )}
			)}
		)
	)
);

Report( gb )[FrameBox( 1 )] &amp;lt;&amp;lt; Add Graphics Script(
	Pen Size( 4 );
	Line Style( dashed );
	Pen Color( "black" );
	Y Function( x, x );
	Pen Size( 4 );
	Line Style( dashed );
	Pen Color( "red" );
	Y Function( 1.1 * x, x );
	Pen Size( 4 );
	Line Style( dashed );
	Pen Color( "red" );
	Y Function( .9 * x, x );
	Transparency( 0.5 );
	Fill Color( {0.38, 0.84, 0.67} );
	xMat = [0.05];
	yMat = [.045];
	xMax = Report( gb )[AxisBox( 2 )] &amp;lt;&amp;lt; get max;
	xMat = xMat || xMax || xMax || [0.045];
	yMat = yMat || xMax * 1.1 || xMax * .9 || [0.055];
	Polygon( xMat, yMat );
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 04:52:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-variable-in-graph-builder-customize-script-window/m-p/523198#M74799</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-07-19T04:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable in graph builder customize script window</title>
      <link>https://community.jmp.com/t5/Discussions/Use-variable-in-graph-builder-customize-script-window/m-p/524158#M74882</link>
      <description>&lt;P&gt;Thanks, I adapted this a bit and included&amp;nbsp;&lt;SPAN&gt;Col Max&lt;/SPAN&gt; (Column 2) &amp;nbsp;as the upper limit so this all goes into the smaller script environment of script builder without having to define an entire graph builder script. &amp;nbsp;Thanks for the help&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Pen Size( 4 );
Line Style( dashed );
Pen Color( "black" );
Y Function( x, x );
Pen Size( 4 );
Line Style( dashed );
Pen Color( "red" );
Y Function( 1.1 * x, x );
Pen Size( 4 );
Line Style( dashed );
Pen Color( "red" );
Y Function( .9 * x, x );
Transparency( 0.5 );
Fill Color( {0.38, 0.84, 0.67} );
xMat = [0];
yMat = [0];
xMax = 2*Col Max (Column 1);
yMax = 2*Col Max (Column 2);
xMat = xMat || xMax || xMax || [0];
yMat = yMat || xMax * 1.1 || xMax * .9 || [0];
Polygon( xMat, yMat );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jul 2022 23:31:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-variable-in-graph-builder-customize-script-window/m-p/524158#M74882</guid>
      <dc:creator>jeffsecor</dc:creator>
      <dc:date>2022-07-20T23:31:07Z</dc:date>
    </item>
  </channel>
</rss>

