2.5.36 merge_graph

Menu Information

Graph: Merge Graph Windows

Brief Information

Merge selected graph windows into one graph

Command Line Usage

1. merge_graph option:=open;

2. merge_graph row:=2 col:=3 newlayer:=1 keep:=0;

3. merge_graph option:=project topm:=7 bottommg:=15;

4. merge_graph option:=specified graphs:="graph1"+char(10)$+"graph2";

5. merge_graph option:=project row:=3 col:=1 resizewidthbyscale:=1 width:=11.41 height:=7.973 unit:=inch;

6. merge_graph option:=folder row:=2 col:=1 aspectratio:=1 width:=11.41 height:=7.973 unit:=inch labeltext:=custom labelcustom:=(a$) labelposition:=tro;

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
Merge option

Input

int

<auto>
Specifies the option for selecting the graphs.

Option list:

  • page:Active Page
    All graphs in the active page.
  • folder:All in Active Folder
    All graphs in the active folder, excluding those in the subfolders.
  • recursive:All in Active Folder (Recursive)
    All graphs in the active folder, including those in the subfolders.
  • open:All in Active Folder (Open)
    All open graphs in the active folder.
  • embed:All in Active Folder (Include Embedded)
    All graphs in the active folder, including the embedded graphs.
  • project:All in Project
    All graphs in the current project.
  • specified:Specified
    Graphs specified by the graphs variable.
Graphs graphs

Input

string

<auto>
Specifies the graphs to be merged. This variable is available only when "specified" is selected for the option variable. Note that any two adjacent graph names should be separated by a "/n" character. In the dialog, you can enter each graph name in a separate row.
Keep Source Graphs keep

Input

int

1
Specifies whether or not to keep the source graphs after the merging is performed.
Rearrange Layout arrange

Input

int

1
Specifies whether to rearrange the layers that belong to graphs that include multiple layers.
Number of Rows row

Input

int

<auto>
Specifies the number of rows in the new graph. The graphs will be arranged on a row by col grid in the new window.
Number of Columns col

Input

int

<auto>
Specifies the number of columns in the new graph. The graphs will be arranged on a row by col grid in the new window.
Direction dir

Input

int

0

Specifies the direction for arranging graph layers.

Option list:

  • 0=horz:Horizontal First
    Arrange layers in horizontal direction first
  • 1=vert:Vertical First
    Arrange layers in vertical direction first
Use Alternate Side to Show Ticks and Labels alternate

Input

int

0

Specifies whether to show Axis Ticks and Labels on left and right side (bottom and top) alternately in the graph layers.

Option list:

  • 0=false
  • 1=true


Note: This variable is only available in Stack graph. That means either the Number of Rows or Number of Columns must be 1, but not both to be 1.
When Number of Columns=1 and Number of Rows>1, the layers are stacked in vertical, and the layers shows Y axis on left and right alternately.
When Number of Rows=1 and Number of Columns>1, the layers are stacked in horizontal, and the layers shows X axis on bottom and top alternately.

Add Extra Layer(s) for Grid newlayer

Input

int

0
Specifies whether to add new layers for empty grids, when the number source graphs is less than the product of the values of the row variable and the col variable.
Keep Layer Aspect Ratio aspectratio

Input

int

0
Specifies whether to keep the original aspect ratio of the graph layers.
Treat Each Source Graph as a Unit groupgraph

Input

int

1
When this variable is set to 1, all layers from the same source graph are treated as a unit when merging graphs. Unlinked layers in the source graph will be linked to the original Layer1. Set this variable to 0 in order to disable such behavior.
Link Source Graphs linkarrange

Input

int

0
Specify whether to link all unlinked layers to Layer1 in the merged graph. Linked layers remain linked to the layer they were linked to before merging.
Set Layer Width by Common Scale resizewidthbyscale

Input

int

0
The width of each layer is determined using a common scale. For instance, when drawing stacked bar charts, establishing a common scale allows direct visual comparison of bar length across layers. By contrast, when this option is not enabled, two axes with the same physical dimensions may display very different scale ranges.
Set Layer Height by Common Scale resizeheightbysale

Input

int

