1.4 Merge and Arrange Graphs


In this lesson we will create some graphs, merge them, and then arrange layers in the merged graph. We will also save the graph as a cloneable template to quickly re-create the graph from similar data.

Import data and create graphs

  1. Open the project file we saved in lesson three:Data Selection. In Project Explorer, create a new folder under the root folder and rename it as Merging Graphs. Click on the empty folder to open it.
  2. Click the New Workbook Button New Workbook.png button on the Standard toolbar.
  3. With the blank workbook active, click the Import Single ASCII button Button Import Single ASCII.png on the Standard toolbar. In the file dialog, navigate to the folder <Origin EXE Path>\Samples\Statistics and select automobile.dat. Click Open to import the file.

    You can uncheck the Show Options Dialog check box in the file dialog to prevent the ASCII options dialog from popping up. The default settings will be used next time you import a file into a new book.

  4. Click on the header of column C to select the entire column. Click the Scatter button Button Scatter.png on the 2D Graphs toolbar to create a scatter graph.
  5. Click on the scatter plot to select it, then right-click on the plot and select Change X: [automobile]automobile!G(Y):EnginDisplacement from the context menu to change the X data. A reminder message pops up asking if you would like to rescale the graph. Select Yes and press OK.

    Reminder messages have multiple options. If you select Yes, and do the same in the future, no need to ask again, the dialog will not show again. You can reactivate all reminder messages from the menu Help: Reactivate Reminder Messages.


    Merge and arrange graph 01.png
  6. Select the legend and press the Delete key to delete it.
  7. We will now make copies of this graph and change the data in the copies. First go back to the worksheet, and press the X button on the top right of the title bar, and in the dialog that pops up, select Hide. This simply hides the window from the interface.

    Hidden windows are displayed with a dimmed icon in the lower panel of Project Explorer. You can double-click on the entry to re-open the window.

  8. Right-click on the graph window title bar and select Duplicate to create a copy. Do this two more times, so you end up with four graph windows.
  9. Select the menu Window: Tile Vertically to arrange the 4 graphs without overlap.
  10. Use the Change X/Change Y menu described before, to change X/Y designations for the copy graphs as below, and rescale when promoted:
    • Copy 1: Change Y to [automobile]automobile!D(Y):0^60 mph
    • Copy 2: Change X to [automobile]automobile!E(Y):Weight
    • Copy 3: Change X to [automobile]automobile!F(Y):Gas Mileage
  11. Activate the graph of Power vs. Weight. Let's do some customization. Double-click on the data plot to open the Plot Details dialog. Change the plot properties as follows:
    • Change Symbol Shape to circle and Symbol Color to olive.
    • Set Transparency to 55%.

    Press OK to close the dialog.

  12. Double-click on the Y axis to open the Axis dialog. Change the axis properties as follows:
    • Activate the Tick Labels tab. Press the Ctrl key on the keyboard and click Bottom and Left in the left table to select both axes.
    • In the Display sub-tab, select Engineering:1k for Display.
    • Check the Set Decimal Places check box and set Decimal Number to 0. Press OK to close the dialog.
      Merge and arrange graph 02.png
  13. Now we can copy the customized formats from this graph to the other three graphs. Right-click on a blank area of the graph such as outside the axes, and select Copy Format: All Style Formats from the context menu.
  14. Select Edit: Paste Format (Advanced)... from the main menu. In the Apply Formats dialog that opens, change Apply Scope drop-down at the bottom to All Graphs in this Folder. Click the Apply button to paste the format to the other graph, and then click Close.

Merge and arrange graphs

  1. We will now merge these 4 graphs windows. Select Graph: Merge Graph Windows from the main menu.
  2. The Merge Graph Windows dialog opens. Accept the default settings and click OK. A new graph window with 4 layers is generated.
  3. Now we will re-arrange the 4 layers in the merged graph. Select Graph: Layer Management from the main menu. The Layer Management dialog will open.
  4. Activate the Arrange tab, then expand the Spacing (in % of Page Dimensions) branch. Set as follows:
    • Horizontal Gap = 15
    • Vertical Gap = 15
    • Left Margin = 10
    • Right Margin = 5
    • Top Margin = 5
    • Bottom Margin = 15
      Click the Apply button.
  5. Activate the Display tab. Press the Ctrl key on the keyboard and select all 4 layers in the Layer Selection table on the left. Then select the Scale Elements checkbox under the Option branch. Set Scale Mode to Fixed Factor and set the Fixed Factor to 1.
  6. If you drag and resize a graph layer, or the layer gets resized when merging, text fonts and other graph objects get rescaled. You can control this behavior at the layer level of the Plot Details dialog by clicking on the Display tab and modifying the settings in the Scale Elements group.

  7. Click the Apply button. Click OK to close the dialog.
    Merge and arrange graph 03.png
    The merged graph should now appear as below:
    Merge and arrange graph 04.png
  8. Activate the automobile workbook by double-clicking on the icon in the lower panel of Project Explorer. Select column B, then right click and select Filter: Add or Remove Filter to add a filter.
  9. Click on the filter icon at the top-left corner of the column header. In the context menu that appears, click Select All once to de-select all items, and then select the Honda checkbox and click OK, to only show rows where Make is Honda. All other rows will be hidden, and all graphs will update to reflect the change in the data.
    Merge and arrange graph 05.png

Cloneable Template and Smart Plotting

  1. Let us now save the final merged graph as a template. Right click on its window title bar and select Save Template As. This will open the template_saves dialog.
  2. Make sure Mark as Cloneable Template is selected and Match Plot Columns by is set to Long Name. Enter MyMergeGraph for Template Name and click OK. A message is dumped to the Message Log telling you the template is saved.

    Cloneable Templates save the column positions or column names along with all other graph properties. This allows for duplication of complex graph arrangements from other data with same arrangement of column positions or names.

  3. Activate the automobile workbook. Select the filter on column B and select both Honda and Lexus and click OK to show both makes.
  4. With the book still active, select Plot > Templates User: MyMergeGraph from the main menu. A new graph is created, with the same data assignments and formats as present in the previous merged graph.
  5. Save your project file.