Hi,
You can follow the steps below.
1. Create the graph window with your template. The window command can be used.
2. Loop all workbooks in the project to add plot to the corresponding layer of the newly create graph.
  2.1 Get the worksheet name by using layer object and define the data range for plotting.
  2.2 Get the prefix and suffix of the worksheet name for deciding which row the data will plot. Many methods are provided for handling with string object.
  2.3 Activate the corresponding layer and add plot to it, then rescale the layer.
The following code may be helpful.
	win -t p temp.otp MyPlot;  // create a graph window using template
	doc -e W  // loop all workbook in the project
	{
		string strName$ = layer.name$; // get the worksheet name
		range rr = 1!col(2);  // data range of column 2
		string strPrefix$ = strName.Left(3)$;  // get the prefix of worksheet name
		string strSuffix$ = strName.Right(1)$;  // get the suffix of worksheet name
		
		int nActive = %(strSuffix$);  // convert suffix to integer
		if(strPrefix$ == "XYZ")  // if prefix is XYZ, plot in the second row
			nActive += 3;
		
		win -a MyPlot;  // activate the graph window
		page.active = nActive;  // activate the layer for plot
		layer.include(rr);  // plot in the active layer
		layer -a;  // rescale the layer		
	}
Penn