Plot : 2D : Multi-Panel : Stack
Create a multi-panel stacked graph
1. plotstack iy:=((1,2), (3,4)) plottype:=line; 2. plotstack iy:=((1,2), (3,4)) legend:=combine link:=0; 3. plotstack iy:=((1,2),(1,3),(1,4)) plottype:=custom custom:="203 200" number:="1 2";
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 | iy |
Input XYRange |
|
Specify the input range. |
Plot Type | plottype |
Input int |
|
Specify the plot type.
Option list:
|
Plot Types in Each Layer | custom |
Input string |
|
This variable is only available when the Plot Type is Custom. It specifies the plot types for the plots in each layer. Each plot type has its own value, separated by spaces embedded in double quotes. Click here to get the value of the corresponding plot type. When the number of specified types is less than the number of plots in the layer, the plot types come from the Template. |
Graph Template | template |
Input string |
|
Specify the template for the graph page. If the Plot Type is Use Template, the plot types contained in the template will be used. From Origin2018, both *.otpu and *.otp template types are supported. |
Orientation | portrait |
Input int |
|
Specify the orientation for the graph.
Option list:
|
Stack Direction | dir |
Input int |
|
Specify the stack direction.
Option list:
|
Layer Order | order |
Input int |
|
Specify the order to arrange the layers.
Option list:
|
Legend | legend |
Input int |
|
Specify how to generate the legend for the graph.
Option list:
|
Use Alternate Side to Show Ticks and Labels | alternate |
Input int |
|
Specifies whether to show Axis Ticks and Labels on left and right side (bottom and top) alternately in the graph layers.
Option list:
|
Show One Y/X Axis Title | uniqueYTitle |
Input int |
|
Specify whether to show only one Y/X axis title for all layers.
Option list:
|
Link Layers | link |
Input int |
|
Specify whether to link the layers. |
X Axis Link | xlink |
Input int |
|
This variable is available only when the Link Layers check-box is checked. It specifies how to establish the link between the X axes of all layers.
Option list:
|
Unit | unit |
Input int |
|
This variable is available only when the Link Layers check-box is checked. It specifies the unit for the layers.
Option list:
|
Number of Layers | layer |
Input int |
|
Specify the number of layers. When there is a single X dataset, all Y datasets are plotted to their own layer, and by default, layers equals the number of plots. When there are multiple X datasets, each Y dataset plots against the X dataset nearest to its left, by default. You can customize the default arrangement by manually specifying the number of layers and the number of plots in each layer (Example: plotstack layer:=3 number:="2 2 9"). The number of X columns cannot exceed number of layers. |
Number of Plots in Each Layer | number |
Input string |
|
Specify the number of plots in each layer. You can separate numbers by space to specify the number of plots in each layer one by one. Example: 1 2 3. |
Vertical/Horizontal Gap | gapy |
Input int |
|
Specify the vertical gap (when Stack Direction is Vertical) or the horizontal gap (when Stack Direction is Horizontal(X-Y Axes Exchanged)) between adjacent layers. |
Left Margin | leftmg |
Input int |
|
Specify the left margin of the page. |
Right Margin | rightmg |
Input int |
|
Specify the right margin of the page. |
Top Margin | topmg |
Input int |
|
Specify the top margin of the page. |
Bottom Margin | bottommg |
Input int |
|
Specify the bottom margin of the page. |
Hide Newly Created Graph | hide |
Input int |
|
Specify whether to hide the newly created graph. Note that this option is hidden in the dialog. One can only assign its value through Labtalk script. |
This X-Function plots several ranges into a stacked graph. Plot types can be customized for the plots in each layer and the layers can be stacked vertically or horizontally.
For more information, see Stack Graph in the Origin Help file.
// The plotstack function is used by the Plot : Multi-Curve : // Stack menu option, but has the additional ability to // specify a template newbook; string fn$ = system.path.program$ + "Samples\Graphing\Linked Layers 1.dat"; impasc fname:=fn$; %N = %H; // Create a Stack plot of all columns vs column 1 plotstack iy:=(1,2:end) plottype:=line link:=1 xlink:=1; // Create stack plot of column 2 vs. column 1 and column 4 vs. column 3 win -a %N; plotstack iy:=((1,2), (3,4)) plottype:=column link:=0; // We can specify a template to use, but this template should be a single layer template // as the function loads one instance of the template for each dataset. // Plot Type should match your template if you wish to use its style holder. win -a %N; plotstack iy:=((1,2),(1,3),(1,4)) plottype:=3 template:=column; // Now minimize all worksheets and tile remaining windows doc -e W { win -i; } win -s T; //Tile the windows horizontally