<?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 Editing Color Gradient Scale Using JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Editing-Color-Gradient-Scale-Using-JSL/m-p/108277#M39388</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this data table for example&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table.PNG" style="width: 265px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15266i29F1CAEF144F5290/image-size/large?v=v2&amp;amp;px=999" role="button" title="table.PNG" alt="table.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;test = Graph Builder(
	Variables( X( :X ), Y( :Y ), Color( :Value ) ),
	Elements( Points( X, Y, Legend( 23 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				23,
				Properties(
					0,
					{gradient(
						{Scale Values( [-2 2] ), Label Format( "Fixed Dec", 15, 3 )}
					)},
					Item ID( "Value", 1 )
				)
			)}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I run the above script to get this graph below with the color gradient +/-2 standard deviations. This helps to not show fliers if the data set is large.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="orig graph.PNG" style="width: 993px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15267iC74561657856ABE7/image-size/large?v=v2&amp;amp;px=999" role="button" title="orig graph.PNG" alt="orig graph.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the graph below the only thing I do is right click on the color gradient and change the scale type to linear (because it's easier to think in linear scales). I'm struggling to script this step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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="update scale.PNG" style="width: 988px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15268i626C771B79237197/image-size/large?v=v2&amp;amp;px=999" role="button" title="update scale.PNG" alt="update scale.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note, I do not want the graph below which is just the default when making the graph before adjusting the gradient.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="default.PNG" style="width: 941px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15271i7E1C002810586B1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="default.PNG" alt="default.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The closest I've gotten is below but it sets the scaled linearly from -2 to 2 which was what I inputted for the standard deviation limits.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;test &amp;lt;&amp;lt; Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				3,
				Properties(
					0,
					{gradient(
						{ Scale Values[ ], Label Format( "Fixed Dec", 15, 4 ),
						Scale Type( "Linear" )}
					)},
					Item ID( "Entry X Offset", 1 )
				)
			)}
		)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any thoughts are much appreciated! - Evan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jan 2019 20:09:44 GMT</pubDate>
    <dc:creator>bittnere</dc:creator>
    <dc:date>2019-01-29T20:09:44Z</dc:date>
    <item>
      <title>Editing Color Gradient Scale Using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Editing-Color-Gradient-Scale-Using-JSL/m-p/108277#M39388</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this data table for example&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table.PNG" style="width: 265px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15266i29F1CAEF144F5290/image-size/large?v=v2&amp;amp;px=999" role="button" title="table.PNG" alt="table.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;test = Graph Builder(
	Variables( X( :X ), Y( :Y ), Color( :Value ) ),
	Elements( Points( X, Y, Legend( 23 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				23,
				Properties(
					0,
					{gradient(
						{Scale Values( [-2 2] ), Label Format( "Fixed Dec", 15, 3 )}
					)},
					Item ID( "Value", 1 )
				)
			)}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I run the above script to get this graph below with the color gradient +/-2 standard deviations. This helps to not show fliers if the data set is large.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="orig graph.PNG" style="width: 993px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15267iC74561657856ABE7/image-size/large?v=v2&amp;amp;px=999" role="button" title="orig graph.PNG" alt="orig graph.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the graph below the only thing I do is right click on the color gradient and change the scale type to linear (because it's easier to think in linear scales). I'm struggling to script this step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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="update scale.PNG" style="width: 988px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15268i626C771B79237197/image-size/large?v=v2&amp;amp;px=999" role="button" title="update scale.PNG" alt="update scale.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note, I do not want the graph below which is just the default when making the graph before adjusting the gradient.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="default.PNG" style="width: 941px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15271i7E1C002810586B1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="default.PNG" alt="default.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The closest I've gotten is below but it sets the scaled linearly from -2 to 2 which was what I inputted for the standard deviation limits.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;test &amp;lt;&amp;lt; Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				3,
				Properties(
					0,
					{gradient(
						{ Scale Values[ ], Label Format( "Fixed Dec", 15, 4 ),
						Scale Type( "Linear" )}
					)},
					Item ID( "Entry X Offset", 1 )
				)
			)}
		)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any thoughts are much appreciated! - Evan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 20:09:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Editing-Color-Gradient-Scale-Using-JSL/m-p/108277#M39388</guid>
      <dc:creator>bittnere</dc:creator>
      <dc:date>2019-01-29T20:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Editing Color Gradient Scale Using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Editing-Color-Gradient-Scale-Using-JSL/m-p/108286#M39397</link>
      <description>&lt;P&gt;Work on the graph in GB and set the scale to exactly what you want.&amp;nbsp; Then click the red triangle and select Script &amp;gt; Save to script window.&amp;nbsp; Here's what I got after changing the scale somewhat:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :X ), Y( :Y ), Color( :Value ) ),
	Elements( Points( X, Y, Legend( 9 ) ) ),
	SendToReport(
		Dispatch( {}, "400", ScaleBox,
			{Legend Model( 9,
				Properties( 0,
					{gradient( {Scale Values( [2.2 2.6 3.2] )} )},
					Item ID( "Value", 1 )
				)
			)}
		)
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Jan 2019 21:50:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Editing-Color-Gradient-Scale-Using-JSL/m-p/108286#M39397</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2019-01-29T21:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Editing Color Gradient Scale Using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Editing-Color-Gradient-Scale-Using-JSL/m-p/108320#M39411</link>
      <description>Thanks for the reply!&lt;BR /&gt;&lt;BR /&gt;I don't want to have to do any manual work in Graph Builder though. The idea of my (larger) script is to automatically make many graphs with appropriate scaling for each graph and data set. To see patterns the scale needs to individually adjust for each column/set of data. There's too many to do manually.</description>
      <pubDate>Wed, 30 Jan 2019 13:27:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Editing-Color-Gradient-Scale-Using-JSL/m-p/108320#M39411</guid>
      <dc:creator>bittnere</dc:creator>
      <dc:date>2019-01-30T13:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Editing Color Gradient Scale Using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Editing-Color-Gradient-Scale-Using-JSL/m-p/108329#M39415</link>
      <description>&lt;P&gt;The point of the exercise is to see what JSL GB produces for a customized scale.&amp;nbsp; Once you have that you can programmatically determine the scaling for each dataset and substitute that into your GB JSL at runtime.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2019 15:45:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Editing-Color-Gradient-Scale-Using-JSL/m-p/108329#M39415</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2019-01-30T15:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Editing Color Gradient Scale Using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Editing-Color-Gradient-Scale-Using-JSL/m-p/108342#M39419</link>
      <description>&lt;P&gt;Here's an example where I'm dynamically determining the gradient from one of the columns.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "Untitled", Add Rows( 4 ),
	New Column( "X", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [1, 2, 3, 4] )  ),
	New Column( "Y", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [4, 1, 3, 2] ) ),
	New Column( "Value", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [1, 1, 2, 2] ) )
);

dtcol = column(dt, "Y");
one_min = col min(dtcol);
one_max = col max(dtcol);
one_avg = col mean(dtcol);

scale_matrix = matrix({one_min, one_avg, one_max});

Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :X ), Y( :Y ), Color( :Value ) ),
	Elements( Points( X, Y, Legend( 9 ) ) ),
	SendToReport(
		Dispatch( {}, "400", ScaleBox,
			{Legend Model( 9,
				Properties( 0,
					{gradient( {Scale Values( scale_matrix )} )},
					Item ID( "Value", 1 )
				)
			)}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Jan 2019 16:02:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Editing-Color-Gradient-Scale-Using-JSL/m-p/108342#M39419</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2019-01-30T16:02:12Z</dc:date>
    </item>
  </channel>
</rss>

