Arrange graph layers in mxn configuration
1. layarrange row:=2 col:=3 xgap:=15 ygap:=10; 2. layarrange igp:=graph2 row:=2 col:=2 left:=15 top:=10; 3. layarrange igp:=Graph1 left:=10 right:=5 top:=5 bottom:=12 row:=1 col:=1; //Set margins at four different directions.
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Input Graph | igp |
Input GraphPage |
|
Specifies the graph to manipulate. By default, the active graph is used as input. |
Row | row |
Input int |
|
Specifies the number of rows. |
Col | col |
Input int |
|
Specifies the number of columns. |
X Gap | xgap |
Input int |
|
Specifies the horizontal gap between two adjacent layers. |
Y Gap | ygap |
Input int |
|
Specifies the vertical gap between two adjacent layers. |
Left Margin | left |
Input int |
|
Specifies the left margin of the graph. |
Right Margin | right |
Input int |
|
Specifies the right margin of the graph. |
Top Margin | top |
Input int |
|
Specifies the top margin of the graph. |
Bottom Margin | bottom |
Input int |
|
Specifies the bottom margin of the graph. |
This X-Function can be used to arrange the graph layers into a grid.
/* This example is used to show how to set layer color, rearrange layers, link layers and add axis scrollbar. 1. Import the sample data into a book in Origin; 2. Create a graph of 4 layers; 3. Add plots to the graph and set layer colors; 4. Duplicate the graph and rearrange the layers; 5. Link layers; 6. Add axis scrollbar. */ //Create a new workbook newbook; //Import a file path$ = system.path.program$ + "Samples\Graphing\"; fname$ = path$ + "waterfall2.dat"; impasc; // save the book name as newpanel will change %H string bkname$=%H; //Create a 2*2 panel newpanel 2 2 result:=gpname$; //Add plots and set layer colors for (ii=2; ii<6; ii++) { plotxy iy:=[bkname$]1!wcol(ii) plot:=200 ogl:=[gpname$]$(ii-1); laycolor igp:=[gpname$] layer:=$(ii-1) color:=ii+2; }; //Duplicate the graph and rearrange the layers window -d; layarrange row:=4 col:=1; //Link layers laylink igl:=1 destlayers:="2:0" XAxis:=1; //Add axis scrollbar to layer 1 axis_scrollbar layer:=layer1;