<?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 Graph Box: values of variables continue changing even after creation in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Graph-Box-values-of-variables-continue-changing-even-after/m-p/933334#M108968</link>
    <description>&lt;P&gt;[JMP 19] In the following script, I am trying to create a series of graph boxes that are displayed below each other in a window. For this i am given a list of values for every important characteristic (these lists are all accessible via the Associative Array 'listMap'. Then I create all graph boxes via a for loop.&lt;BR /&gt;This however doesn't work because the variables that are used inside of the Graph Box (i.a.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="language-jsl"&gt;iV&lt;/CODE&gt;,&amp;nbsp;&lt;CODE class="language-jsl"&gt;listMap&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"median"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;iV&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;/CODE&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="language-jsl"&gt;numReferenceLines&lt;/CODE&gt;) also change the already created Graph Boxes that use them.&lt;BR /&gt;&lt;BR /&gt;Is there a way to fixate the variables in a Graph Box? I want them to be evaluated instantly and then to not be able to be changed.&lt;BR /&gt;Disclaimer: According to my trials, 'Eval' doesn't seem to help. Neither do Namespaces (as they also still update, even if locked) or Journals (even if 'Freeze All' is activated).&lt;/P&gt;
&lt;P&gt;Help of any kind is well appreciated. Thank you already in advance (:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ClearGlobals();
NamesDefaultToHere( 1 );

width = 1600;
height = 900;
boxPlotWidth = 0.5;
v = 3;

listMap = Associative Array();
listMap["frameHeightMin"]		= {0.5, 0.3, 0.4};
listMap["frameHeightMax"]		= {1.5, 2.0, 4.1};
listMap["numReferenceLines"]	= {3  , 5  , 8  };

listMap["min"]					= {0.6, 0.6, 0.5};
listMap["median"]				= {0.9, 1.4, 2.6};
listMap["max"]					= {1.3, 1.7, 3.9};

win = New Window("Test");
For(iV = 1, iV &amp;lt;= v, iV++,

	numReferenceLines	= listMap["numReferenceLines"][iV];
	frameHeightMin		= listMap["frameHeightMin"][iV];
	frameHeightMax		= listMap["frameHeightMax"][iV];
	
	win &amp;lt;&amp;lt; Graph Box(
			Frame Size( width, height ),
			X Scale( 0, 2),
			Y Scale( frameHeightMin, frameHeightMax ),
			
			X Name("split"),
			Y Name("values"),
						
			//[] Generate grey horizontal lines
			For(h = 0,	h &amp;lt;= numReferenceLines, h++, HLine(frameHeightMin + (h/(numReferenceLines)*(frameHeightMax - frameHeightMin)))),
				
			//[] Min
			If(Contains(listMap, "min")		&amp;amp; Contains(listMap, "min"),
				Line({1 - boxPlotWidth/2,	listMap["min"][iV]	 },	{1 + boxPlotWidth/2,	listMap["min"][iV]		}));
			//[] Median
			If(Contains(listMap, "median")	&amp;amp; Contains(listMap, "median"),
				Line({1 - boxPlotWidth/2,	listMap["median"][iV]},	{1 + boxPlotWidth/2,	listMap["median"][iV]		}));
			//[] Max
			If(Contains(listMap, "max")		&amp;amp; Contains(listMap, "max"),
				Line({1 - boxPlotWidth/2,	listMap["max"][iV]	 },	{1 + boxPlotWidth/2,	listMap["max"][iV]		}));
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 02 Mar 2026 15:33:00 GMT</pubDate>
    <dc:creator>nozellot</dc:creator>
    <dc:date>2026-03-02T15:33:00Z</dc:date>
    <item>
      <title>Graph Box: values of variables continue changing even after creation</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Box-values-of-variables-continue-changing-even-after/m-p/933334#M108968</link>
      <description>&lt;P&gt;[JMP 19] In the following script, I am trying to create a series of graph boxes that are displayed below each other in a window. For this i am given a list of values for every important characteristic (these lists are all accessible via the Associative Array 'listMap'. Then I create all graph boxes via a for loop.&lt;BR /&gt;This however doesn't work because the variables that are used inside of the Graph Box (i.a.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="language-jsl"&gt;iV&lt;/CODE&gt;,&amp;nbsp;&lt;CODE class="language-jsl"&gt;listMap&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"median"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;iV&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;/CODE&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="language-jsl"&gt;numReferenceLines&lt;/CODE&gt;) also change the already created Graph Boxes that use them.&lt;BR /&gt;&lt;BR /&gt;Is there a way to fixate the variables in a Graph Box? I want them to be evaluated instantly and then to not be able to be changed.&lt;BR /&gt;Disclaimer: According to my trials, 'Eval' doesn't seem to help. Neither do Namespaces (as they also still update, even if locked) or Journals (even if 'Freeze All' is activated).&lt;/P&gt;
&lt;P&gt;Help of any kind is well appreciated. Thank you already in advance (:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ClearGlobals();
NamesDefaultToHere( 1 );

width = 1600;
height = 900;
boxPlotWidth = 0.5;
v = 3;

listMap = Associative Array();
listMap["frameHeightMin"]		= {0.5, 0.3, 0.4};
listMap["frameHeightMax"]		= {1.5, 2.0, 4.1};
listMap["numReferenceLines"]	= {3  , 5  , 8  };

listMap["min"]					= {0.6, 0.6, 0.5};
listMap["median"]				= {0.9, 1.4, 2.6};
listMap["max"]					= {1.3, 1.7, 3.9};

win = New Window("Test");
For(iV = 1, iV &amp;lt;= v, iV++,

	numReferenceLines	= listMap["numReferenceLines"][iV];
	frameHeightMin		= listMap["frameHeightMin"][iV];
	frameHeightMax		= listMap["frameHeightMax"][iV];
	
	win &amp;lt;&amp;lt; Graph Box(
			Frame Size( width, height ),
			X Scale( 0, 2),
			Y Scale( frameHeightMin, frameHeightMax ),
			
			X Name("split"),
			Y Name("values"),
						
			//[] Generate grey horizontal lines
			For(h = 0,	h &amp;lt;= numReferenceLines, h++, HLine(frameHeightMin + (h/(numReferenceLines)*(frameHeightMax - frameHeightMin)))),
				
			//[] Min
			If(Contains(listMap, "min")		&amp;amp; Contains(listMap, "min"),
				Line({1 - boxPlotWidth/2,	listMap["min"][iV]	 },	{1 + boxPlotWidth/2,	listMap["min"][iV]		}));
			//[] Median
			If(Contains(listMap, "median")	&amp;amp; Contains(listMap, "median"),
				Line({1 - boxPlotWidth/2,	listMap["median"][iV]},	{1 + boxPlotWidth/2,	listMap["median"][iV]		}));
			//[] Max
			If(Contains(listMap, "max")		&amp;amp; Contains(listMap, "max"),
				Line({1 - boxPlotWidth/2,	listMap["max"][iV]	 },	{1 + boxPlotWidth/2,	listMap["max"][iV]		}));
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Mar 2026 15:33:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Box-values-of-variables-continue-changing-even-after/m-p/933334#M108968</guid>
      <dc:creator>nozellot</dc:creator>
      <dc:date>2026-03-02T15:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Box: values of variables continue changing even after creation</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Box-values-of-variables-continue-changing-even-after/m-p/933359#M108970</link>
      <description>&lt;P&gt;Evaluate the values to your graph boxes using either EvalExpr() or Substitute() with Eval().&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

width = 1600;
height = 900;
boxPlotWidth = 0.5;
v = 3;

listMap = Associative Array();
listMap["frameHeightMin"] = {0.5, 0.3, 0.4};
listMap["frameHeightMax"] = {1.5, 2.0, 4.1};
listMap["numReferenceLines"] = {3, 5, 8};

listMap["min"] = {0.6, 0.6, 0.5};
listMap["median"] = {0.9, 1.4, 2.6};
listMap["max"] = {1.3, 1.7, 3.9};

win = New Window("Test");

For(iV = 1, iV &amp;lt;= v, iV++, 
	numReferenceLines = listMap["numReferenceLines"][iV];
	frameHeightMin = listMap["frameHeightMin"][iV];
	frameHeightMax = listMap["frameHeightMax"][iV];
	
	Eval(EvalExpr(
		win &amp;lt;&amp;lt; Append(Graph Box(
			Frame Size(width, height),
			X Scale(0, 2),
			Y Scale(frameHeightMin, frameHeightMax), 

			X Name("split"),
			Y Name("values"),

			Line({1 - Expr(boxPlotWidth) / 2, Expr(listMap["min"][iV])}, {1 + Expr(boxPlotWidth) / 2, Expr(listMap["min"][iV])});
		));
	));
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Substitute is most likely better option for you, as you have so many variables to evaluate&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2026 17:13:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Box-values-of-variables-continue-changing-even-after/m-p/933359#M108970</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-03-02T17:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Box: values of variables continue changing even after creation</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Box-values-of-variables-continue-changing-even-after/m-p/935612#M109127</link>
      <description>&lt;P&gt;Thank you a lot, this works fine for me. However, do you know if this is also somehow able to be implemented if I need a ForLoop inside of the "Graph Box(...)"? The following code is based on the previous example although it now contains multiple values per window for different boxplots.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

width = 1600;
height = 900;
boxPlotWidth = 0.5;
v = 3; // number of canvas'
n = 2; // number of boxplots per canvas

listMap = Associative Array();
listMap["frameHeightMin"] = {0.5, 0.3, 0.4};
listMap["frameHeightMax"] = {1.5, 2.0, 4.1};
listMap["numReferenceLines"] = {3, 5, 8};

listMap["min"] = {{0.7, 0.6}, {0.4, 0.6}, {0.7, 0.5}};
listMap["median"] = {{0.9, 0.9}, {1.3, 1.4}, {3.0, 2.6}};
listMap["max"] = {{1.4, 1.3}, {1.8, 1.7}, {3.8, 3.9}};

win = New Window("Test");

For(iV = 1, iV &amp;lt;= v, iV++, 
	numReferenceLines = listMap["numReferenceLines"][iV];
	frameHeightMin = listMap["frameHeightMin"][iV];
	frameHeightMax = listMap["frameHeightMax"][iV];
	
	Eval(EvalExpr(
		win &amp;lt;&amp;lt; Append(Graph Box(
			Frame Size(width, height),
			X Scale(0, n + 1),
			Y Scale(frameHeightMin, frameHeightMax), 

			X Name("split"),
			Y Name("values"),
			For(iN = 1, iN &amp;lt;= n, iN++,
				Line({iN - Expr(boxPlotWidth) / 2, Expr(listMap["min"][iV][iN])}, {iN + Expr(boxPlotWidth) / 2, Expr(listMap["min"][iV][iN])});
				Line({iN - Expr(boxPlotWidth) / 2, Expr(listMap["median"][iV][iN])}, {iN + Expr(boxPlotWidth) / 2, Expr(listMap["median"][iV][iN])});
				Line({iN - Expr(boxPlotWidth) / 2, Expr(listMap["max"][iV][iN])}, {iN + Expr(boxPlotWidth) / 2, Expr(listMap["max"][iV][iN])});
			)
		));
	));
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When trying to run this code, I always get the error "Name Unresolved: iN in access or evaluation of 'iN' , iN/*###*/Name Unresolved: iN in access or evaluation of 'iN' , iN/*###*/".&lt;BR /&gt;If you know more about how to do this, I would be very grateful (:&lt;BR /&gt;&lt;BR /&gt;Btw., is there any website or forum post etc. to find out how Eval, EvalExpr and Expr actually work?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2026 13:01:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Box-values-of-variables-continue-changing-even-after/m-p/935612#M109127</guid>
      <dc:creator>nozellot</dc:creator>
      <dc:date>2026-03-16T13:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Box: values of variables continue changing even after creation</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Box-values-of-variables-continue-changing-even-after/m-p/935613#M109128</link>
      <description>&lt;P&gt;Usually I will evaluate the values inside GraphBox so they can be accessed easier, for example for For-loop. &lt;A href="https://www.jmp.com/content/dam/jmp/documents/en/newsletters/jmper-cable/26_winter_2010.pdf" rel="noopener" target="_blank"&gt;This .pdf&lt;/A&gt;, &lt;A href="https://www.jmp.com/support/help/en/19.0/#page/jmp/introduction-to-writing-jsl-scripts.shtml#" rel="noopener" target="_blank"&gt;Scripting Guide&lt;/A&gt;, Scripting Index (within JMP) and&amp;nbsp;JMP community are all quite good sources.&lt;/P&gt;
&lt;P&gt;I would also suggest that you try to implement something much more simple when testing these things out to make them easier to understand&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

width = 1600;
height = 900;
linecount = 3;
linesx = {1, 2, 3};
linesy = {4, 6, 8};

nw = New Window("",
	vlb = V List Box();
);

Eval(EvalExpr(
	vlb &amp;lt;&amp;lt; Append(Graph Box(
		Frame Size(width, height),
		X Scale(0, 10),
		Y Scale(0, 10),
		X Name("split"),
		Y Name("values"),
		ngb = Expr(linecount);
		xs = Expr(linesx);
		ys = Expr(linesy);
		For(i = 1, i &amp;lt;= ngb, i++,
			H Line(xs[i]);
			V Line(ys[i]);
		);
	));
));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Mar 2026 13:12:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Box-values-of-variables-continue-changing-even-after/m-p/935613#M109128</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-03-16T13:12:55Z</dc:date>
    </item>
  </channel>
</rss>

