<?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 Creating Plots in a For Loop in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Creating-Plots-in-a-For-Loop/m-p/49260#M28001</link>
    <description>&lt;P&gt;I have a script that creates up to eight very similar plots as part of the analysis. The number of plots can vary based on if corresponding columns exist. The only differences in the plots are the columns being used for the y axis data and the titels. In the interest of efficiency I was trying to avoid just scripting each plot sequentially. I tried using a for loop that pulled from pre-established lists of column names and titles, but I couldn't get it to work. Is this actually possible in JMP 13? I've attached the script section of what I tried.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jan 2018 20:23:28 GMT</pubDate>
    <dc:creator>rfeick</dc:creator>
    <dc:date>2018-01-04T20:23:28Z</dc:date>
    <item>
      <title>Creating Plots in a For Loop</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-Plots-in-a-For-Loop/m-p/49260#M28001</link>
      <description>&lt;P&gt;I have a script that creates up to eight very similar plots as part of the analysis. The number of plots can vary based on if corresponding columns exist. The only differences in the plots are the columns being used for the y axis data and the titels. In the interest of efficiency I was trying to avoid just scripting each plot sequentially. I tried using a for loop that pulled from pre-established lists of column names and titles, but I couldn't get it to work. Is this actually possible in JMP 13? I've attached the script section of what I tried.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 20:23:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-Plots-in-a-For-Loop/m-p/49260#M28001</guid>
      <dc:creator>rfeick</dc:creator>
      <dc:date>2018-01-04T20:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Plots in a For Loop</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-Plots-in-a-For-Loop/m-p/49267#M28003</link>
      <description>&lt;P&gt;A couple of issues.&lt;/P&gt;
&lt;P&gt;1. Your Graph Builder code had a missplaced ")" which was ending the code with a parsing error.&lt;/P&gt;
&lt;P&gt;2. The :Name() function does not resolve elements, so you can not have something like: cols[f] as a value for the function.&amp;nbsp; It needs to be passed just a quoted string,&lt;/P&gt;
&lt;P&gt;The code below fixes both issues&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( f = 1, f &amp;lt;= N Items( plots ), f++,
	Eval(
		Substitute(
				Expr(
					__plots__ = Graph Builder(
						Size( 1267, 905 ),
						Show Control Panel( 0 ),
						Show Legend( 0 ),
						Variables( X( :RPN, Order By( __col__ ), Descending, Order Statistic( "Mean" ) ) ),
						Y( __col__ ),
						Elements( Bar( X, Y, Legend( 4 ), Label( "Label by Value" ) ) ),
						SendToReport(
							Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( outline titles[f] )} ),
							Dispatch( {}, "RPN", ScaleBox, {Max( 10.5 ), Label Row( Label Orientation( "Angled" ) )} ),
							Dispatch( {}, "400", ScaleBox, {Legend Model( 4, Properties( 0, {Fill Color( 53 )} ) )} ),
							Dispatch( {}, "graph title", TextEditBox, {Set Text( plot titles[f] )} ),
							Dispatch( {}, "X title", TextEditBox, {Set Text( "RPN" )} ),
							Dispatch( {}, "Y title", TextEditBox, {Set Text( "Affected Lots" )} ),
							Dispatch( {}, "400", LegendBox, {Set Title( "" )} )
						)
					)
				),
			Expr( __plots__ ), Parse( "Plots" || Char( f ) ),
			Expr( __col__ ), Parse( ":Name(\!"" || Char( cols[f] ) || "\!")" )
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Jan 2018 20:44:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-Plots-in-a-For-Loop/m-p/49267#M28003</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-01-04T20:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Plots in a For Loop</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-Plots-in-a-For-Loop/m-p/49835#M28345</link>
      <description>&lt;P&gt;Thanks for the help! I got the script working!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 20:07:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-Plots-in-a-For-Loop/m-p/49835#M28345</guid>
      <dc:creator>rfeick</dc:creator>
      <dc:date>2018-01-18T20:07:40Z</dc:date>
    </item>
  </channel>
</rss>

