OriginLab Corporation - Data Analysis and Graphing Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis     
 
Skip Navigation Links
All BooksExpand All Books
TutorialsExpand Tutorials
GraphingExpand Graphing
LayersExpand Layers

6.4.2 Merging and Arranging Graphs

Summary

The Merge Graph Windows dialog allows you to select which graphs you wish to combine, choosing from any graph in the project. It also has controls to specify how you want the individual graphs arranged on the new page.

The Object Edit toolbar allows you to quickly align and size multiple layers.

The Layer Management dialog lets you add, arrange and link layers on a single graph page.


What you will learn

This tutorial will show you how to:

  • Resize and align layers quickly
  • Add a second axis using a nonlinear relationship with the primary axis
  • Use Layer Management for more complex layer positioning and linking
  • Merge multiple graphs into one graph

Aligning Layers using the Object Edit Toolbar

  1. Select File:Open and open the OPJ \Samples\Graphing\Layer Management.opj and go to the subfolder Arranging Layers. (If you don't see the subfolders, click View: Project Explorer to open the Origin Project Explorer window.)
  2. We want to use the Object Edit tools to rearrange the graph so make sure that this toolbar is visible. If it is not, you can open it from the View: Toolbars dialog box.
    Tutorial81 Merging and Arranging Graphs Object Toolbar.png
  3. On the graph, hold the Shift key down and click on all four layers to select them as a group. Press the Uniform Width Button Uniform Width.png and Uniform Height Button Uniform Height.png buttons on the Object Edit toolbar to apply a uniform height and width. Then click on the white space in the layer to deselect all graph layers.
  4. Hold Shift key to click and select the bottom two layers and then click the Bottom Button Bottom.png button on the Object Edit toolbar to align them. Click on the white space in the layer to deselect all graph layers.
  5. Hold Shift key to click and select the top two layers, then click the Top Button Top.png button to align them. Click on the white space in the layer to deselect all graph layers.
  6. Click and select the top and bottom in the left column, and click the Left align Button Left.png. Click on the white space in the layer to deselect all graph layers.
  7. Click and select the two in the right column and click the Right align Button Right.png button.

    The Object Edit toolbar provides a quick way to align and resize layers. The first layer you select is the reference layer and all others are adjusted relative to the first-selected layer. The Layer Management tool provides additional options such as layer reordering and linking.

  8. Do not save changes to your project, as the same project will be used later to demonstrate the usage of Layer Management.

Displaying Opposite Axes with a Nonlinear Formula

An Origin 2D graph layer is a set of X, Y axes, and opposite axes can be turned on for both X and Y. In addition, the opposite axes can also display labels using any user-specified nonlinear formula with respect to the primary axis.

  1. Using the Project Explorer window, switch to the subfolder named Nonlinear Axis.
  2. With the graph active, bring up the Layer Management tool by selecting Graph: Layer Management.
  3. Switch to the Axes tab and expand the Top branch and check the Axis, Title, and Tick Label check boxes.
  4. We want to display the labels on the top axis in units of Energy and the relationship between wavelength and energy is:
    Energy (eV) = 1240/Wavelength (nm)
    So in the Formula box, enter: 1240/x and click Apply, then click OK to close the dialog.
    Tutorial81 Merging and Arranging Graphs LM Top Axis.png
    • If you are setting up a nonlinear relationship for the right Y-axis, in the Formula you still need to use x instead of y.
    • You can also do similar settings in the Axis dialog to add such opposite axis:

    Merging and Arranging Graphs 001.png

  5. Double-click and edit the top X-axis title and change it to: Energy (eV)
    Tutorial81 Merging and Arranging Graphs Change Title.png
  6. In the above image, the first tick label of the top axis is a missing value for energy that corresponds to zero wavelength. To hide it, double-click the top axis labels or axis, to open the Axis dialog. Go to the Special Ticks tab in Top icon. Then select Hide in the Axis Begin drop-down list. Click OK to apply the settings and close the dialog.
    Tutorial81 Merging and Arranging Graphs Hide Tick.png

Using Layer Management to Link and Position Layers

The Layer Management tool can be used to position, resize, swap, and link layers:

  1. Reopen the project \Samples\Graphing\Layer Management.opj and then switch to the subfolder named Arranging Layers. You can reopen the project by selecting File: Recent Projects: Layer Management.opj. Do not save changes to the project.
  2. Bring up the Layer Management tool from Graph: Layer Management. In the left panel, rename the layers so that they are, top to bottom: Peak 3, Peak 2, Peak 4, Peak 1. The layer names now correspond to the legend for each layer.
    Note: To rename a layer, double-click on the name.
    Tutorial81 Merging and Arranging Graphs LM Left Panel.png
  3. Now drag and arrange the list on the left so that they are ordered Peak 1, Peak 2, Peak 3, Peak 4. The layer number and names now match.
    Tutorial81 Merging and Arranging Graphs LM Drag Layers.png
  4. Now switch to the Arrange tab and do the following:
    1. Check Show Axes Frame.
    2. Set Horizontal Gap and Vertical Gap to 0.
      Tutorial81 Merging and Arranging Graphs Arrange Tab.png
    3. Click Apply.

    This resizes and repositions the layers so they are aligned, and hides ticks and labels where layers overlap.

  5. Go to the Axes tab, hold down the CTRL key and select Peak 1 and 3 on left list, then expand the Left branch and set tick direction to In, and click Apply.
    Tutorial81 Merging and Arranging Graphs Axes Tab.png
  6. Now select Peaks 3 and 4, set the Bottom tick direction to In and click Apply. Then select Peaks 1 and 2, set the Top ticks to In and click Apply.
  7. go to the Link tab and select Peaks 2, 3, and 4 in the left list and link them to layer 1, making sure you have the X-Axes linked Straight(1 to 1), and click Apply.
    Tutorial81 Merging and Arranging Graphs Link Tab.png
    Click OK to close the dialog box.
  8. Click and select the top left layer, layer 1, then drag and resize the layer, then move the layer. Note that the child layers resize and move too, since they are dimensionally linked to layer 1.
    Tutorial81 Merging and Arranging Graphs Resize Layer.png
  9. Go to the top left layer (layer 1), and double-click the top X-axis. In the X-Axis dialog, change the X-Axis scale From 10 To 35, and click OK. You'll see that all the other layers now display the same X-axis scale range.
    Tutorial81 Merging and Arranging Graphs Link X Axis.png

If the layers are linked, they are treated as one unit. If you need to rearrange layers, you should first unlink them. You can re-link layers after arranging.

Merge Multiple Graphs

In this section, we merge two graphs from different subfolders of the same project while treating the four layers in one graph as a unit.

  1. Click on the Rescale button when the Graph 1 in the Arranging Layers subfolder is active.
  2. Select Graph: Merge Graph Windows in the main menu to open the dialog.
  3. Do the following:
    • From the Merge drop-down list, choose All in Project. Graph1 and Graph2 will show in the Preview panel.
    • Make sure Number of Rows = 2 and Number of Columns = 1.
    • Make sure Treat Each Source Graph As a Unit is selected.
    • Set the Vertical Gap to 20.
    Merging Graphs01.png
  4. Click OK to close the dialog box. A new merged graph page is created:
    Merging Graphs02.png
     

    © OriginLab Corporation. All rights reserved.