<?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: [Script JLS] : Loop for plotting several graphs together in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-JLS-Loop-for-plotting-several-graphs-together/m-p/62275#M33562</link>
    <description>&lt;P&gt;Here is an example of how I would do it&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

For( i = 6, i &amp;lt;= 69, i++,
	Column( dt, i ) &amp;lt;&amp;lt; set name( "ref " || Char( i - 5 ) )
);
Column( dt, 5 ) &amp;lt;&amp;lt; set name( "currentTimeMillis" );

New Window( "Ref",
	hlb = H List Box(
			
	)
);


For( r = 2, r &amp;lt;= 64, r++,
	name = "ref " || Char( r );
	Eval(
		Substitute(
				Expr(
					outputhlb = H List Box(
						Graph Builder(
			
							Variables(
								X( :currentTimeMillis ),
								Y( Column( __col__ ), Position( 1 ) )
							),
							Elements(
								Points( X, Y( r ), Legend( 29 ) ),
								Smoother( X, Y( r ), Legend( 30 ) )
							),
							SendToReport(
								Dispatch(
									{},
									"graph title",
									TextEditBox,
									{Set Text( strTitle )}
								)
							)
						)
					)
				),
			Expr( __col__ ), Parse( ":" || name )
		)
	);
	hlb &amp;lt;&amp;lt; append( outputhlb );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Jul 2018 18:18:09 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2018-07-06T18:18:09Z</dc:date>
    <item>
      <title>[Script JLS] : Loop for plotting several graphs together</title>
      <link>https://community.jmp.com/t5/Discussions/Script-JLS-Loop-for-plotting-several-graphs-together/m-p/62241#M33539</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new in JMP. It's a powerfull software !&lt;/P&gt;&lt;P&gt;That is why I would like to write a script that can plot several Y from different column (every n column actually) in function of one X.&lt;/P&gt;&lt;P&gt;I wrote it thanks to graph builder interface, but I would like to script it in a loop.&lt;/P&gt;&lt;P&gt;I did something like that for plotting distribution (but it is not the same scale unfortunately ...)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Distributions Std Dev 
	New Window( "Side by Side",
		H List Box(
			Distribution(
				Continuous Distribution( Column( :median_range_mm ))
				);
			for ( p = 2, p &amp;lt;= 64, p++,
				nom =  "median_range_mm " || char(p);
				col = Column(nom);
				Distribution(
					Continuous Distribution( Column( col ), Std Error Bars( 1 ) );
					/*SendToReport(
						Dispatch(
						{"Distributions", Column( col )},
						"1",
						ScaleBox,
						{Min( 1450 ), Max( 1820 ), Inc( 20 ), Minor Ticks( 0 ),
						Label Row Nesting( 1 )}
						)
					)*/
			)
		)
	)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I tried for my main problem, the result is just an opening window of graph builder.&lt;/P&gt;&lt;P&gt;I would like to plot the column [ref, ref 1 , ref 2 until ref 64] on Y axis and currentTimeMillis on X axis&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Window( "Ref",
	H List Box(
			Graph Builder(
				For (r = 2 , r &amp;lt;= 64, r++,
					name =  "ref " || char(r);
					col = Column(name);
					Variables( X( :currentTimeMillis ), Y (Column (col), Position( 1 ) ) ),
					Elements(
					Points( X, Y(r) , Legend( 29 ) ), 
					Smoother( X , Y(r), Legend( 30 ) )	
					),
				SendToReport(
				Dispatch(
					{},
					"graph title",
					TextEditBox,
					{Set Text( strTitle )}
					)
				)
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 09:57:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-JLS-Loop-for-plotting-several-graphs-together/m-p/62241#M33539</guid>
      <dc:creator>Rob128</dc:creator>
      <dc:date>2018-07-06T09:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: [Script JLS] : Loop for plotting several graphs together</title>
      <link>https://community.jmp.com/t5/Discussions/Script-JLS-Loop-for-plotting-several-graphs-together/m-p/62275#M33562</link>
      <description>&lt;P&gt;Here is an example of how I would do it&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

For( i = 6, i &amp;lt;= 69, i++,
	Column( dt, i ) &amp;lt;&amp;lt; set name( "ref " || Char( i - 5 ) )
);
Column( dt, 5 ) &amp;lt;&amp;lt; set name( "currentTimeMillis" );

New Window( "Ref",
	hlb = H List Box(
			
	)
);


For( r = 2, r &amp;lt;= 64, r++,
	name = "ref " || Char( r );
	Eval(
		Substitute(
				Expr(
					outputhlb = H List Box(
						Graph Builder(
			
							Variables(
								X( :currentTimeMillis ),
								Y( Column( __col__ ), Position( 1 ) )
							),
							Elements(
								Points( X, Y( r ), Legend( 29 ) ),
								Smoother( X, Y( r ), Legend( 30 ) )
							),
							SendToReport(
								Dispatch(
									{},
									"graph title",
									TextEditBox,
									{Set Text( strTitle )}
								)
							)
						)
					)
				),
			Expr( __col__ ), Parse( ":" || name )
		)
	);
	hlb &amp;lt;&amp;lt; append( outputhlb );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 18:18:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-JLS-Loop-for-plotting-several-graphs-together/m-p/62275#M33562</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-07-06T18:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: [Script JLS] : Loop for plotting several graphs together</title>
      <link>https://community.jmp.com/t5/Discussions/Script-JLS-Loop-for-plotting-several-graphs-together/m-p/62313#M33590</link>
      <description>&lt;P&gt;Thank you for your reply Jim !&lt;/P&gt;&lt;P&gt;But I may have misrepresented my problem.&lt;/P&gt;&lt;P&gt;Indeed, I would like to have &lt;U&gt;all of my plot on the same graph&lt;/U&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also my Y column has already been set every&amp;nbsp; 11 columns, and currentTimeMillis appear just once at the beginning :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Set columns
For( i = 1, i &amp;lt;=709 , i++,
	For ( j = 0, j &amp;lt;= 63, j++, 
				
		If ( i == 2, Column(i) &amp;lt;&amp;lt; set name( "currentTimeMillis" ),i == 15 + 11*j, Column(i) &amp;lt;&amp;lt; set name( "ref" ),
			)
		)
	)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Finally, "__col__" has not been defined ( "col" was defined but in an other function for distribution), so I don't understand why you used it here.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2018 08:51:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-JLS-Loop-for-plotting-several-graphs-together/m-p/62313#M33590</guid>
      <dc:creator>Rob128</dc:creator>
      <dc:date>2018-07-09T08:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: [Script JLS] : Loop for plotting several graphs together</title>
      <link>https://community.jmp.com/t5/Discussions/Script-JLS-Loop-for-plotting-several-graphs-together/m-p/62357#M33612</link>
      <description>&lt;P&gt;I am a bit confused.....but I offer this code as a possible example of a solution.&amp;nbsp; It appears from the last piece of code you supplied, that you are changing the names of columns in your data table, to "Ref".&amp;nbsp; Since JMP will not allow you to have 2 columns of the same name, the second column you attempt to rename "Ref", actually gets named, "Ref 2".&amp;nbsp; And that continues all the way through column "Ref 64".&amp;nbsp; I also suggest that you recheck your code for the naming of column "currentTimeMillis".&amp;nbsp; In your code, you actually rename that column(to the same name), 64 times.&lt;/P&gt;
&lt;P&gt;Below is my new code......it uses a sample data table.......the columns called Ref - Ref 64, are all in a contiguous order, but since JMP really does not care, the code will also work for your data table, where the columns are spread across your 700+ columns&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// Build some sample data
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

Column( dt, 6 ) &amp;lt;&amp;lt; set name( "ref" );

For( i = 7, i &amp;lt;= 69, i++,
	Column( dt, i ) &amp;lt;&amp;lt; set name( "ref " || Char( i - 5 ) )
);
Column( dt, 5 ) &amp;lt;&amp;lt; set name( "currentTimeMillis" );


// Build the JSL code for the Graph Builder
theExpr = "dt &amp;lt;&amp;lt; Graph Builder(
	Variables(
		X( :currentTimeMillis ),
		Y( :ref )";
		
For( i = 2, i &amp;lt;= 64, i++,
	theExpr = theExpr || ",Y( :ref " || Char( i ) || ", Position( 1 ) )"
);

theExpr = theExpr || "),
	Elements(
		Points(
			X";
			
For( i = 2, i &amp;lt;= 64, i++,
	theExpr = theExpr || ",Y( " || Char( i ) || ")"
);

theExpr = theExpr || "	
			,Legend( 5 )
		),
		Smoother(
			X";
			
For( i = 2, i &amp;lt;= 64, i++,
	theExpr = theExpr || ",Y( " || Char( i ) || ")"
);

theExpr = theExpr || "		,
			Legend( 6 )
		)
	)
)";

// Execute the generated code
Eval( Parse( theExpr ) );
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Jul 2018 13:57:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-JLS-Loop-for-plotting-several-graphs-together/m-p/62357#M33612</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-07-09T13:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: [Script JLS] : Loop for plotting several graphs together</title>
      <link>https://community.jmp.com/t5/Discussions/Script-JLS-Loop-for-plotting-several-graphs-together/m-p/178506#M40198</link>
      <description>&lt;P&gt;is that possible to save individual graph(like easy access list) for later use instead of plot them all in a single H List Box?&amp;nbsp; thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 23:03:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-JLS-Loop-for-plotting-several-graphs-together/m-p/178506#M40198</guid>
      <dc:creator>jietan25</dc:creator>
      <dc:date>2019-02-27T23:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: [Script JLS] : Loop for plotting several graphs together</title>
      <link>https://community.jmp.com/t5/Discussions/Script-JLS-Loop-for-plotting-several-graphs-together/m-p/183635#M40307</link>
      <description>&lt;P&gt;One can easily create output objects, that can be created in advance and then displayed at user's request.&amp;nbsp; Or, because of the speed of JMP, many of my applications generate specific outputs at the time of a user's request.&amp;nbsp; You should also explore the Column Switcher that will allow the user to select from a list, what to columns to analyze and display.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2019 21:14:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-JLS-Loop-for-plotting-several-graphs-together/m-p/183635#M40307</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-03-04T21:14:20Z</dc:date>
    </item>
  </channel>
</rss>

