2.5.17 layarrange

Brief Information

Arrange graph layers in mxn configuration

Command Line Usage

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.

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input Graph igp

Input

GraphPage

<active>

Specifies the graph to manipulate. By default, the active graph is used as input.

Row row

Input

int

<unassigned>

Specifies the number of rows.

Col col

Input

int

<unassigned>

Specifies the number of columns.

X Gap xgap

Input

int

5

Specifies the horizontal gap between two adjacent layers.

Y Gap ygap

Input

int

5

Specifies the vertical gap between two adjacent layers.

Left Margin left

Input

int

15

Specifies the left margin of the graph.

Right Margin right

Input

int

15

Specifies the right margin of the graph.

Top Margin top

Input

int

15

Specifies the top margin of the graph.

Bottom Margin bottom

Input

int

15

Specifies the bottom margin of the graph.

Description

This X-Function can be used to arrange the graph layers into a grid.

Examples

  • Code Sample
/*
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;

Related X-Functions

laymanage, laysetpos, layalign