<?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: expr and evalexpr for Graph Builder gradient limits in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/expr-and-evalexpr-for-Graph-Builder-gradient-limits/m-p/519995#M74596</link>
    <description>&lt;P&gt;I don't have your data to validate, but this should work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt0 = current data table();
param = "Voltage";
colp = dt0:param;
graph_high = Quantile( 0.975, column(dt0, param) &amp;lt;&amp;lt; get as matrix() );
graph_low = Quantile( 0.025, column(dt0, param) &amp;lt;&amp;lt; get as matrix() );
val matrix = [](1,0) || graph_low || graph_high;

cmd = expr(
	Graph Builder(
		Size( 550, 550 ),
		Show Control Panel( 0 ),
		Variables(
			X( :x ),
			Y( :y ),
			Color( :expr(param) )
		),
		Elements( Points( X, Y, Legend( 6 ) ) ),
		SendToReport(
			Dispatch(
				{},
				"400",
				ScaleBox,
				{Legend Model(
					6,
					Properties(
						0,
						{gradient( {Scale Values( Expr( val matrix ) )} )}, // *Need Help Here*
						Item ID( expr(param), 1 )
					)
				)}
			)
		)
	);
);

eval(evalexpr(cmd));&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 Jul 2022 02:32:03 GMT</pubDate>
    <dc:creator>ErraticAttack</dc:creator>
    <dc:date>2022-07-12T02:32:03Z</dc:date>
    <item>
      <title>expr and evalexpr for Graph Builder gradient limits</title>
      <link>https://community.jmp.com/t5/Discussions/expr-and-evalexpr-for-Graph-Builder-gradient-limits/m-p/519929#M74591</link>
      <description>&lt;P&gt;I am trying to set up a script that will generate a Graph Builder with gradient min and max equal to to Quantile values of the Column being plotted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, the expr and evalexpr syntax I am using doesn't work for the matrix in "Scale Values".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt0 = current data table();
param = "Voltage";
colp = dt0:param;
graph_high = Quantile( 0.975, column(dt0, param) &amp;lt;&amp;lt; get as matrix() );
graph_low = Quantile( 0.025, column(dt0, param) &amp;lt;&amp;lt; get as matrix() );

cmd = expr(
	Graph Builder(
		Size( 550, 550 ),
		Show Control Panel( 0 ),
		Variables(
			X( :x ),
			Y( :y ),
			Color( :expr(param) )
		),
		Elements( Points( X, Y, Legend( 6 ) ) ),
		SendToReport(
			Dispatch(
				{},
				"400",
				ScaleBox,
				{Legend Model(
					6,
					Properties(
						0,
						{gradient( {Scale Values( [expr(graph_low) expr(graph_high)] )} )}, // *Need Help Here*
						Item ID( expr(param), 1 )
					)
				)}
			)
		)
	);
);

eval(evalexpr(cmd));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:04:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/expr-and-evalexpr-for-Graph-Builder-gradient-limits/m-p/519929#M74591</guid>
      <dc:creator>LaserGuy</dc:creator>
      <dc:date>2023-06-09T17:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: expr and evalexpr for Graph Builder gradient limits</title>
      <link>https://community.jmp.com/t5/Discussions/expr-and-evalexpr-for-Graph-Builder-gradient-limits/m-p/519995#M74596</link>
      <description>&lt;P&gt;I don't have your data to validate, but this should work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt0 = current data table();
param = "Voltage";
colp = dt0:param;
graph_high = Quantile( 0.975, column(dt0, param) &amp;lt;&amp;lt; get as matrix() );
graph_low = Quantile( 0.025, column(dt0, param) &amp;lt;&amp;lt; get as matrix() );
val matrix = [](1,0) || graph_low || graph_high;

cmd = expr(
	Graph Builder(
		Size( 550, 550 ),
		Show Control Panel( 0 ),
		Variables(
			X( :x ),
			Y( :y ),
			Color( :expr(param) )
		),
		Elements( Points( X, Y, Legend( 6 ) ) ),
		SendToReport(
			Dispatch(
				{},
				"400",
				ScaleBox,
				{Legend Model(
					6,
					Properties(
						0,
						{gradient( {Scale Values( Expr( val matrix ) )} )}, // *Need Help Here*
						Item ID( expr(param), 1 )
					)
				)}
			)
		)
	);
);

eval(evalexpr(cmd));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Jul 2022 02:32:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/expr-and-evalexpr-for-Graph-Builder-gradient-limits/m-p/519995#M74596</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2022-07-12T02:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: expr and evalexpr for Graph Builder gradient limits</title>
      <link>https://community.jmp.com/t5/Discussions/expr-and-evalexpr-for-Graph-Builder-gradient-limits/m-p/520008#M74597</link>
      <description>&lt;P&gt;Thanks a lot. This worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now that you gave me the idea of creating a matrix using variables, and then putting that matrix into the Graph Builder script, I decided to play around. It looks like I don't need to use Expr() around the "val matrix".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I find that this works as well:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt0 = current data table();
param = "Voltage";
colp = dt0:param;
graph_high = Quantile( 0.975, column(dt0, param) &amp;lt;&amp;lt; get as matrix() );
graph_low = Quantile( 0.025, column(dt0, param) &amp;lt;&amp;lt; get as matrix() );
val matrix = matrix( {graph_low, graph_high} );

cmd = expr(
	Graph Builder(
		Size( 550, 550 ),
		Show Control Panel( 0 ),
		Variables(
			X( :x ),
			Y( :y ),
			Color( :expr(param) )
		),
		Elements( Points( X, Y, Legend( 6 ) ) ),
		SendToReport(
			Dispatch(
				{},
				"400",
				ScaleBox,
				{Legend Model(
					6,
					Properties(
						0,
						{gradient( {Scale Values( val matrix )} )},
						Item ID( expr(param), 1 )
					)
				)}
			)
		)
	);
);

eval(evalexpr(cmd));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Jul 2022 04:26:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/expr-and-evalexpr-for-Graph-Builder-gradient-limits/m-p/520008#M74597</guid>
      <dc:creator>LaserGuy</dc:creator>
      <dc:date>2022-07-12T04:26:54Z</dc:date>
    </item>
  </channel>
</rss>

