<?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: Input multiple spec to contour plot using JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Input-multiple-spec-to-contour-plot-using-JSL/m-p/340383#M58880</link>
    <description>&lt;P&gt;Above of all,&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I knew that can be worked but I want to select multiple items.&lt;/P&gt;&lt;P&gt;I will study JSL more and try to change code form for convenience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Dec 2020 23:35:14 GMT</pubDate>
    <dc:creator>LBrian</dc:creator>
    <dc:date>2020-12-08T23:35:14Z</dc:date>
    <item>
      <title>Input multiple spec to contour plot using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Input-multiple-spec-to-contour-plot-using-JSL/m-p/340071#M58848</link>
      <description>&lt;P&gt;Hello everyone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am studying JSL to making contour plot easily.&lt;/P&gt;&lt;P&gt;But I have a problem about 'specify contours()' function.&lt;/P&gt;&lt;P&gt;When I run this code, the spec is fixed one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please give me help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

win = New Window( "Select Item(s)",
		&amp;lt;&amp;lt;Modal,
		Text Box( "Item List" ),
		H List Box(
			allcols = Col List Box( dt, all ),
			Lineup Box(
				2,
				V List Box(
					bbAdd = Button Box( "Add", xcols &amp;lt;&amp;lt; append( allcols &amp;lt;&amp;lt; get selected ) ),
					bbRemove = Button Box( "Remove", xcols &amp;lt;&amp;lt; remove selected )
				),
				xcols = Col List Box( "Numeric", &amp;lt;&amp;lt;Modeling Type( {"Continuous"} ), min items( 1 ) )
			),
			V List Box(
				bbOK = Button Box( "OK", 
				xvar = (xcols &amp;lt;&amp;lt; Get Items);
				str = "";
			 
			
				If( NItems( xvar ) == 0,
					ErrWin = New Window( "Sorry",
						&amp;lt;&amp;lt;modal,
						Text Box( "\!N Please add item at least one \!N\!N" ) 
					)	
				);
				bbCancel = Button Box( "Cancel", Throw() )
			)
		)
	)
	);

