Can columns be plotted in graph builder be separated by PAGE using a column name categories?The script below plots a few columns (multiple parameters on Y axis) with column names starting with P in Graph Builder. I want to simultaneously plot a few other columns which with column names starting with N in the next PAGE (command commented in my script below).
In the next PAGE I would like to plot a few other columns with column names starting with, say V and so on.
The column category information can come predefined either in a separate data table or in any other form, perhaps a list (I am flexible on that). The question is whether this is doable via JSL and if so how?
Names Default To Here (1);
clear log ();
dt = open( "$SAMPLE_DATA\semiconductor capability.jmp" );
dt << Ungroup Columns();
Graph Builder(Size( 1469, 718 ),
Variables(X( :lot_id ), Y( :PLG2 ), Y( :PNP4 ), Y( :PNP3 ), Y( :PNP2 ), Y( :PNP1 )),
//Page(:ColumCategory)
Elements( Position( 1, 1 ), Box Plot( X, Y, Legend( 14 ) ) ),
Elements( Position( 1, 2 ), Box Plot( X, Y, Legend( 12 ) ) ),
Elements( Position( 1, 3 ), Box Plot( X, Y, Legend( 11 ) ) ),
Elements( Position( 1, 4 ), Box Plot( X, Y, Legend( 9 ) ) ),
Elements( Position( 1, 5 ), Box Plot( X, Y, Legend( 10 ) ) ),
);
Automation and ScriptingWindowsRe: Can columns be plotted in graph builder be separated by PAGE using a column name categories?Page is used for row based grouping, so it cannot be used for what you want to do. You could have a list of columns per each group, then loop over that list while appending separate graph builders to a new window with V List box for example.
Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?Even reformatting the data table doesn't help - the individual Y groups show all items:

If it's just about splitting the column subgroups, you could use a Data Filter instead of Page:

