cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
mpanggabean
Level II

How to use JSL to dynamically pass Bivariate Plots to Journal (having issue to Journal)

Hi JMP Community,

 

I have a script that populates two sets of columns to two different lists. 

  • set1_list  & set2_list

Then I iterate through the list of column names from both sets and when these match (partially via regex) I do a Y by X plot. -- this is fine.

 

The individual bivariate plots are being populated but not appended to journal.

- I can do it manually but there are very many plots (order of 100s to 1000s)

- Tried to mimic parts of other examples where there are two journals (temp = xx, and main "sample journal" )  

JSL - Adding a Table to a Journal 

- Tried looking at my older scripts  where this worked (pushed to the journal). Yet, I'm not clear what I'm missing.  In such cases had this portion of code look like below where newplot is similar to current example

Current Journal( "Y_vs_X" );
Report( newplot ) << Journal( "Y_vs_X" );
		

 

 

I'm including a good portion of the script below/attached. Though not params or data table included here. I think a pro will quickly spot the mistake, so I can avoid repeating this and have a better understanding.

 

 

//Match parameters that are common between set 1 and set 2 to do bivariate plot and push to journal
For( v = 1, v <= Count_set1, v++,
	Titlex = Char( set1_list[v] );
	If( Pat Match( Titlex, Regex( Titlex, "([\w.+])(.+)(\:)(.+)(\:)(.+)", "\1\2\3\4" ) ),
		matchone = Regex( Titlex, "([\w.+])(.+)(\:)(.+)(\:)(.+)", "\1\2\3\4" ), 
					
	);
	
	For( w = 1, w <= Count_set2, w++,
		Titley = Char( set2_list[w] );
		If( Pat Match( Titley, Regex( Titley, "([\w.+])(.+)(\:)(.+)(\:)(.+)", "\1\2\3\4" ) ),
			matchtwo = Regex( Titley, "([\w.+])(.+)(\:)(.+)(\:)(.+)", "\1\2\3\4" ), 

		);
		
		
			
		If(
			matchone == matchtwo,
				newplot = mydataTable << Bivariate(
					X( :As name( Titlex ) ),
					Y( :As name( Titley ) ),
					SendToReport(
						Dispatch(
							{},
							"Bivar Plot",
							FrameBox,
							{Add Graphics Script(
								2,
								Description( "" ),
								Pen Color( "blue" );
								Y Function( x, x );
							), Grid Line Order( 1 ), Reference Line Order( 3 ), DispatchSeg(
								TopSeg( 1 ),
								{Set Script(
									Pen Color( "blue" );
									Y Function( x, x );
								)}
							)}
						)
					),
					rep_plot = newplot << report;
				
					invisible, 

				), 
					 
			Wait( 0.01 ),
			tmpjrnl = New Window( "temp_journal", <<journal );
			rep_plot << journal;
			hlb << append (tmpjrnl);
			tmpjrnl << close window;
		
			
		, 

		);, 

	);
);

Print( "This is the end, the script has finished running..." );			

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
mpanggabean
Level II

Re: How to use JSL to dynamically pass Bivariate Plots to Journal (having issue to Journal)

Actually I found my mistake was using a "," after the Wait statement.
Replacing it with a ";" and below resolved the problem

Wait( 0.01 );
newjrnl << append(Report( current_plot_new ));

View solution in original post

1 REPLY 1
mpanggabean
Level II

Re: How to use JSL to dynamically pass Bivariate Plots to Journal (having issue to Journal)

Actually I found my mistake was using a "," after the Wait statement.
Replacing it with a ";" and below resolved the problem

Wait( 0.01 );
newjrnl << append(Report( current_plot_new ));