dt &amp;lt;&amp;lt; Contour Plot(
	X( :height, :weight ),
	Y( Eval(xvar) ),
	Legend( 2 ),
	Show Contours( 1 ),
	Show Data Points( 0 ),
	Fill Areas( 1 ),
	Label Contours( 0 ),
	Color Theme( "Blue White Red" ),    Specify Contours( Min(Column( dt,Eval(xvar))[3]), Max( Column( dt, Eval( xvar))[4]), N( 10 ) ),
	SendToReport(
		Dispatch(
			{},
			"1", 
			
		),
		Dispatch(
			{},
			"2", 
	
		),
		Dispatch( {}, "meow", TextEditBox, {Rotate Text( "Horizontal" )} ),
		Dispatch(
			{},
			"Contour Plot Graph",
			FrameBox,
			{Frame Size( 700, 700 ), Marker Size( 2 ), Marker Drawing Mode( "Normal" ),
			Marker Selection Mode( "Unselected Faded" )
				
			}
		),
		Dispatch( {}, "", AxisBox( 2 ), {Add Axis Label( "-meow-" )} ),
		Dispatch( {}, "Contour Legend", FrameBox, {Frame Size( 101, 87 )} )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:08:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Input-multiple-spec-to-contour-plot-using-JSL/m-p/340071#M58848</guid>
      <dc:creator>LBrian</dc:creator>
      <dc:date>2023-06-11T11:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Input multiple spec to contour plot using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Input-multiple-spec-to-contour-plot-using-JSL/m-p/340112#M58850</link>
      <description>&lt;P&gt;Looks like you need to spend a little time with 'Help &amp;gt; Books &amp;gt; Scripting Guide', or one of many other resources that will help you get more familiar with JSL.&lt;/P&gt;
&lt;P&gt;It seems as if you want to allow the user to select one (and only one) variable for the 'Y' role in the Contour Plot platform. If that's so, please look at these slight changes to your code above:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

win = New Window( "Select Item(s)",
		&amp;lt;&amp;lt;Modal,
		Text Box( "Item List" ),
		H List Box(
			allcols = Col List Box( dt, all ),
			Lineup Box(
				2,
				V List Box(
					bbAdd = Button Box( "Add", xcols &amp;lt;&amp;lt; append( allcols &amp;lt;&amp;lt; get selected ) ),
					bbRemove = Button Box( "Remove", xcols &amp;lt;&amp;lt; remove selected )
				),
				// Use 'max items()' to only allow one Y to be selected
				xcols = Col List Box( "Numeric", &amp;lt;&amp;lt;Modeling Type( {"Continuous"} ), min items( 1 ), max items(1) )
			),
			V List Box(
				bbOK = Button Box( "OK",
				// 'xvar' is a list (containing only one item) 
				xvar = (xcols &amp;lt;&amp;lt; Get Items);
				// Put this first item into a variable (with the same name)
				xvar = xvar[1];
				str = "";
			 
			
				If( NItems( xvar ) == 0,
					ErrWin = New Window( "Sorry",
						&amp;lt;&amp;lt;modal,
						Text Box( "\!N Please add item at least one \!N\!N" ) 
					)	
				);
				bbCancel = Button Box( "Cancel", Throw() )
			)
		)
	)
	);

dt &amp;lt;&amp;lt; Contour Plot(
	X( :height, :weight ),
	Y( Eval(xvar) ),
	Legend( 2 ),
	Show Contours( 1 ),
	Show Data Points( 0 ),
	Fill Areas( 1 ),
	Label Contours( 0 ),
	Color Theme( "Blue White Red" ),
	// You don't need 'Eval(xvar)' here . . .
	Specify Contours( Min(Column( dt, xvar)[3]), Max( Column( dt, xvar)[4]), N( 2 ) ),
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Dec 2020 10:49:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Input-multiple-spec-to-contour-plot-using-JSL/m-p/340112#M58850</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2020-12-08T10:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Input multiple spec to contour plot using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Input-multiple-spec-to-contour-plot-using-JSL/m-p/340383#M58880</link>
      <description>&lt;P&gt;Above of all,&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I knew that can be worked but I want to select multiple items.&lt;/P&gt;&lt;P&gt;I will study JSL more and try to change code form for convenience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 23:35:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Input-multiple-spec-to-contour-plot-using-JSL/m-p/340383#M58880</guid>
      <dc:creator>LBrian</dc:creator>
      <dc:date>2020-12-08T23:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Input multiple spec to contour plot using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Input-multiple-spec-to-contour-plot-using-JSL/m-p/340457#M58886</link>
      <description>&lt;P&gt;So I think I mis-understood what you wanted. The Contour Plot platform does allow multiple Ys, and if you wanted, say, at least two Ys, you can (more or less) return to your original code (see below). But in this case, the same set of contour values will be applied to every Y the user defines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to allow each Y to have its own contour values I assume you would need to update your UI. You could then launch the platform separately for each Y, and put all the reports in a single window. This is probably not a good first project if you are new to JSL though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

win = New Window( "Select Item(s)",
		&amp;lt;&amp;lt;Modal,
		Text Box( "Item List" ),
		H List Box(
			allcols = Col List Box( dt, all ),
			Lineup Box(
				2,
				V List Box(
					bbAdd = Button Box( "Add", xcols &amp;lt;&amp;lt; append( allcols &amp;lt;&amp;lt; get selected ) ),
					bbRemove = Button Box( "Remove", xcols &amp;lt;&amp;lt; remove selected )
				),
				// Use 'max items()' to only allow one Y to be selected
				xcols = Col List Box( "Numeric", &amp;lt;&amp;lt;Modeling Type( {"Continuous"} ), min items( 2 ))
			),
			V List Box(
				bbOK = Button Box( "OK",
				// 'xvar' is a list
				xvar = (xcols &amp;lt;&amp;lt; Get Items);
				str = "";
			 
			
				If( NItems( xvar ) == 0,
					ErrWin = New Window( "Sorry",
						&amp;lt;&amp;lt;modal,
						Text Box( "\!N Please add item at least one \!N\!N" ) 
					)	
				);
				bbCancel = Button Box( "Cancel", Throw() )
			)
		)
	)
	);

dt &amp;lt;&amp;lt; Contour Plot(
	X( :height, :weight ),
	Y( Eval(xvar) ),
	Legend( 2 ),
	Show Contours( 1 ),
	Show Data Points( 0 ),
	Fill Areas( 1 ),
	Label Contours( 0 ),
	Color Theme( "Blue White Red" ),
	// You don't need 'Eval(xvar)' here. This usses some contour values from the second variable in 'xvar' for all variables in 'xvar'
	Specify Contours( Min(Column( dt, xvar[2])[5]), Max( Column( dt, xvar[2])[2]), N( 4 ) ),
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 10:54:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Input-multiple-spec-to-contour-plot-using-JSL/m-p/340457#M58886</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2020-12-09T10:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Input multiple spec to contour plot using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Input-multiple-spec-to-contour-plot-using-JSL/m-p/340693#M58909</link>
      <description>&lt;P&gt;Thanks to you I can get a hint. I appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed the code slightly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

win = New Window( "Select Item(s)",
		&amp;lt;&amp;lt;Modal,
		Text Box( "Item List" ),
		H List Box(
			allcols = Col List Box( dt, all ),
			Lineup Box(
				2,
				V List Box(
					bbAdd = Button Box( "Add", xcols &amp;lt;&amp;lt; append( allcols &amp;lt;&amp;lt; get selected ) ),
					bbRemove = Button Box( "Remove", xcols &amp;lt;&amp;lt; remove selected )
				),
				// Use 'max items()' to only allow one Y to be selected
				xcols = Col List Box( "Numeric", &amp;lt;&amp;lt;Modeling Type( {"Continuous"} ), min items( 2 ))
			),
			V List Box(
				bbOK = Button Box( "OK",
				// 'xvar' is a list
				xvar = (xcols &amp;lt;&amp;lt; Get Items);
				str = "";
			 
			
				If( NItems( xvar ) == 0,
					ErrWin = New Window( "Sorry",
						&amp;lt;&amp;lt;modal,
						Text Box( "\!N Please add item at least one \!N\!N" ) 
					)	
				);
				bbCancel = Button Box( "Cancel", Throw() )
			)
		)
	)
	);

for(i=1,i&amp;lt;=NItems(xvar),i++,

    dt&amp;lt;&amp;lt;Contour Plot(
	X( :height, :weight ),
	Y( xvar[I] ),
	Legend( 2 ),
	Show Contours( 1 ),
	Show Data Points( 0 ),
	Fill Areas( 1 ),
	Label Contours( 0 ),
	Color Theme( "Blue White Red" ),
	// You don't need 'Eval(xvar)' here. This usses some contour values from the second variable in 'xvar' for all variables in 'xvar'
	Specify Contours( Min(Column( dt, xvar[i])[3]), Max( Column( dt, xvar[i])[4]), N( 4 ) ),
);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is not perfect.&lt;/P&gt;&lt;P&gt;but&amp;nbsp;I will use this code for a while and try to update it continuously.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 03:25:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Input-multiple-spec-to-contour-plot-using-JSL/m-p/340693#M58909</guid>
      <dc:creator>LBrian</dc:creator>
      <dc:date>2020-12-10T03:25:55Z</dc:date>
    </item>
  </channel>
</rss>

