6.1.5 Plot from User Defined Graph Template
In this tutorial, we will show you how to save a graph as an user-defined template and plot new data into the saved custom template. There are two types of graph templates available in Origin: standard template and cloneable template. Cloneable template can be easily used to clone a graph from a new workbook/worksheet, in spite of the complexity of data composition in target graph, but with one prerequisite that new data should share same data structure with the data in target graph. In comparison, standard template has more freedom over data source but lacks of the ability to duplicate a graph with complicated layer hierarchy or data structure.
This tutorial will show you how to:
- Create and save a graph as standard template
- Plot new data into a standard template
- Save a graph as cloneable template
- Plot data with same data structure into a cloneable template
Create and Save a Standard Graph Template
This tutorial is associated with <Origin EXE Folder>\Samples\Tutorial Data.opj.
- Open the Tutorial Data.opj and browse to the folder Custom Axis Scale to Show Different Scale Range.
- Highlight column B Exothermic Energy and C Energy-SD, click scatter button on 2D Graphs toolbar to make a scatter plot with Y error bar.
- Next we want to customize the symbol to be solid circle with blue color, to do so double-click on any data point on the graph to bring up Plot Details - Plot Properties dialog.
- Make sure first plot under Layer1 branch is selected on the left panel. Go to Symbol tab. Select solid circle from the down-sided triangle button under Preview and set Symbol Color to be Blue in the Single tab of Color Chooser. Click OK.
- To save it as standard template, right click on Graph1 window title bar and select Save Template As... to open dialog.
- Input BlueCircle as Template Name and add some descriptions Blue solid circle in Template Description edit box.
- If you want preset the long name of newly created graphs to be the first plot's long name, click the more options button next to Preset Graph Long Name edit box and select @LL: Long Name. %(1,@LL) will show as Preset Graph Long Name.
- Make sure Mark as Cloneable Template box is unchecked, click OK button to save it as standard template.
Plot New Data into Standard Template
- Go back to workbook, highlight columns Temperature and Temperature-SD and go to menu Plot: Templates: User: BlueCircle (UserDefined) to make the graph. The graph window long name is Temperature.
Save Graph as a Cloneable Template
- Press F11 key or select Help: Origin Central to open the Origin Central dialog. Select Graph Sample in the left-side panel, and select Smart Plotting with Cloneable Template from the Samples in drop-down list.
- In the graph list, double-click on the 4th graph to open the Raman Spectrum subfolder.
- Graph Raman Spectrum is plotted from data in different worksheets of workbook Peak1 also with data labeling. It's hard to plot new data like this with one click using standard graph template. So let's save this graph as a cloneable template and clone this graph using data in workbook Peak2.
- To do so, right click on graph Raman Spectrum window title bar and select Save Template As... to open Utilities\File: template_saveas dialog.
- Input MyPeakTemplate as Template Name. Now we want to use Raman Spectrum + Workbook Long Name as graph Long Name. To do so, click more options button next to Preset Graph Long Name edit box and select @WL: Book Long Name to insert the right part first. Then input Raman Spectrum in front of added %(1, @WL).
- Make sure Mark as Cloneable Template box is checked, expand this node you can choose how to match up the columns and worksheets by Match Column by and Match Sheet by drop-down option. Now select Index from Match Column by drop-down list.
- Click OK button to exit the dialog and save the template.
Clone a Graph Using Cloneable Template
- Activate workbook with title Peak2, click template library button to bring up the dialog.
- Click to select the cloneable template (indicated by Dolly icon) MyPeakTemplate and click Plot button to clone the graph.
- Alternatively you can activate workbook Peak2 and go to menu Plot: Templates: User: MyPeakTemplate (UserDefined) to directly clone the graph.