<?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: How to use graph builder to graph a matrix in memory in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-use-graph-builder-to-graph-a-matrix-in-memory/m-p/668089#M85623</link>
    <description>&lt;P&gt;I would also create new data table as needed as it is much easier to manage than matrices. With just lists/matrices you would have plot graph with &lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/display-functions.shtml?os=win&amp;amp;source=application#ww2588858" target="_blank" rel="noopener"&gt;Graph Box()&lt;/A&gt; and you would lose out the easy to use Graph Builder&lt;/P&gt;</description>
    <pubDate>Tue, 15 Aug 2023 06:07:33 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2023-08-15T06:07:33Z</dc:date>
    <item>
      <title>How to use graph builder to graph a matrix in memory</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-graph-builder-to-graph-a-matrix-in-memory/m-p/667968#M85613</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I have a script where I am testing out the autocorrelation of two columns in a data table. This is done on the Big Clas.jmp file.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SDF1_0-1692044308055.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55744iD1CF17A2829BE577/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SDF1_0-1692044308055.png" alt="SDF1_0-1692044308055.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I want to add to this script a panel that also shows the graph of the autocorrelation between the two columns -- specifically, I'm trying to graph the column called Lag and the column called Corr vs weight in the Time Series report shown above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I can get those two columns as a list of numbers in a matrix form by using the command &amp;lt;&amp;lt;Get As Matrix to the number column box in the report sub-panel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a variable in memory called LagData, which is:&amp;nbsp;[-39, -38, -37, -36, -35, -34, -33, -32, -31, -30, -29, -28, -27, -26, -25, -24, -23,&lt;BR /&gt;-22, -21, -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5,&lt;BR /&gt;-4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,&lt;BR /&gt;20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And another variable in memory called CorrData, which is:[-0.0647505789131993, -0.0562977495028363, -0.160576535513772, -0.0235481399032656,&lt;BR /&gt;-0.207169184582488, -0.177727203882624, -0.082867673832995, -0.301048676439611,&lt;BR /&gt;-0.18208292918265, -0.12254560898792, -0.249310826860239, -0.088652621497092,&lt;BR /&gt;-0.0624774347722481, -0.137178123667694, -0.136824220987067, -0.144133672506173,&lt;BR /&gt;-0.0234936933370152, -0.117060117438199, 0.00715972346191791, -0.0454901061021466,&lt;BR /&gt;0.045163426704645, 0.0733531363807509, 0.0781580458523421, 0.0903268534092898,&lt;BR /&gt;0.0715972346191779, 0.269592172788486, 0.201125615728702, 0.207931436509992,&lt;BR /&gt;0.240014075672996, 0.198879694870876, 0.242681957419262, 0.29961945407554,&lt;BR /&gt;0.123566482105113, 0.342536959922359, 0.348675810267083, 0.0338521525661397,&lt;BR /&gt;0.352909030793046, 0.122885900026984, 0.0684665570597841, 0.709166525410487,&lt;BR /&gt;-0.132073758081727, 0.239510444935181, 0.186710887313928, -0.0461434648971507,&lt;BR /&gt;0.148366893032136, -0.0517650728624969, -0.0831943532304971, 0.025549051212965,&lt;BR /&gt;0.0530445671693793, -0.0655672774069544, -0.107858647741894, -0.0662478594850834,&lt;BR /&gt;-0.125907684453877, -0.0405899151396176, -0.151470347308405, -0.0967923831515159,&lt;BR /&gt;-0.0551815948947048, -0.136388648457065, -0.141914974931473, -0.158684517336573,&lt;BR /&gt;-0.0462523580296514, -0.0891426405933452, -0.019900219964494, -0.22426540638509,&lt;BR /&gt;-0.0337568710752018, -0.13129789451266, -0.0399637796277388, -0.00593467572128552,&lt;BR /&gt;-0.217418750679112, 0.092137201737113, -0.0450409219305816, -0.106334143886885,&lt;BR /&gt;0.105109096146253, -0.174569303040105, 0.0144827866225865, 0.0175998525404177,&lt;BR /&gt;-0.0346688510598947, 0.0216697333676295, -0.0202813459282462]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I'd like to be able to send these matrices to Graph Builder to get something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SDF1_1-1692044518016.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55745iA7EC67D318B78810/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SDF1_1-1692044518016.png" alt="SDF1_1-1692044518016.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But GB doesn't like that the data is a list of numbers -- it wants the inputs for X() and Y() to be columns. The above example was done by right clicking on the report and selecting Make Into Data Table and then using GB in the normal way. I'd prefer to not have to do that though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to send to GB the data that's in memory instead of as columns? I tried the below code, but it doesn't work.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gb = Graph Builder(