0
The height of each layer is determined using a common scale. For instance, when drawing stacked column charts, establishing a common scale allows direct visual comparison of column height across layers. By contrast, when this option is not enabled, two axes with the same physical dimensions may display very different scale ranges.
Show Axes Frame smartarrange

Input

int

0
Specify whether to show axes frame and hide axes/ticks of graphs when axes/ticks are overlapping.
Unit spaceunit

Input

int

0
Specifies the unit of gaps and margins in the new graph page.

Option list:

  • percent:% of Page
    % of Page.
  • inch:inch
    inch.
  • cm:cm
    cm.
  • mm:mm
    mm.
  • pixel:pixel
    pixel.
  • point:point
    point.
Horizontal Gap xgap

Input

int

2
Specifies the horizontal gap between adjacent layers.
Vertical Gap ygap

Input

int

2
Specifies the vertical gap between adjacent layers.
Left Margin leftmg

Input

int

5
Specifies the left margin to the new graph page.
Right Margin rightmg

Input

int

5
Specifies the right margin to the new graph page.
Top Margin topmg

Input

int

5
Specifies the top margin to the new graph page.
Bottom Margin bottommg

Input

int

5
Specifies the bottom margin to the new graph page.
Orientation portrait

Input

int

2
Specifies the orientation for the new graph page.

Option list:

  • landscape:Landscape
    Landscape.
  • portrait:Portrait
    Portrait.
  • auto:Auto
    Auto.
Width width

Input

double

<auto>
Specifies the width of the new graph page.
Height height

Input

double

<auto>
Specifies the height of the new graph page.
Unit unit

Input

int

<auto>
Specifies the unit for the new graph page.

Option list:

  • inch:inch
    inch.
  • cm:cm
    cm.
  • mm:mm
    mm.
  • pixel:pixel
    pixel.
  • point:point
    point.
Scale Mode scalemode

Input

int

0
Specifies how the axes, axes labels, legend, data plots, and other objects that are attached to the Layer Frame or Layer and Scales are affected when a layer in the new graph page is resized.

Option list:

  • source:Auto
    Uses the settings in the source graphs.
  • frame:Scale with Layer Frame
    Scales the layer elements proportionally with the layer.
  • fixed:Fixed Factor
    Determines the size of the layer elements relative to their original size (font size, symbol size, and line width, etc.).? The size of these elements is determined by multiplying their original size by the scale factor specified by the fixfactor variable?
Fixed Factor fixfactor

Input

double

1
This variable is available only when the scalemode variable is set to "Fixed Factor". It specifies the fixed scale factor.
Label Text labeltext

Input

int

0
Determine what kind of labels should be added to each graph in the merged one.

Option list:

  • none:None
    Labels will not be added to graphs.
  • capitalA:A
    Use capital letters in alphabetic order as labels (e.g. A, B, C...)
  • a:a
    Use lower case letters in alphabetic order as labels (e.g. a, b, c...)
  • custom:Custom
    Define custom labels. The labelcustom variable is used to define the custom label texts.
Custom labelcustom

Input

string

Graph##
Only available when the labeltext is set as custom. Specify the custom label texts. Substitution notation and enumeration code are supported.

For enumeration code, %(u$) and %(v$) enumerate uppercase and lowercase letters. $(i) and # enumerate index. %(p$) represents character #. More details about this custom drop-down list, please refer to the Origin Help page.

Label Position labelposition

Input

int

0
Specify the position of graph labels in each graph layer.

Option list:

  • tlo:Top Left Outside
  • tli:Top Left Inside

Description

This X-Function merges the specified graphs into a new graph window. In the new graph, the source graphs are arranged in a row by col grid.

Examples

In the following example, we merge two graphs (Graph1 and Graph2) into a new graph page:

  1. From the Origin menu, select Graph: Merge Graph Windows. This opens the dialog of the merge_graph X-Function.
  2. In the dialog, select Specified with the Merge drop-down list. Click the Browse Merge graph help English files image002.jpg button to the right of the Graphs edit box to open the Graph Browser dialog. Select Graph1 and Graph2 and click OK to close the Graph Browser dialog.
  3. Click the OK button in the merge_graph X-Function dialog to close the dialog of the X-Function and perform the merging.

Related X-Functions

g2layout, layadd, laysetunit, laylink


Keywords:combine