Names Default To Here (1);
clear log ();
dt = open( "$SAMPLE_DATA\semiconductor capability.jmp" );
dt << Ungroup Columns();
dtstacked = dt << Stack(
columns(
:NPN1, :PNP1, :PNP2, :NPN2, :PNP3, :IVP1, :PNP4, :NPN3, :IVP2, :NPN4, :SIT1,
:INM1, :INM2, :VPM1, :VPM2, :VPM3
),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
"Non-stacked columns"n( Keep( :lot_id, :wafer, :Wafer ID in lot ID, :SITE ) )
);
dtstacked << new column("first_Label", Formula( Left( :Label, 1 ) ));
dtstacked << Graph Builder(
Size( 571, 449 ),
Show Control Panel( 0 ),
Fit to Window,
Variables(
X( :lot_id ),
Y( :Data ),
Page( :first_Label ),
Group Y( :Label ),
Color( :Label )
),
Elements( Box Plot( X, Y, Legend( 16 ) ) ),
Local Data Filter(
Add Filter(
columns( :first_Label ),
Where( :first_Label == "N" ),
Display( :first_Label, N Items( 5 ) )
)
)
)Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?@hogi @jthi OK. Thanks. An alternate idea would be to place/send the first graph builder window with a set of columns plotted to a journal window, the next set of new columns plotted under the first and so on and then close open graph windows and associated data tables. How to do this via JSL?
Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?Create list of lists which contain the columns you are interested in and loop over that while building graph builders and appending them to journal / v list box. Are all your columns same in size or does the amount of Y-axis change?
Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?Here is one option, but this isn't the only one you could use
Names Default To Here(1);
create_graph = Function({dt, ycollist}, {Default Local},
vlb = V List Box(
gb = dt << Graph Builder(Variables(X(:lot_id)))
);
For Each({colname, idx}, ycollist,
gb << Add Variable({Eval(colname), Role("Y")});
gb << Add Element(1, idx, {Type("Box Plot"), X, Y}); // define boxplots
gb << Remove Element(1, idx, 1); // remove points
);
return(vlb);
);
my_groups = {{"PNP1", "PNP2", "PNP3"}, {"NPN3", "NPN2", "NPN1", "NPN4"}};
dt = Open("$SAMPLE_DATA\semiconductor capability.jmp");
// could also just create journal and add new_vlb to that
nw = New Window("Collector",
vlb = V List Box()
);
For Each({my_group}, my_groups,
new_vlb = create_graph(dt, my_group);
vlb << Append(new_vlb);
);
nw << journal;
nw << Close Window;
my_j = Current Journal();
Write();Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?If you have different columns for each case/group, you will need to add the JSL to change the value of "my_group" for each change.
You probably can do that by adding an additional For Each() outside of the current For Each( {my_group), where you change the value of my_group before entering back into the current For Each().
I suggest that you give that a try, and if you run into more issues to come back to the Community with more questions.
Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?@jthi Number of columns plotted on y-axis will be different for each case/group.
Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?@jthi @txnelson Thanks.
My parameters to plot is grouped as in the following table. The aim is to append each group below the other in the journal. Also, I would like the group entry to be the chart title for each. How to modify the above JSL in this case?

Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?In your case I would then use associative array in which the key would be group name and values would be list of parameters (columns). Then loop over this associative array using For Each while building your journal
Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?@txnelson @hogi . Thanks for your suggestions. I am back on this topic after a short break.
@jthi Running this part of your script in my JMP 16.2
Names Default To Here(1);
create_graph = Function({dt, ycollist}, {Default Local},
vlb = V List Box(
gb = dt << Graph Builder(Variables(X(:lot_id)))
);
For Each({colname, idx}, ycollist,
gb << Add Variable({Eval(colname), Role("Y")});
gb << Add Element(1, idx, {Type("Box Plot"), X, Y}); // define boxplots
gb << Remove Element(1, idx, 1); // remove points
);
return(vlb);
);
my_groups = {{"PNP1", "PNP2", "PNP3"}, {"NPN3", "NPN2", "NPN1", "NPN4"}};
dt = Open("$SAMPLE_DATA\semiconductor capability.jmp");
// could also just create journal and add new_vlb to that
nw = New Window("Collector",
vlb = V List Box()
);
For Each({my_group}, my_groups,
new_vlb = create_graph(dt, my_group);
vlb << Append(new_vlb);
);gives

i.e.
{"PNP1", "PNP2", "PNP3"} and
{"NPN3", "NPN2", "NPN1", "NPN4"}are not plotted on the y-axis as mentioned in my first post (i.e. one above the other with spec limit ref lines visible) and on two separate charts.
As mentioned above, my parameters to plot are grouped as in the following separate table
Names Default To Here( 1 );
dtg = New Table( "Parameter Groups",
Add Rows( 11 ),
New Column( "Parameter", Character, Nominal,
Set Values( {"PNP1", "PNP2", "NPN2", "NPN3", "INV2", "NPN1", "PNP3", "NPN4", "INV3", "PNP6", "INV4"} ) ),
New Column( "Group", Character, Nominal, Set Values( {"DC", "DC", "AC","AC","RF","AC","DC","AC", "RF", "DC", "RF"} ) )
);I would like the parameters in each chart to be grouped by the entry in the Group column of the above table.
e.g. the Top plot has a tile of DC with "PNP1", "PNP2", "PNP3" and "PNP6" plotted on the y-axis and below it the next chart with title AC with "NPN2", "NPN3", "NPN1" and "NPN4" plotted and finally the third chart at the bottom with title "RF" with "INV2" and "INV4" plotted on the y-axis.
Could I please get some help with the associative array approach to proceed? This way I can get the unique Groups, but how to get the associated Parameters (use Get Rows Where ())?
gg = Associative Array (dt:Group);
gg << get keys;
(@jthi, I prefer your "collector" window option in addition to the journal as it gives we more flexibility depending on what I want to look at)
Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?Using JMP 16, I was able to recreate the issue you are seeing. I failed in using the Add Variables, etc. to get the results you want. However, by using a technique where the Graph Builder JSL is created in a string variable and then executed, I was able to get the box plots

Names Default To Here( 1 );
create_graph = Function( {dt, ycollist},
{Default Local},
theExpr =
"vlb = V List Box(
gb = dt << Graph Builder(Size( 1469, 718 ),Variables(X(:lot_id)";
For Each( {colname, idx}, ycollist,
theExpr = theExpr || ",Y(:\!"" || colname || "\!"n)"
);
theExpr = theExpr || ")";
For Each( {colname, idx}, ycollist,
theExpr = theExpr || ",Elements( Position( 1," || Char( idx ) ||
" ), Box Plot( X, Y) ) "
);
theExpr = theExpr || ");";
Eval( Parse( theExpr ) );
Return( vlb );
);
my_groups = {{"PNP1", "PNP2", "PNP3"}, {"NPN3", "NPN2", "NPN1", "NPN4"}};
dt = Open( "$SAMPLE_DATA\semiconductor capability.jmp" );
// could also just create journal and add new_vlb to that
nw = New Window( "Collector", vlb = V List Box() );
For Each( {my_group}, my_groups,
new_vlb = create_graph( dt, my_group );
vlb << Append( new_vlb );
);Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?@txnelson This works in 16.2 (JMP complains of syntax errors but still plots the chart).
If I have a another list
paraGroupList = {"DC", "AC"};How do I assign DC as chart title (currently PNP1 & 2 more vs. lot_id) when plotting (top chart)
{"PNP1", "PNP2", "PNP3"}and AC as the chart title (currently NPN3 & 3 more vs. lot_id) for when plotting (bottom chart)?
{"NPN3", "NPN2", "NPN1", "NPN4"}Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?Run the graph.
Click on the title and change it.
Then go to the red triangle and select to save the script.
Look in the script and you will see the JSL and how it changed the title.
Adopt it into your script.
I strongly suggest that you take the time to read the Scripting Guide. It will speed up your learning of JSL
Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?@txnelson Thanks, I figured out how to do the chart title.
How to break out of the create_graph function if ycollist is empty?
Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?use the Length() function to check to see if the list has any entries, and then bypass the code;
Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?@txnelson Thanks. It seems I cannot use break () within my plotting function if it is used inside a for loop. I will see what options I have.
Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?Just make the evaluation needed, and if it is not met, then bypass the code. See Below:
Names Default To Here( 1 );
create_graph = Function( {dt, ycollist},
{Default Local},
theExpr =
"vlb = V List Box(
gb = dt << Graph Builder(Size( 1469, 718 ),Variables(X(:lot_id)";
For Each( {colname, idx}, ycollist,
If( Length( colname ) != 0,
theExpr = theExpr || ",Y(:\!"" || colname || "\!"n)"
);
theExpr = theExpr || ")";
For Each( {colname, idx}, ycollist,
theExpr = theExpr || ",Elements( Position( 1," || Char( idx ) ||
" ), Box Plot( X, Y) ) "
);
theExpr = theExpr || ");";
Eval( Parse( theExpr ) );
);
Return( vlb );
);
my_groups = {{"PNP1", "PNP2", "PNP3"}, {"NPN3", "NPN2", "NPN1", "NPN4"}};
dt = Open( "$SAMPLE_DATA\semiconductor capability.jmp" );
// could also just create journal and add new_vlb to that
nw = New Window( "Collector", vlb = V List Box() );
For Each( {my_group}, my_groups,
new_vlb = create_graph( dt, my_group );
vlb << Append( new_vlb );
);Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?@txnelson Thanks. Running the script gives me errors (on JMP 16.2) which I am unable to get rid of.

Re: Can columns be plotted in graph builder be separated by PAGE using a column name categories?Sorry, I rushed to my previous answer. The below JSL will bypass the creation of the graph if the my_group is empty
Names Default To Here( 1 );
create_graph = Function( {dt, ycollist},
{Default Local},
theExpr =
"vlb = V List Box(
gb = dt << Graph Builder(Size( 1469, 718 ),Variables(X(:lot_id)";
For Each( {colname, idx}, ycollist,
theExpr = theExpr || ",Y(:\!"" || colname || "\!"n)"
);
theExpr = theExpr || ")";
For Each( {colname, idx}, ycollist,
theExpr = theExpr || ",Elements( Position( 1," || Char( idx ) ||
" ), Box Plot( X, Y) ) "
);
theExpr = theExpr || ");";
Eval( Parse( theExpr ) );
Return( vlb );
);
my_groups = {{"PNP1", "PNP2", "PNP3"}, {"NPN3", "NPN2", "NPN1", "NPN4"}};
dt = Open( "$SAMPLE_DATA\semiconductor capability.jmp" );
// could also just create journal and add new_vlb to that
nw = New Window( "Collector", vlb = V List Box() );
For Each( {my_group}, my_groups,
If( Length( my_group ) != 0,
new_vlb = create_graph( dt, my_group );
vlb << Append( new_vlb );
vlb = V List Box();
)
);