OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

plotstack


Contents

Menu Information

Stack

Brief Information

Plot stacked graph

Additional Information

Minimum Origin Version Required: 8.1 SR1

Command Line Usage

  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";

Variables

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

Input

XYRange

<active>
Specify the input range.
Plot Type plottype

Input

int

0
Specify the plot type.

Option list:

  • line:Line
    Line plot.
  • scatter:Scatter
    Scatter plot.
  • linesymb:Line+Symbol
    Line+Symbol plot.
  • column:Column
    Column plot.
  • template:Use Template
    Use the plot types in the specified template (Specified in Graph Template) for the plots in each layer. Suppose the number of plot types in the specified template is n, and the maximum number of plots in each layer is m. If n is not less than m, the first m plot types in the template will be used. Or all plot types in the template will be used for the first n plots, and the other plots will use the last plot type in the template.
  • custom:Custom
    Use the plot types specified by the custom variable.
Plot Types in Each Layer custom

Input

string

200
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, just type the values and separate them by space. Click here to get the value of the corresponding plot type. When the number of the specified plot types doesn't equal to the number of plots in the layer, the way to use the plot types will be the same as the one when the Plot Type is Use Template.
Separate types (200=Line, 201=Scatter...) by space. Example: 200 201 202

Input

string

This is a hint text that will appear on the dialog.
Graph Template template

Input

string

stack
Specify the template for the graph page. If the Plot Type is Use Template, the plot types contained in the template will be used.
Orientation portrait

Input

int

1
Specify the orientation for the graph.

Option list:

  • landscape:Landscape
    The orientation for the graph is landscape.
  • portrait:Portrait
    The orientation for the graph is portrait.
Stack Direction dir

Input

int

0
Specify the stack direction.

Option list:

  • vertical:Vertical
    All layers are stacked vertically.
  • horizontal:Horizontal(X-Y Axes Exchanged)
    All layers are stacked horizontally. Note that the X-Y axes will be exchanged.
Layer Order order

Input

int

1
Specify the order to arrange the layers.

Option list:

  • top:Top to Bottom/Left to Right
    The layers will be arranged from top to bottom (when Stack Direction is Vertical) or from left to right (when Stack Direction is Horizontal(X-Y Axes Exchanged)) so that the first layer is on top or on left of other layers.
  • bottom:Bottom to Top/Right to Left
    The layers will be arranged from bottom to top (when Stack Direction is Vertical) or from right to left (when Stack Direction is Horizontal(X-Y Axes Exchanged)) so that the last layer is on top or on left of other layers.
Legend legend

Input

int

1
Specify how to generate the legend for the graph.

Option list:

  • none:No Legend
    There will be no legend in the graph.
  • seperate:Legend for Each Layer
    Separate legend will be generated for each layer.
  • combine:One Legend for All
    Data plots from all layers are included in the legend for the graph.
Link Layers link

Input

int

1
Specify whether to link the layers.
X Axis Link xlink

Input

int

1
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:

  • none:None
    Does not create link between the X axes scales.
  • straight:Straight(1 to 1)
    Creates a link in which the child layers' X axes mirror the scale values of the parent layer.
Unit unit

Input

int

6
This variable is available only when the Link Layers check-box is checked. It specifies the unit for the layers.

Option list:

  • page:% of Page
    This unit is useful for maintaining the same layer size relative to the page size. When this unit is selected, the left, top, height, and width of the layer are in percentage of the graph page height and width.
  • inch:inch
    When this unit is selected, the left, top, height, and width of the layer are measured in inch.
  • cm:cm
    When this unit is selected, the left, top, height, and width of the layer are measured in cm.
  • mm:mm
    When this unit is selected, the left, top, height, and width of the layer are measured in mm.
  • pixel:pixel
    When this unit is selected, the left, top, height, and width of the layer are measured in pixel.
  • point:point
    When this unit is selected, the left, top, height, and width of the layer are measured in point.
  • link:% of Linked Layer
    This unit allows you to specify the frame dimensions and offsets for a child layer in terms of the dimensions of the parent layer frame. When this unit is selected, the left, top, height, and width of the layer are in percentage of the height and width of the parent layer frame.
Number of Layers layer

Input

int

<auto>
Specify the number of layers. The default number equals to the number of plots.
Number of Plots in Each Layer number

Input

string

1
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.
Separate numbers by space. Example : 1 2 3

Input

string

This is just a hint text that will appear on the dialog.
Actual number of plots in each layer :

Input

string

This is a read-only text in the dialog that shows the actual number of plots in each layer.
Vertical/Horizontal Gap gapy

Input

int

0
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

15
Specify the left margin of the page.
Right Margin rightmg

Input

int

10
Specify the right margin of the page.
Top Margin topmg

Input

int

10
Specify the top margin of the page.
Bottom Margin bottommg

Input

int

10
Specify the bottom margin of the page.

Description

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.

Examples

  1. Import the file <Origin Installation Directory>\Samples\Graphing\Linked Layers 1.dat to a new book.
  2. Highlight all the columns and select menu Plot: Multi-Curve: Stack... or type plotstack -d; in the command window to bring up the plotstack dialog.
  3. Click the triangle button in the upper right corner and select System Default to set all the parameters to the system default values.
  4. Change the Plot Type to Custom and then type 203 200 in the Plot Types in Each Layer text box. In the Plot Assignment branch, set the Number of Plots in Each Layer as 1 1 1 1 2. Keep other settings as they are.
    Image:Plotstack_example_1.png
  5. Click the OK button to create a stacked graph. On this graph, double click on the bottom X axis to open the Axis Properties dialog. Activate the Custom Tick Labels tab and set Rotation (degree) to 75. Click the OK button to close this dialog.
    Image:Plotstack_example_2.png
  6. Apply the same setting to the top X axis as what we have done in the previous step.
  7. Double click on the left Y axis of Layer 5. In the pop-up dialog, activate the Custom Tick Labels tab and select the Hide radio button in the At Axis Begin row. Click the OK button to close this dialog.
    Image:Plotstack_example_3.png
  8. Apply the same setting to the left Y axis of Layer 2 and 3 as what we have done in the previous step.
  9. The final stacked graph is shown as follows:
    Image:Plotstack_example_4.png

Related X-Functions

newpanel