1.2 Graph Templates and Batch Plotting

In this lesson we will learn about graph templates, and also how to perform batch plotting.

Graph Templates

Let's start with the project file we saved in lesson one: My First Graph. Click to select the graph window.

You can quickly open recently-saved project files from the File: Recent Projects list.

  1. Click on the X axis, in the pop-up mini toolbar, click the Show Opposite Axis button to show the Top X axis. Do the same for Y axis to show the Right Y axis.
    Graph Templates Themes and Batch Plotting TM 01.png
  2. Now let's save the graph as a template. Right-click on the graph title bar, and choose Save Template As... from the context menu.
  3. In the dialog, set the Template Name as My Line and click OK to save the template.
  4. We will now generate a new column of data. Activate the worksheet, right-click on the gray area to the right of the columns, and select Add New Column from the context menu.
  5. Click inside the F(x) cell of this column, then right-click and select Open Dialog... from the context menu. You can use the shortcut Ctrl+Q instead of the context menu.
  6. In the dialog, enter the following expression into the top panel:

    Template theme 02.png

    In this dialog, use the Formula: Load Samples menu to view various examples on setting column values. And, the Function menu offers a large selection of functions. You can also search for suitable functions using the search button located in the top right side of the formula edit box.

  7. Click OK to close the dialog and return a dataset of modified moving averages using column B data, starting at row 2. Type MMovAvg into the Long Name cell of the column.
  8. Click on the header of column C to select the entire column. From the menu, choose Plot: My Templates and select the My Line template we created before. A new graph will be created using data from column C.
    Template theme 03.png

Batch Plotting

In this section, we will perform batch plotting by first creating one graph and then cloning that graph using other data.

  1. Go to Project Explorer. In the upper panel, right-click on the root level and choose New Folder.
  2. Name the folder Batch Plotting. Click on the empty folder to open it.
  3. Select Help: Open Folder: Program Folder to open the Origin program folder, find and open the \Samples\Import and Export\ subfolder. Press the Shift key and choose the following three files:
    • S15-125-03.dat
    • S21-235-07.dat
    • S32-014-04.dat
  4. Drag and drop the selected files onto the Origin workspace. The selected files are imported into three new workbooks.
    Template theme 05.png
    Note: To import data files by drag-and-drop, you must not be running Origin as an administrator.
  5. Select one of the workbooks, then click on the header of column B and drag the mouse to column D, selecting all three columns. Then select the menu: Plot > Multi-Panel/Axis: 3Ys Y-YY.

    Origin will look to the left of the selection to find the X column and plot the selected data against the the 1st column in the worksheet.

  6. Right-click on one plot and select Change Plot to: Line from the context menu to change the plot type of selected plot to Line.
    Graph Templates Themes and Batch Plotting TM 02.png
    Click on the plot, in the pop-up mini toolbar, Change the width to 3 by using the the Line Thickness drop-down list Button Border Width.png.
    Graph Templates Themes and Batch Plotting TM 03.png
    Then, do the same for other two plots to get the following line graph.
    Graph Templates Themes and Batch Plotting TM 04.png
  7. Now we will clone this graph using data in the other workbooks. Right-click on the title bar of the graph and select Duplicate(Batch Plotting), and then the Select Workbook dialog will be opened.
  8. In the dialog, set according to the image below. Make sure you highlight the books.

    You can set the Match Plot Columns by drop-down appropriately to find worksheets in the project that match the data configuration of the current graph.

  9. BatchPlotting book.png

  10. Click OK. If prompted to rescale the axes to show all data, answer Yes and click OK. Two similar graphs will be created with data from the other two books.
    Template theme 04.png
  11. From the menu, choose File: Save Project and save your modified project.