Graph Spacing( 4 ),
Variables( X( LagData ), Y( CorrData ) ),
Elements( Points( X, Y, Legend( 3 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Below is my full code if you're interested.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//GUI for quickly reporting statistics and outlier analysis written by D. Schmidt, ver1.0
Names Default To Here( 1 );
Clear Symbols();
//the width of the column list box in pixels
lbWidth = 150;

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );//Current Data Table();

//Expression to recall roles
RecallRoles = Expr(
	::ycolRecall = ColListY &amp;lt;&amp;lt; GetItems;
	::xcolRecall = ColListX &amp;lt;&amp;lt; GetItems;
	::ALRecall = AlBox &amp;lt;&amp;lt; Get;
	::FPRecall = FPBox &amp;lt;&amp;lt; Get;
);

//Expression to clear roles
ClearRoles = Expr(
	Try(
		ColListY &amp;lt;&amp;lt; Remove All;
		ColListX &amp;lt;&amp;lt; Remove All;
		ALBox &amp;lt;&amp;lt; Set( . );
		FPBox &amp;lt;&amp;lt; Set( . );
	)
);

//User window
ValueDlg = Expr(
	nwin = New Window( "GUI for visualizing cross correlations",
		&amp;lt;&amp;lt;Return Result,
		&amp;lt;&amp;lt;On Validate,
		Border Box( Left( 3 ), Top( 2 ),
			V List Box(
				Outline Box( "Cross Correlations",
					&amp;lt;&amp;lt;Set Font Size( 12 ),
					H List Box(
						Panel Box( "Select Columns",
							ColListData = Col List Box( dt, All, Grouped, width( lbWidth ), nLines( 10 ) )
						),
						V List Box(
							Panel Box( "Cast Selected Columns into Roles",
								Lineup Box( N Col( 2 ), Spacing( 3, 2 ),
									Button Box( "Y, Time Series", ColListy &amp;lt;&amp;lt; Append( ColListData &amp;lt;&amp;lt; Get Selected ) ),
									ColListY = Col List Box( width( lbWidth ), nLines( 2 ), Min Items( 1 ) ),
									Button Box( "Input List", ColListx &amp;lt;&amp;lt; Append( ColListData &amp;lt;&amp;lt; Get Selected ) ),
									ColListX = Col List Box( width( lbWidth ), nLines( 2 ) )
								)
							),
							Panel Box( "Enter values",
								Spacer Box( &amp;lt;&amp;lt;Set Auto Stretching( 1, 1 ) ),
								Lineup Box( N Col( 2 ), Spacing( 5, 3 ),
									Text Box( "Autocorrleation Lags" ),
									ALbox = Number Edit Box( 100, 6 ),
									Text Box( "Forecast Periods" ),
									FPbox = Number Edit Box( 100, 6 )
								),
								Spacer Box( &amp;lt;&amp;lt;Set Auto Stretching( 1, 1 ) )
							)
						),
						Panel Box( "Action",
							Lineup Box( N Col( 1 ),
								Button Box( "OK",
									ycols = ColListY &amp;lt;&amp;lt; Get Items;
									xcols = ColListX &amp;lt;&amp;lt; Get Items;
									AL = ALbox &amp;lt;&amp;lt; Get;
									FP = FPbox &amp;lt;&amp;lt; Get;
									RecallRoles;
									Try( ts &amp;lt;&amp;lt; delete );
									Try( gb &amp;lt;&amp;lt; Delete );
									TSPB &amp;lt;&amp;lt; Append(
										ts = Time Series(
											Y( Eval( ycols ) ),
											Input List( Eval( xcols ) ),
											Cross Correlation( 1 ),
											Autocorrelation Lags( AL ),
											Forecast Periods( FP ),
											Input Series( Eval( xcols ), Autocorrelation Lags( AL ), Forecast Periods( FP ) )
										)
									);
									LagData = nwin[Number Col Box( 8 )] &amp;lt;&amp;lt; Get As Matrix;
									CorrData = nwin[Number Col Box( 9 )] &amp;lt;&amp;lt; Get As Matrix;
									GBPB &amp;lt;&amp;lt; Append(
										gb = Graph Builder(
											Graph Spacing( 4 ),
											Variables( X( LagData ), Y( CorrData ) ),
											Elements( Points( X, Y, Legend( 3 ) ) )
										)
									);
								),
								Button Box( "Cancel/End", nwin &amp;lt;&amp;lt; Close Window ),
								Spacer Box( &amp;lt;&amp;lt;Set Auto Stretching( 0, 1 ) ),
								Button Box( "Remove",
									ColListY &amp;lt;&amp;lt; Remove Selected;
									ColListx &amp;lt;&amp;lt; Remove Selected;
								),
								Button Box( "Recall",
									ClearRoles;
									Try(
										ColListY &amp;lt;&amp;lt; Append( ::ycolRecall );
										ColListx &amp;lt;&amp;lt; Append( ::xcolRecall );
										ALBox &amp;lt;&amp;lt; Set( ::ALRecall );
										FPBox &amp;lt;&amp;lt; Set( ::FPRecall );
									);
								),
								Button Box( "Relaunch",
									nwin &amp;lt;&amp;lt; Close Window;
									ValueDlg;
								),
								Spacer Box( &amp;lt;&amp;lt;Set Auto Stretching( 0, 1 ) ),
								Button Box( "Help", Web( "https://www.jmp.com/en_ch/support/online-help-search.html?q=*%3A*" ) )
							)
						)
					),
					V List Box( H List Box(), H List Box( TSPB = Panel Box( "Time Series", ), GBPB = Panel Box( "Graph", ) ) )
				), 

			)
		), 

	), 

);

ValueDlg;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any thoughts/feedback on how to do this are much appreciated.&lt;/P&gt;&lt;P&gt;Thanks!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 20:32:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-graph-builder-to-graph-a-matrix-in-memory/m-p/667968#M85613</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2023-08-14T20:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to use graph builder to graph a matrix in memory</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-graph-builder-to-graph-a-matrix-in-memory/m-p/668029#M85618</link>
      <description>&lt;P&gt;You will need to move the matrices to a data table to be able to use Graph Builder.&amp;nbsp; The data table will be in memory, so there isn't much difference between the two.&amp;nbsp; I suggest that when creating the new data table, that you specify it as being "private" and then no image of the table will be displayed.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 00:47:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-graph-builder-to-graph-a-matrix-in-memory/m-p/668029#M85618</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-08-15T00:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to use graph builder to graph a matrix in memory</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-graph-builder-to-graph-a-matrix-in-memory/m-p/668089#M85623</link>
      <description>&lt;P&gt;I would also create new data table as needed as it is much easier to manage than matrices. With just lists/matrices you would have plot graph with &lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/display-functions.shtml?os=win&amp;amp;source=application#ww2588858" target="_blank" rel="noopener"&gt;Graph Box()&lt;/A&gt; and you would lose out the easy to use Graph Builder&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 06:07:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-graph-builder-to-graph-a-matrix-in-memory/m-p/668089#M85623</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-08-15T06:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to use graph builder to graph a matrix in memory</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-graph-builder-to-graph-a-matrix-in-memory/m-p/668195#M85632</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I was "afraid" of that. But, as you both pointed out, you can easily make the other data table (and in private) and it works just fine. I appreciate your input on this. I was hoping I could use the matrices, but as&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;said, I would lose the easy use of GB, which I actually want to keep available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you both for your help!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 13:26:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-graph-builder-to-graph-a-matrix-in-memory/m-p/668195#M85632</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2023-08-15T13:26:01Z</dc:date>
    </item>
  </channel>
</rss>

