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
Neo
Neo
Level VI

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 ) ) ),
);

 

 

 

When it's too good to be true, it's neither
19 REPLIES 19
jthi
Super User

Re: 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.

-Jarmo
hogi
Level XII

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:

hogi_1-1703320341266.png

 

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

 

hogi_0-1703320222168.png

 

 

 

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 ) )
		)
	)
)
Neo
Neo
Level VI

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?

When it's too good to be true, it's neither
jthi
Super User

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?

-Jarmo
jthi
Super User

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();
-Jarmo
Neo
Neo
Level VI

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.

When it's too good to be true, it's neither
txnelson
Super User

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.

 

Jim
Neo
Neo
Level VI

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?

Neo_0-1703689473566.png

 

When it's too good to be true, it's neither
jthi
Super User

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

-Jarmo