Origin - Tutorial - 2019 - E Mnual PDF
Origin - Tutorial - 2019 - E Mnual PDF
Table of Contents
Tutorials for Origin ..................................................................................................................................... 1
1 Getting Started............................................................................................................................... 1
1.7 Gadgets....................................................................................................................................... 20
1.10 Statistics.................................................................................................................................. 28
4.2 Gadgets....................................................................................................................................... 58
5 Statistics ....................................................................................................................................581
iii
Tutorials for Origin
6 Graphing ....................................................................................................................................733
8.3 Use Data Cursor to Show the Difference between the Data ............................................................. 1825
iv
Table of Contents
Index................................................................................................................................................... 2089
v
1 Getting Started
If you are new to Origin, or have used a much older version in the past, it is highly recommended that you
start with these tutorials. Once you have familiarized yourself with the interface and key concepts of graphing
and analysis introduced in these lessons, you can then move on to other chapters that cover Origin features in
more detail.
At the end of each lesson, we ask you to save the project. Please work through the tutorials sequentially as
some build on previous lessons.
My First Graph
Data Selection
Publishing Graphs
3D and Contour
Gadgets
Curve Fitting
Peak Analysis
Statistics
Analysis Template
Apps in Origin
In this first lesson, we will generate some data, create a graph, do some simple customization of the graph,
and save the data and graph as an Origin project.
1. Launch Origin. You will see an empty workbook with one worksheet containing two columns.
2. Right-click on column A, expand the context menu if needed, and select Fill Column with: A set of
Numbers....
You can turn off collapsible menus by unchecking the Enable Collapsible Menus check box on
the Miscellaneous tab of the Tools:Options dialog.
3. In the dialog, set From as -10, keep To as 10, set Increment as 0.1. Click OK to close the dialog.
Column A will be filled with numbers in the specified range.
4. We will now set column B as a function of column A. Double-click in F(x) label row of column B. This will
place you in edit mode for that cell. Type the formula:
1
Tutorials for Origin
sin(A)
5. Now let us create a graph. Click on the header of column B to select the entire column. Then click the
Line button in the 2D Graphs toolbar docked at the bottom left of the interface. A graph window will
open, with the data plotted as a line.
1. We will now do some simple customization of the graph. Right-click on the X axis, and from the context
menu, select Hide Grids. This will add grid lines for the X axis. Do the same for Y axis.
2. Click on the line plot to select it. Then from the Style toolbar docked at top middle of the interface,
3. Change the width to 3 by using the the Line/Border Width drop-down list .
4. Single-click inside the layer, but not on the grid lines or plot. You may need to click once to deselect your
plot and then again to select the layer. The graph layer will be selected, and this will be indicated by
selection handles. Change the layer background color to LT Yellow by using the Fill Color button in
the Style toolbar.
5. In column A, double-click the cell for Long Name and type my x.
6. For column B, type my y into Long Name, mV into Units, and Sine Wave into Comments.
7. Click and select the graph window. The X and Y axis title and legend on graph will be updated
accordingly. Your graph should look like below:
2
Getting Started
1. Let us now explore the data graphically. Make sure the graph window is active by clicking on the title bar.
o Hold the Z key down and use the mouse wheel to zoom in and out on the X axis.
o Hold the X key down, and use mouse wheel to pan across the x axis.
Hold the Shift key down along with Z/X keys to zoom/pan in Y direction.
o Bring the plot back to full scale by clicking the Rescale button in the Graph toolbar docked
to the right side of the interface.
2. Click the Data Reader button from the Tools toolbar docked to the left side of the interface.
3. Place the cursor on the curve. You can now use arrow keys to move the cursor along the data plot and
read coordinate values. Or, you can click anywhere on the curve to read the coordinate values at that
3
Tutorials for Origin
location.
1. Move mouse over to the Project Explorer bar on the left side of the work space to expand it.
2. Right click on the Folder1 in the upper folders panel and choose Rename from the context menu. Type
My First Graph to rename the folder.
3. Choose menu File: Save Project to save the project. Give the project a name such as Getting Started
Tutorials.
Files created by the user such as projects, graph templates, fitting functions etc are by default
saved in the User Files Folder (UFF). You can access the UFF and other useful folder
locations with the main menu Help: Open Folder.
In this lesson we will learn about graph templates, and also how to perform batch plotting.
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.
4
Getting Started
2. Press the Ctrl key and select the Top and Right icons in the left list box. Choose the Line and Ticks tab
and select the Show Line and Ticks check box then press OK.
3. 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.
4. In the dialog, set the Template Name as My Line and click OK to save the template.
5. 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.
6. 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.
7. In the dialog, enter the following expression into the top panel:
B/A
Use the Formula: Load Samples menu in this dialog to view various examples on setting
column values. 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.
8. Click OK to close the dialog and see the values in column C. Type sin(x)/x into the Comments cell of
the column.
5
Tutorials for Origin
9. Click on the header of column C to select the entire column. From the menu, choose Plot: Templates >
User and from the drop-down menu select the My Line template we created before. A new graph will be
created using data from column C.
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. Right-click on newly created folder, select Rename, and assign the name Batch Plotting. Click on the
empty folder to open it.
3. Using Windows Explorer outside of Origin, navigate to the folder <Origin EXE Path>\Samples\Import
and Export\. Press the Shift key and choose the following three files:
o S32-014-04.dat
o S15-125-03.dat o S21-235-07.dat
4. Drag and drop the selected files onto the Origin workspace. The selected files are imported into three new
workbooks.
6
Getting Started
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 > 2D: Multi-Y: 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. Double-click inside the layer to open the Plot Details dialog. In the left panel, we can see there are three
layers. Expand Layer1 and choose the plot under it. Then in the right panel, change the line width by
choosing the Line tab and setting Line Width as 3. Repeat the line width setting for the plots in the other
two layers by selecting them from the left panel. Click OK to close the dialog and apply the settings.
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, press the Shift key and select the two workbooks in the top box.
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. 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.
10. From the menu, choose File: Save Project and save your modified project.
In this lesson we will learn about flexible ways of selecting data for plotting.
7
Tutorials for Origin
1. Let's start with the project we saved in lesson two: Graph Templates and Batch Plotting. Select any
workbook, and make sure no data columns are selected. You can click in the gray area outside of columns
to remove selection.
2. Select menu Plot > 2D: Line: Line. The Plot Setup dialog will open.
3. Click the button on the right side to expand the upper panel if it is not already open.
4. Set the Available Data: drop-down list in the left panel to Worksheets in Folder.
To pick up worksheets from anywhere in your project, set the drop down to Worksheets in
Project.
5. Hold down shift key and select all three data sheets named Trial Run 1, Trial Run 2 and Trial Run 3.
6. Using the check boxes in the middle panel, assign Time as X and Position as Y. Click OK button to create
the graph.
This dialog has a third bottom panel which can be used to assign data to different layers in a
multi-layer graph. If that panel is open, you can simply collapse it and then click OK to create
the graph.
7.
8. We will now customize the legend for this graph. Right click on the legend and select Legend: Update
Legend...
9. In the dialog that opens, set Auto Legend Transition Mode as Custom. Then click the button on the
right of Legend Custom Format (@D, @LU etc) edit box, and in the fly-out menu select @WS: Sheet
Display Name.
10. In the edit box, type a hyphen - after the string@WS, and again click the right arrow button. This time
select @LD"Sample": Sample, which corresponds to column header row Sample in the worksheet. Click
the OK button. The legend will now display the sheet name and the sample name.
11.
8
Getting Started
1. Go to Project Explorer. In the upper panel, right-click on the root level and choose New Folder.
2. Right-click on newly created folder, select Rename, and assign the name Data Selection. Click on the
empty folder and open it.
3. Click Import Single ASCII button and browse to <Origin EXE Path>\Samples\Graphing folder and
select the file US Mean Temperature.dat and import it.
4. We want to plot the positions of US major cities (columns Longitude and Latitude) as a scatter plot and
then colormap the data points with the annual mean temperature (column Annual). Click on the header of
column named January and drag and expand the selection all the way to the column named December.
Then right click to choose Hide/Unhide Columns: Hide.
5. Select the Longitude columns, then right-click and select Set As: X.
6. Select the Latitude and click Scatter button on the bottom left toolbar to create the plot of longitude
vs. latitude.
7. Double-click on any of the data points to bring up Plot Details - Plot Properties dialog.
8. With the data plot node [US Mean Temperature.dat]... under Layer1 selected in the left panel, activate the
Symbol tab on the right panel. Click the Symbol Color drop-down and in the fly-out, switch to the By
Points tab.
9. Click the Color Mapping drop-down and select Color Mapping: Col(P): "Annual". Click Apply to see
the effect, still keeping the dialog open.
10.
11. Let us now set the axes lengths to scale with the range of X and Y values represented in the graph. Click
to select Layer1 node on the left panel. Then go to the Size/Speed tab on the right side. Check the Link
Axis Length to Scale with X:Y Ratio box and keep the ratio as 1. Click OK to exit the dialog and see
the effect.
12. The colormap by default is set to Rainbow. Click on any data point in the graph, and then click on the
Palette toolbar button in the Style toolbar. Select the Temperature palette to better reflect the
data. Click anywhere on the graph to deselect the plot.
13.
You can add a map to a graph using the Maps Online App. This blog post is a good place to
start.
9
Tutorials for Origin
14.
15. From the menu, choose File: Save Project and save your modified project.
1. Open a new workbook window by clicking on the New Workbook button in the Standard toolbar.
2. Click the Import Excel button on Standard toolbar. In the file dialog that opens, browse to <Origin
EXE Path>\Samples\Import and Export folder and select the file United States Energy (1980-2013).xls.
Make sure that the Show Options Dialog check box is checked, and press OK.
3. In the import options dialog that opens, expand the Import Options > Header Lines node. Set the
Number of Subheader Lines to <auto>, set the Long Names drop-down to 3 and the Units drop-down
to 4. Then set the drop-downs for Comments From to 1 and Comments To to 2.
4. Check Apply Header to All Sheets so that these settings are used for every sheet in the Excel file.
10
Getting Started
5. Press OK to import the file. Then go to the first sheet named Oil. Hold the Ctrl key to select Crude Oil
Production, Oil Consumption and Total Oil Production columns.
6. Then go to menu Plot > 2D: Multi-Panel: Stack... and accept default settings in the dialog, to create a
stacked plot.
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.
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.
3. With the blank workbook active, click the Import Single ASCII button 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 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.
11
Tutorials for Origin
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.
6.
7. Select the legend and press the Delete key to delete it.
8. 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.
9. 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.
10. Select the menu Window: Tile Vertically to arrange the 4 graphs without overlap.
11. Use the Change X/Change Y menu described before, to change X/Y designations for the copy graphs as
below, and rescale when promoted:
o Copy 1: Change Y to [automobile]automobile!D(Y):0^60 mph
o Copy 2: Change X to [automobile]automobile!E(Y):Weight
o Copy 3: Change X to [automobile]automobile!F(Y):Gas Mileage
12. 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:
o Change Symbol Shape to circle and Symbol Color to olive.
o Set Transparency to 55%.
13. Double-click on the Y axis to open the Axis dialog. Change the axis properties as follows:
o 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.
o In the Display sub-tab, select Engineering:1k for Display.
12
Getting Started
o Check the Set Decimal Places check box and set Decimal Number to 0. Press OK to close the
dialog.
14. 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.
15. 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.
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:
o Horizontal Gap = 15
o Vertical Gap = 15
o Left Margin = 10
o Right Margin = 5
o Top Margin = 5
o 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.
13
Tutorials for Origin
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.
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
14
Getting Started
in the data.
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.
In this lesson we will learn about some of the options available for publishing graphs.
1. Open the project file saved from lesson four: Merge and Arrange Graphs. Click to select the last graph
window that you created.
2. Use the menu Edit:Copy Page, or the shortcut CTRL+J, to copy the graph page.
3. Launch Microsoft® WORD, then press Ctrl+V. The graph will be pasted as an embedded object in Word.
4. Double-click on the graph in Word. A new instance of Origin will be launched. Note that in this instance,
only the graph and data related to the graph are available in the project.
5. Use menu Format: Page Properties to open the Plot Details dialog in the page level. Then in the right
panel, change the background color by choosing the Display tab and setting Color as LT Gray. Click OK.
15
Tutorials for Origin
6. From the menu, choose File: Exit & Return to Document1. This will close the instance of Origin, and
the graph image in the document will be updated.
7. Repeat step 1~2 to copy the graph page. then go back to the Word document, de-select the graph and
press Enter to move to a new line in the document. Under the Home tab click the Paste icon, then select
Paste Special from the drop-down.
8. In the dialog that opens, select Picture (Enhanced Metafile) and click OK. This will paste the Origin
graph as a picture object. Double-clicking on the image will open the Format Pictures dialog.
9.
When the Origin graph is placed as an embedded object in applications such as Word or
PowerPoint, all the data associated with the graph are also saved with the Word document.
This provides the flexibility of double-clicking and editing the graph in a new instance of Origin.
However, if many graphs are placed as objects in a document, the document file size will
become large if there is a lot of data associated with the graphs.
1. With the graph window active in Origin, press the Send Graphs to PowerPoint button .
2. Accept all default settings in the opened dialog and click OK. The graph will be pasted as a new slide in
the PowerPoint file.
3. Right-click on the graph title bar (in Origin) and select Add Shortcut to Favorites. This will add a
Favorites folder to the project, visible in Project Explorer.
4. In Project Explorer, select the My First Graph folder. Then select the graph window, right-click on the
title, and Add Shortcut to Favorites folder. Add shortcuts from other graph windows in the project as
desired.
5. Go to Project Explorer and activate the Favorites folder. In the bottom panel, without selecting any
item, right-click on the white area and choose View:Extra Large Icons from the context menu. This will
show the graphs as extra large icons.
Double-click on the icons in Favorites folder to open the graph for viewing or editing. Right-
click on the icon or the graph window title bar for a context menu command to go to the
original folder for that graph.
16
Getting Started
6. Right-click on the Favorites folder in the upper panel of Project Explorer and choose Send Graphs to
PowerPoint. Accept defaults in the dialog that opens. All graphs in the folder will be sent to PowerPoint.
Note that you can do this operation in any folder, and not just the Favorites folder.
The dialog for sending graphs to PowerPoint has options for selecting all graphs in the project,
specifying graphs by name, and placing the graphs on duplicate copies of a specific slide
PowerPoint file slide that you can prepare prior to the operation.
1. Right-click on the Favorites folder in the upper panel of Project Explorer and choose Slide Show of
Graphs from the context menu.
2. Accept defaults in the dialog. The slide show will start. Use arrow keys to view the next or previous graph
in the sequence.
In the bottom panel of Project Explorer, switch to Details view (right-click in a empty location
and choose View: Details). Right-click on the lower panel title bar and enable Slide. Note that
you can drag to reorder the columns. Use the added Slide column to arrange the order of the
graphs. Click on the slide column header once, and then you can drag and rearrange the graph
entries to set the order. This order will be followed for operations such as slide show, pushing
graphs to PowerPoint, and exporting.
1. Go back to Project Explorer and select the Merging Graph folder in the upper panel.
2. Activate the graph and choose File: Export Graphs and change the following dialog box settings.
o Select Portable Document Format (*.pdf) from the Image Type drop-down list.
o Change the Select Graph(s) drop-down to All in Active Folder.
o Expand the Image Size branch and enter 5 in the Fit Width text box.
17
Tutorials for Origin
4. Click on the Messages Log tab on the left side of the interface. The export path will be displayed there.
By default, this will be your User Files Folder (UFF) path. Copy the path, then go to Windows Explorer
and paste the path to open the folder. You can then view the PDF files that were exported from Origin.
In this lesson we will learn how to plot 3D, contour, and profile plots. Data for such plots can be organized as
XYZ columns or an array of cells in a worksheet, or in a matrix window.
1.6.1.1 3D Surface
1. Start with the project saved from the previous lesson and add a new folder named 3D and Contour. Click
to open the empty folder.
From the drop-down, select 3D Scatter/Trajectory/Vector. Click the Add Plot button to add the
plot to the right-hand panel.
8. Click OK to close the dialog. The graph will now display the individual data points on the surface.
9. Hold the R key and use the mouse to freely rotate the surface plot.
1. Click on the New Matrix button in the Standard toolbar to open a new matrix window.
2. Select the menu File: Import: Image to Matrix, then browse to <Origin EXE Path>\Samples\Image
Processing and Analysis folder and select cell.jpg file and import it into the matrix.
3. With the matrix active, select the menu Plot > 2D: Profile: Image Profiles. An image profile graph will
be created, and the Image/Contour Profile dialog will open.
18
Getting Started
4. In the dialog, select the HLine tab then make the horizontal line thicker by expanding the Width branch
and changing Pixels to 50.
5.
You can add multiple horizontal, vertical, or arbitrary lines using the buttons in the dialog. The
graph layers will display overlaid curves for the profiles in the appropriate layers. Profile plots
can also be made from data in a matrix or worksheet.
2. Click on the Import Wizard button . In the dialog that opens, choose the ... button next to File
box, browse to <Origin EXE Path>\Samples\Graphing folder, choose waterfall.dat file. Click Finish to
import the file.
3.
The Import Wizard can be used to parse an ASCII file to extract variables from header lines.
The file you chose already has a predefined filter which is applied when you click the Finish
button.
4. Move the cursor to the upper left corner of the workbook until the shape of the pointer changes as in the
following image, and click to select all columns of the worksheet.
5. Select menu Plot > 2D: Contour: Contour - Color Fill. This will open the plotvm dialog box, where you
need to specify the data organization for your Virtual Matrix, as the data is contained in a worksheet
instead of a matrix window.
6. Change Y Values in to Column Label, and then set Column Label to Excitation Wavelength(nm).
7. Click the OK button to apply the settings and create the contour graph.
8. Click the Enable/Disable Speed Mode button one time from the right-hand toolbar, to turn off the
speed mode setting for the graph.
19
Tutorials for Origin
9. Go back to the workbook with waterfall data. Keep the whole worksheet highlighted and this time select
the menu Plot > 3D: Surface: 3D Color Map Surface with Projection.
10. The plotvm dialog opens. Note that the Theme box on the top of dialog is set as <sheet>. This is
because the settings used last time were saved in the worksheet. Click OK to accept the same settings. A
surface graph with contour projection will be created.
11. Double-click on the contour projection to open the Plot Details dialog. Note that on the Surface tab, the
Flat check box is checked, and an offset of 100% has been applied. This setting makes the data plot
appear as a flat contour on top of the cube. Click OK to close Plot Details.
12.
Data from different matrices or virtual matrices can be plotted in the same 3D graph layer by
specifying an appropriate offset value for each, and further specifying which datasets to flatten.
This allows to examine related data together in the same graph.
13. Double click on the Z axis to open the Axis dialog. Switch to the Scale tab and set the To value to 4000
and click OK. This allows better viewing of the 3D surface. The contour project will stay on the top plane of
the cube.
2. In the dialog box, click the triangle button next to the Theme box on the top. Then select Mexican
Hat(System) in the context menu to load the settings for this example.
3. Press OK to create the plot.
4.
A parametric function can be added to an existing graph, thus allowing you to combine such
plots with real data. Visit 3D Function Gallery to view and download more examples.
1.7 Gadgets
In this lesson, we will use gadgets to perform exploratory analysis of data in a graph.
20
Getting Started
1. Start with the project saved from the previous lesson and add a new folder named Gadgets at the root
level in Project Explorer, then go to that folder.
2. With the new workbook active, click the Import Single ASCII button on the Standard toolbar and
import the file <Origin EXE Path>\Samples\Curve Fitting\Multiple Gaussians.dat.
3. We will add long names for the datasets. Enter "Peak 1" in the Long Name label row of column B. Click
and select the long name cell. Then move the mouse to the lower-right corner of the cell so that the
cursor changes to "+". Click the left mouse button and drag from column C to E. Origin will auto-fill the
names as Peak 2, Peak 3 and Peak 4.
4. Click and drag on the column headers to highlight columns B to E. From the main menu, select Plot >
2D: Multi-Y: Stacked Lines by Y Offsets to create a stacked lines graph.
5. With the graph active, select Gadgets: Integrate... from the main menu.
6. Accept the default settings and press the OK button. A region-of-interest (ROI) box will be placed on the
graph. Move and/or resize the ROI to cover a desired range of the data.
7. Click on the triangle button at the top-right corner of the ROI box and select Preferences to re-open the
dialog.
8. In the Output tab, expand the Output Quantities to branch and select the Append to Worksheet
check box . Click OK to close the dialog box.
9. When there are multiple plots in a layer, the gadget acts on the active data plot by default. In this case,
the active plot is Peak 1. To change the data to Peak 3 for example, click on the triangle button at the top-
right corner of the ROI box and select Change Data: Plot(3): Peak 3 from the context menu.
10. Click on the triangle button again and select New Output for All Curves. A workbook with integration
results for all curves will be generated. Click the triangle button and select Go to Report Worksheet to
switch to the output workbook.
11. Click the X button at the top-right corner of the ROI box in the graph to remove the gadget.
1. Start with a new workbook, and import the file <Origin EXE Path>\Samples\Signal Processing\Chirp
Signal.dat.
21
Tutorials for Origin
2. Highlight column B, then select Plot > 2D: Line: Line from the main menu to create a line graph.
3. With the graph active, select Gadgets: FFT from the main menu. Accept defaults in the dialog that opens,
and click OK. An ROI box will be placed on the graph, and another graph named FFTPREVIEW will be
created, displaying the FFT result.
4. In the top right corner of the FFTPREVIEW graph, uncheck Log Scale. Then reposition the source line
graph and FFTPREVIEW window side by side. Move and resize the ROI to cover a small range of the
beginning of the data curve.
5. Now you can use the arrow keys to move the ROI to the right, while watching the FFT result update in the
other graph.
In this lesson we will learn how to perform linear and nonlinear regression.
1. Start with the project saved from the previous lesson, and add a new folder at the root level in Project
Explorer named Curve Fitting.
2. Import the file <Origin EXE Path>\Samples\Curve Fitting\Outlier.dat.
3. Select the 2nd column and create a scatter plot.
4. Select the menu item Analysis: Fitting: Linear Fit. In the dialog that opens, accept default settings and
click OK to perform the linear fit.
5. In the graph, right-click on the fitting results table and select Quantities in Table. Remove all entries
except Intercept, Slope and Pearson's r (use CTRL + select for multiple selections). Click OK and resize
the results table as needed.
6. Now click the Mask Points on Active Plot button on the left side toolbar and mask the point at the
right bottom, which is distinctly
separated from the rest of data points.
7. The lock on the top left of the graph page turns yellow indicating that the data has changed, but the fit
results are in need of an update.
8. Hit the ESC key to switch the cursor back to pointer mode. Then click on the yellow lock, and from the fly-
out menu select Recalculate Mode: Auto. The fit results will be updated.
9.
22
Getting Started
You can update all pending operations in a project by clicking on the Recalculate button
10. Go back to the graph and use the masking tool to mask the outlier point towards the top. You will notice
that the results automatically update. Your graph should now look similar to this image:
1. Start with a new workbook, and import the file <Origin EXE Path>\Samples\Curve Fitting\Gaussian.dat.
2. Highlight the column named Amplitude and make a scatter plot.
3. Go back to workbook, highlight column named Error, then right click and select Set As: Y Error from the
context menu.
4. Place the mouse cursor close to the right edge of the highlighted column. The cursor will change to .
At this point, drag and drop the column onto the graph. The data will be added as error bars on the
scatter plot.
5. Now let's fit this data. Select the menu Analysis: Fitting: Nonlinear Curve Fit to open then NLFit
dialog.
6. In Function Selection page, set Category drop down to Peak Functions, and set the Function drop
down to Gauss.
7. Click Fit button to perform fitting and choose No in the prompt dialog, to keep the graph window active.
8. Now we want to fix y0 as 0 and update the results. Click on the green lock on the top left of the graph
page, and select Change Parameters.
23
Tutorials for Origin
9. The dialog re-opens with the settings that were used last time the operation was performed. Go to the
Parameters tab, check the Fixed box for y0 and enter Value as 0.
10. Click the Fit button to update the file and close the dialog. From the updated table on the graph, we can
see that .
1. Start a new workbook and import the file <Origin EXE Path>\Samples\Curve Fitting\Exponential
Decay.dat.
2. Drag and select the three Y columns and create a line plot.
3. We want to fit all three data plots simultaneously over the x range of 0.4 s to 1.0 s. In the Tools toolbar
docked to the left side of the interface, click the down arrow button on the right of Selection on Active
Plot button . From the fly-out, choose Selection on All Plots. Go to the graph and drag and draw a
rectangle to roughly cover the x range of 0.4 to 1.0, including all the three curves in the process.
4. Press CTRL+Y to quickly launch the NLFit dialog. Then set Category as Exponential and Function as
ExpDec1.
5. Click on Data Selection under the Settings tab, expand the Input Data node and you will find all three
curves are added. You can expand the Range# node to further adjust data ranges either by row index or
by x value.
6.
If no range selection has been made on the multiple plots, Origin will only pick up the active
data plot from the graph layer containing multiple plots. In that case you can click the
button on the right side of Input Data and select Add all plots in active page.
7. Change Multi-Data Fit Mode to Global Fit, switch to the Parameters tab and click the Fit until
converged button to fit all three curves simultaneously, keeping the dialog open.
24
Getting Started
8. You can share parameters during a global fit. Check the Share box for the time constant t1. You will
notice that the time parameter for the other curves has been removed from the parameters list.
9. Click the Fit button and select Yes in the prompt that appears, to switch to report sheet. If the prompt
does not come up, you can click on the green lock in the graph and select Go to Results.
10. Scroll down to the Summary table in the report. You will find that all time constants t1 share the same
values.
11. Now click on the down arrow button beside the Summary node and choose Create Copy as New Sheet.
A new worksheet with the fit results will be added to the book.
12. Select column D, E and create a column plot to display how the amplitude parameter (A1) changed across
the three datasets.
In this lesson we will perform fitting, including deconvolution of overlapping peaks and baseline correction.
1. Let's continue with the project file we saved in the previous lesson. Create a new folder in Project
Explorer, rename it as Peak Analysis, then go to the empty folder.
2. In a new workbook, import the file <Origin EXE Path>\Samples\Spectroscopy\HiddenPeaks.dat.
3. Highlight column B and create a line plot.
4. With the graph window active, click Analysis: Peaks and Baseline: Multiple Peak Fit. This will open
the Multiple Peak Fit dialog. Set the Peak Function drop-down as Gauss and click OK.
5. A Get Points dialog will open within the graph window. Note that you can re-position this dialog within
the window. Double-click on a peak center to select it. Select a total of 7 peaks as in the following image,
25
Tutorials for Origin
6.
If you click the Open NLFit button in the Get Points dialog, the NLFit dialog will open with the
peak centers initialized with your selection. You can further control the fitting process as
desired.
7. After selecting all seven peaks, click the Fit button. A fit report will be added to the workbook.
1. This part of the lesson assumes you have OriginPro. Start with a new workbook and import the file
<Origin EXE Path>\Samples\Spectroscopy\Peaks_on_Exponential_Baseline.dat.
2. Highlight column B and then click Analysis: Peaks and Baseline: Peak Analyzer. This will open the
Peak Analyzer dialog, and a preview window displaying the selected data.
3. In the bottom panel, select the Fit Peaks (Pro) choice under Goal. The top panel will update, displaying
a map of the steps involved in the peak fitting process.
4. Click Next. On the Baseline Mode page, select User Defined for Baseline Mode. Click Next to go to
the Create Baseline page. You can then see in the preview window that 8 anchor points connected by a
red line, are added to the spectrum. This is the baseline created using the current settings.
5.
Now click the Prev button to go back to the Baseline Mode page to adjust the baseline mode settings.
26
Getting Started
6. Click the Find button below Number of Points to Find, to find the baseline anchor points in the
spectrum. Eight (8) anchor points are added.
7. Clear the Enable Auto Find checkbox and then click the Add button to add one or more anchor points on
the spectrum. Double-click on the tail of the spectrum like the following image to add 1 anchor point.
8. Note that you can also select and delete anchor points. Click Done to return to the Peak Analyzer.
9. Select the Snap to Spectrum checkbox to force anchor points to snap to the closest data point in the
spectrum. Click Next.
10. On the Create Baseline page, select Fitting for Connect by. Select ExpDec2 for Function under the
Fitting branch. Click Next twice to go to the Find Peaks page.
11. Click the Find button. Two (2) peaks are found in the preview.
12.
There are several options available for peak finding including a 2nd derivative method to find
overlapping peaks. You can also view the 2nd derivative curve, and turn on smoothing to help
find peaks in noisy data.
13. Click Next to go to the Fit Peaks page. Accept defaults and click Finish to perform peak fitting. A graph
containing fitting results is generated.
14.
You can click the Fit Control button to control the fitting process including fixing and sharing
parameters, and specifying bounds and constraints.
15. Now, let's customize the Fitting Results table to hide some peak properties we don't want to display.
Right-click on the table and select Peak Report Field... from the context menu. The Peak Report Field
dialog will open, listing all properties that can be included in the table. You can remove or change the
order properties in this dialog. Select Peak Gravity Center and click the Remove button to hide it. Do
27
Tutorials for Origin
the same for Peak Area by Integrating Data(%). Press OK to update the table in the graph.
1.10 Statistics
Origin provides many tools for statistical analysis. Advanced statistical tools are available in OriginPro. In this
lesson, we will work with tools available in standard Origin.
1. Start with the project saved from the previous lesson, create a new folder in Project Explorer and rename
it as Statistics. Open the empty folder.
2. Create a new workbook and import the file <Origin EXE Path>\Samples\Statistics\body.dat.
3. Drag and select the first 5 rows of column D(Height). Basic statistics (average, sum, count) for your
selected data will be displayed in the status bar at the bottom right side of the interface.
You can right-click on the statistics listed in the status bar to customize what quantities to
display there.
4.
5. From the menu, select Statistics: Descriptive Statistics: Statistics on Columns. In the dialog, select
the Input tab, then expand Range 1. Click on the interactive button to the right of Data Range.
28
Getting Started
Return to the worksheet, then drag and select columns D and E. Click the interactive button again to
restore the dialog.
6. In the Group control, click the triangle button and select B(Y): age. Click the button again and select
C(Y): gender. In the list, select ..."gender" in the Group box, then use the Move Up button to
move it to the top.
7. Click OK to generate the report.
8. Click the downward-pointing triangle button on the right of the Descriptive Statistics node in the
report sheet and select Digits... from the context menu.
9. In the opened dialog, change Digits to Set Decimal Places= and set Decimal Number as 1. Click OK
to update the display format in all tables of the report.
10.
The numeric display in all report sheets can be globally set using the Digits in Report control
on the Numeric Format tab of the Options dialog accessible from the Tools: Options main
menu.
nint(100+20*normal(100))
The column will be filled with random integer numbers centered around 100.
3. Highlight column A and click Statistics: Descriptive Statistics: Normality Test to open the dialog. The
selected column is set as Input Data automatically. Accept default settings and click OK. This will
generate the report sheet for Normality Test. The footnote under the Shapiro-Wilk table indicates that
29
Tutorials for Origin
1. Activate Sheet1 of the workbook from the previous section. Keep column A highlighted, then click
Statistics: Descriptive Statistics: Frequency Counts.
2. Accept all default settings in the dialog and press OK.
3. In the result sheet, highlight the column C(Y) . On the 2D Graphs toolbar, click the triangle button next
to the Column button , then choose Column + Label to create a column graph with labels. This
will create a histogram plot with counts as labels.
4.
The Plot: Statistics menu provides multiple histogram plot options when a worksheet is
active. This Frequency Counts tool provides an alternate way to first perform counting, and
then plot a histogram from the results. This allows for more flexibility and customization such
as adding labels to the columns.
1. Create a new workbook and then click on the Import Single ASCII button . Browse to <Origin EXE
Path>\Samples\Statistics folder. Change the drop-down list next to the File Name to Text File (*.txt).
30
Getting Started
The ANOVA dialog box provides two options for input mode: Indexed or Raw. You can refer
to the FAQ-333: What is indexed versus raw data and how to I transform from one to another?
to learn more about how data can be arranged for either mode.
5. In the Means Comparison tab of the dialog, select the Tukey check box. Then switch to the Plots tab
and select Means Comparison Plot. Click OK to close the dialog and generate the report.
6. Go to the report sheet ANOVA1Way1. From the result, we can draw following conclusions:
o The ANOVA table (Overall ANOVA) reports a p-value that is smaller than 0.05, hence at least
two of the four groups have significantly different means.
o Double-click on the Means Comparison Plot to open it. The red plots indicate significantly
different mean values. PLANT4 has the smallest mean and is significantly different from the
other three groups.
In this lesson we will learn how create an Analysis Template and re-use it for new data.
1. Continue with the project file saved from the previous lesson. Create a new folder in Project Explorer and
rename it as Analysis Template. Open the empty folder.
2. Create a new workbook and import the file <Origin EXE Path>\Samples\Curve Fitting\Sensor01.dat.
3. Highlight column B and select Plot > Templates: User Templates: My Line to create a line graph from
the graph template My_Line.otp that we saved in lesson 1.
4. With the graph window active, select Analysis: Fitting: Linear Fit from menu. This will bring up the
Linear Fit dialog.
5. In the Fit Control tab, select the Fix Intercept check box to force the fitted curve go through (0,0).
Select Auto for Recalculate. Click OK to perform the linear fit. The fitted curve and a result table will be
added to the graph.
31
Tutorials for Origin
6. Right-click on the result table and select Quantities in Table from the context menu. In the dialog,
remove all entries other than Slope and Adj. R-Square, then click OK to update the table.
7. Double-click on the X axis to open the Axis dialog. With the Scale tab active, hold down the Ctrl key and
select both Horizontal and Vertical in the list box on the left. Change Rescale to Auto and click OK.
This is to make sure the axis range will update when data changes.
10.
11. In the Graph Browser dialog that opens, select Active Folder from the location drop-down list. Only the
line graph in the current folder will be displayed. Select the graph and click OK to insert it as an
embedded graph inside a new worksheet.
32
Getting Started
12.
13. Now we have source data and all analysis results in one book. Let's save it as an Analysis Template.
Select File: Save Workbook as Analysis Template... from menu. Save the workbook as My Sensor
Analysis.ogw.
14.
Any work book which has an operation linking input and output, indicated by a lock on output
sheets or columns, can be saved as an analysis template. The simplest example would be a
sheet where column value calculations have been performed.
15. Now use the File: Recent Books menu command to open My Sensor Analysis.ogw. The analysis
template will open. Note that the date sheet, results and graphs are empty.
16. With the first data worksheet active, import another data file <Origin EXE Path>\Samples\Curve
Fitting\Sensor02.dat.
17. The linear regression results and the embedded graph will update automatically, because we had set the
Recalculate mode in the linear fit tool to Auto.
Analysis templates can be used manually to process one file at a time, or can be used to perform batch
analysis of multiple data files or datasets. Please view the Batch Processing tutorial to learn more.
In this lesson we will install and use an App from the File Exchange area of OriginLab's website.
1. Start with the project saved from last lesson, and add a new folder named 3D Ellipsoid at the root level
of Project Explorer.
33
Tutorials for Origin
2. Select the F10 key to open the App Center dialog. Select the Search tab and input 3D Confidential
Ellipsoid into the search engine and select the Search icon in order to search for the app.
Note: You can as well open the App Center dialog by selecting Add Apps in the Apps Gallery Window.
3. Click the download and install icon. Once the App is installed, the download and install icon will change
to a green check-mark (Up-to-date Version icon). As well, an icon named 3D Confidential Ellipsoid
will appear in the Apps Gallery window docked to the right end of the workspace.
4. Now import the file <Origin EXE Path>\Samples\Statistics\Fisher's Iris Data.dat into a new workbook.
5. Select Plot > Templates: System Template Library from the main menu. In the System Templates
dialog, expand the Graph Template -> 3D Symbols & Bars & Vectors node, then select gl3d. Click
the Plot Setup... button at the bottom left corner of the dialog.
6. In the Plot Setup dialog that opens, set column C, D, and A as the X, Y, and Z columns, respectively.
Click the Show Plot List button to expand the dialog (if it is not already expanded) , click the Add
34
Getting Started
7. Double-click on the scatter to open the Plot Details dialog. On the Symbol tab, click on the Color drop-
down list, and then select the By Points tab. Then click on Indexing, and from the drop-down, select
Col(E) "Species". Click OK to close the dialog.
8. Click the 3D Confidential Ellipsoid button in the Apps Gallery. This will open the Plot 3D Confidence
Ellipsoid dialog. Accept the default settings and click OK. Three ellipsoid are added to the graph, each
envelops the group of data with the same color. You can hold the R key and then use the mouse to rotate
the plot.
We hope this set of Getting Started tutorials has been helpful in providing you with a broad overview and
introduction to key features in Origin. We recommend that you continue with more advanced tutorials in the
categories that are most relevant to your work.
35
2 Video Tutorials
To get started quickly with Origin, you could watch the videos in the following table:
Title Description
Learn how to import ASCII file, customize your Import ASCII dialog
Importing Data settings and save them for future reuse, and use the Import Wizard to
import data file and customize the import settings.
Learn how to create a graph using the graph toolbars or the Plot
Creating a Graph Details dialog, add data to an existing graph, and plot groups of plots
by label.
Learn how to add a layer title, resize a layer, change the axes
Customizing a properties, save a graph as a template and reuse it, customize a graph
Graph by using theme, change the plotting order, customize a single data
point or a grouped data plot.
Linear Fitting* Learn how to perform a linear fit with outlier removal.
Learn how to fit with a built-in fitting function and change the NLFit
Nonlinear Curve Fit
settings using Change Parameters. Also, learn how to define and fit
Tool
with a user-defined function.
Creating an Learn how to set up a workbook for repetitive analysis using a linear
Analysis Template regression example.
Learn about all of the extended analysis tools in the areas of peak
Introduction to
fitting, surface fitting, statistics, signal processing and image
OriginPro
processing offered in OriginPro.
Note: Please visit the video tutorial page on our website for a complete and most up-to-date list of video
tutorials.
37
3 User Interface
Tutorial:Origin_GUI
3.1.1 Summary
This tutorial will introduce you to the Origin workspace. You will learn about the different kinds of Origin
windows that make up a Project, how to manipulate these windows with Project Explorer, how to manipulate
layers and plots with Object Manager and how to manage Apps with Apps Gallery.
Manipulate Workbooks
The Origin Title Bar displays the Origin(Pro) version, any open project name and the current folder within
that project (if any) along with the standard Window controls for moving, sizing and closing the window.
The Status Bar appears at the bottom of Origin's Window and displays messages, the state of Auto Update,
overview of the statistics on selected worksheet cells, Child Window Theme (if any), Last active Workbook,
Current Window and Angular Units indicator.
39
Tutorials for Origin
You can select what shows in the Status Bar by right-clicking on the Bar and selecting (or clearing) items from
the context menu. You can copy the displayed basic statistics by selecting Copy Statistics from the context
menu. The copied data are TAB separated between quantity and values, with each key value pair separated by
a CRLF delimiter.
3.1.4 Windows
The Origin menu dynamically changes according to the active Child Window. Some menus (Help, File, Edit,
etc.) appear on all Child Window menus, although their content may change.
3. Click on the New Graph button on the Standard Toolbar. A new window called Graph1 is created.
Note that there are 11 menu items displayed.
Thus, we say that the menus are "context sensitive." They will change depending on which type of Child
Window is active.
40
User Interface
Note: New Child Windows may be added by selecting the File: New menu option or clicking the appropriate
button on the Standard Toolbar. All Child Windows have standard controls for moving and sizing and
windows can be placed anywhere within the Origin workspace. The Window menu has options (cascade, tile)
for arranging child windows within the workspace. In the central Origin Workspace is where you will find all
Origin Child Windows which can include:
Workbooks - The Origin workbook is the primary structure for organizing your data. Each workbook is
composed of one or more, up to 255 worksheets.
Graphs - With Origin, you can create over 60 graph types, each from a built-in graph template. Graph
windows can be embedded in a worksheet cell.
Matrices - The Origin matrix holds data and images and is required for many 3D graph types.
Notes - Notes windows are a text-only Origin child window useful for recording analysis procedures, making
notes to students and colleagues, etc. You can embed notes windows in a worksheet cell.
3.1.4.2 Workbook
The Origin workbook is the primary structure for organizing your data. Each workbook is composed of one or
more Origin worksheets. Each worksheet, in turn, is composed (usually) of one or more worksheet columns or
datasets. Columns in Origin have different column types, such as X, Y, Z, yError, etc, These plotting
designations determine how the data are treated when creating a graph.
Starting with version 2017, Spreadsheet Cell Notation icon will show in the upper-left corner of the
workbook by default, that means the new simplified worksheet cell notation(similar to that used in MS Excel) is
turned on. You can learn more details about how this mode works in the tutorial Setting Column Values.
41
Tutorials for Origin
1. Select File: New from the menu and choose Worksheet to create a new worksheet.
2. Select File: Import: Single ASCII to bring up the Open dialog. Browse to the \Samples\Curve Fitting
subfolder of the Origin program folder. Highlight the file Gaussian.dat and click the Open button to import
the data into the Origin worksheet.
3. On import, sparklines were automatically turned on, allowing you to quickly view the shape of the data;
the sheet name became the name of the file; and as needed an additional column was added to the
worksheet. You can see from the Long Name that the 3rd column represents data error. To set this
column as an Error Column, click the column title to highlight the column, right-click to bring up a fly-out
menu, and then select Set As: Y Error.
4. Plotting data in Origin is now easy; highlight column B and C (Y and Y error), then select Plot: Symbol:
Scatter from the menu to create a scatter plot with error bar.
3.1.4.3 Graph
The Graph window is a container for graphical depictions of your experimental data and your analysis results.
Graph windows may contain a single plot in a single graph layer or they may contain multiple plots in multiple
graph layers.
The graph layer is the fundamental unit of the Origin graph. The layer is comprised of a set of axis scale
values, one or more data plots, and any included text labels, drawing objects, graph legends/color scales,
button objects, etc. Graph layers can be created, sized, and moved independently of one another, allowing you
a great deal of latitude in charting your data.
42
User Interface
1. Create a new workbook, and import the file Linear Fit.dat from the \Sample\Curve Fitting folder. You can
see that there are three Y columns and one X column after import; each Y column will use the left-most X
column as its X coordinates.
2. Highlight columns B and C, and select Plot: 2D: Multi-Panel: Vertical 2 Panel to plot the curves. This is
a two layer graph. While a graph can have multiple layers, only one layer is active at any given time. You
can perform operations on the active layer, such as resizing, changing the plot color, etc. When working
on a layer, the active layer is denoted by a depressed layer n icon in upper left corner of the graph
window.
3. To rearrange these two layers, with the graph window active, select the menu item Graph: Layer
Management to bring up the dialog. Activate the Arrange tab, on the middle panel. Enter 2 in the
Column edit box. Enter 1 in the Row edit box and click the Apply button. After you click the OK button,
43
Tutorials for Origin
Most often you will use the worksheet for tabulating and manipulating your data, while you will use the graph
window for plotting your data.
3.1.4.4 Matrix
The Origin matrix window is a container for one or more Origin matrices. Each matrix window contains one or
more matrix sheets, and each matrix sheet can contain one or more matrix objects. The matrix object itself, is
a vector of Z values. These Z values are related to one another in the X and Y dimensions by their relative row
and column positions in the matrix. Matrices are a precursor to constructing Origin's 3D graph types such as
contour graphs and color-mapped surfaces, and since they are used in depiction and manipulation of 3D data,
they are used by Origin in image processing and analysis. We will show you how to use the Origin Matrix to
create a 3D plot in a later tutorial.
3.1.5 Toolbars
The Customize Toolbar dialog box handles displaying or hiding toolbars and toolbar buttons.
1. Select View: Toolbars from the Origin menu. The Customize Toolbar dialog opens.
2. Check the box next to Column. This toolbar now appears in the workspace.
3. Make the Button Groups tab active.
4. Scroll to select AutoUpdate in the Groups list.
44
User Interface
5. Click and drag the one button which appears in this group and drop the button next to the green version
of this button without the red line, on the Standard Toolbar. You can drag buttons back and forth.
6. Click Close.
All these toolbars may be dragged away from their docked positions to become floating windows. Floating
windows have additional controls besides the X to hide a window. A push-pin control can allow or prevent
docking and a minimize button can roll-up a window to save space and restore the window when it is needed.
Standard Toolbar
Graph Toolbar
Format Toolbar
Style Toolbar
2D Graphs Toolbar
Mask Toolbar
Project Explorer is a tool to help you organize your Origin data. It is particularly useful if you are working
with a project that contains numerous child windows. Use Project Explorer to develop a folder structure to
organize the child windows in your project.
When you first start Origin, Project Explorer displays docked to the edge of the workspace. You can dock it to
any other edge or float it in the workspace. Because Project Explorer uses some of your workspace, you may
want to close Project Explorer, even if you have already created a folder structure. To close/open Project
Explorer, click the Auto Hide button to pin the Project Explorer, then press Alt + 1 or select menu item
View: Project Explorer.
45
Tutorials for Origin
The project explorer can be auto-hidden, hidden, floating or docking. In another aspect, it has vertical and
horizontal alignment.
3. Click the Auto Hide button to pin the Project Explorer, so it will be always displayed.
4. Select the Window Position drop-down and select Floating to make the Project Explorer float over
the work space, and you can freely move its position:
5. Right click on the title bar of the floating Project Explorer and select Horizontal Alignment:
46
User Interface
Note: Other dockable windows (Object Manager, Apps, Quick Help, Message Log, Smart Hint Log, etc.) have
the similar controls to change the display properties.
There are two panels in Project Explorer: the folders panel and the contents panel, which displays all objects in
the active folder. When you start a new Origin session, you can click the new workbook , new graph
or new matrix button to create some blank windows, and then you can see these window's icons in
the contents panel. Double-click the icon to hide/view the window.
47
Tutorials for Origin
To create a new folder, right-click on the project folder (or a subfolder) in the folder panel, and select New
Folder from the shortcut menu.
48
User Interface
Once you have created one or more subfolders, you can move child windows between folders by dragging &
dropping them within the Project Explorer workspace.
Object Manager provides a hierarchy structure to help you view and manipulate layers and plots in the active
graph window. It is particularly useful if the graph contains multi-layers and each layer contains multi-plots.
When you first start Origin, Object Manager is docked to the right edge of the workspace. Like Project
Explorer, you can dock it to any other edge or float it in the workspace. To close/open Object Manager, select
menu item View: Object Manager.
Object Manager works interactively with active graph window. Selecting layer or plot in graph window will
highlight the corresponding item in Object Manager and vice versa. This makes it very easy to select an item
and then show or hide it.
49
Tutorials for Origin
1. Select Help: Learning Center menu or press F11 key to open Learning Center. Select Graph Sample
in the left side of dialog, choose Multiple Panel for Samples in drop-down list. Double-click on Multiple
Panel by Column Label thumbnail to open the sample graphing project.
2. Select any plot object(such as a layer, a plot group or a curve) in graph window, the corresponding items
will be highlighted in Object Manager. Select items in Object Manager, the corresponding object will be
highlighted in the graph window.
3. In Object Manager, Uncheck the checkbox before the plot Trail Run 1 of Layer1 to hide this plot.
4. Right click on the plot Trail Run 2 of Layer1 and select Hide Plots with Same Name to hide all plots
named Trail Run 2.
5. Right click on the plot Trail Run 2 of Layer1 again and select Show All Plots. All Trail Run 2 plots are
back.
50
User Interface
The plot names in Object Manager is the Auto Legend Translation mode set in the
graph. Therefore same name or not depends on what the legend translation mode is
used.
Besides using Object Manager to turning on or off layers or plots, it can also be used to:
Change plot orders by right clicking on a plot and selecting Move Up/Move Down
Change plot type by right clicking on a plot and selecting Change Plot To
Double click on an item to open corresponding node in Plot Details dialog for futher customization or use
context menu to open Useful dialogs.
3.1.8 Apps
Apps are custom applications for Origin that perform specific graphing and/or analysis tasks. Apps are not
pre-installed with Origin. If you want to get an App, you can
Browse to our File Exchange page of the OriginLab website, search and download the app you desired to
install.
51
Tutorials for Origin
Open App Center(by selecting Help:App Center, or pressing F10 key, or clicking the Add Apps
button that appears on all tabs of the Apps Gallery), browse available Apps, search for Apps using
keywords and phrases, and install or update Apps with a single click.
When Apps get installed, they will be visible in the Apps Gallery window of the Origin interface.
In the Apps panel, you can add new tabs from the context menu and then classify these installed APPs by
putting them to different tabs, see "Graphing", "Analysis" tab in the above APP Gallery. All Apps will be
presented in the All tab in the order of their installation times.
52
User Interface
Each installed App will be displayed as an icon in the gallery window. You can simply click on the icon to launch
the App and right-click on the icons for other options such as hiding, uninstalling the App or movement
between the tabs.
Learning Center dialog helps you get started with Origin easily. You can select Help: Learning Center from
Origin menu or press F11 key to open it.
53
Tutorials for Origin
Find Apps
The Find window can also be toggled on/off from the View menu. Use this window to type in keywords and
locate a list of FAQs.
1. Click the Auto Hide button to pin the Quick Help, and then select View: Quick Help or Alt + 5 to hide
the Quick Help window.
2. Press Alt + 5 to show the Quick Help window again.
3. In the Find edit box, type in the following keywords: add data
4. Double-click on the "FAQ-144 What are the different ways by which I can add data plots to an
existing graph?" Origin's Help file opens.
The Messages Log window shows messages about operations including Output Information, Results and
Errors. It displays messages that are not sent to the Script Window or the Command Window. To close/open
Messages Log, press Alt + 6 or select menu item View: Messages Log.
1. Open a new workbook, highlight the A(X) and B(Y) columns, right-click and and choose Fill Columns
With: Row Numbers from the shortcut menu.
2. Highlight the columns and from the Main Menu, choose Plot: 2D: Line: Line. A simple line plot is drawn.
3. Select File: Export Graphs... from the main menu to open the ExpGraph dialog. In this dialog, keep the
default settings and click OK to export the graph.
4. The Output Information is reported to the Messages Log window.
54
4 Data Analysis
4.1.1 Gadgets
Integrate Gadget
Interpolate Gadget
Cluster Gadget
55
Tutorials for Origin
Distribution Fit with the Probability Density Function and Cumulative Distribution Function
Fit Multiple Datasets by Fitting One and then Using Those Fit Parameters for Other Datasets
FFT Filter
Smoothing
IIR Filter
Convolution
Wavelet
Rise Time
Sound Processing
56
Data Analysis
4.1.4.2 Batch Peak Analysis Using Theme with Script Before Each Process
Integrating Peaks
Setting the Fix, Share Status or Bounds for Multiple Peak Parameters Simultaneously
Worksheet Query
Data Reduction
Data Filter
57
Tutorials for Origin
Batch Processing Grouped Datasets Using Analysis Template with Multi-Data Sheets
4.2 Gadgets
4.2.1 Gadgets
Interpolate Gadget
Cluster Gadget
4.2.2.1 Summary
The Vertical Cursor gadget can be used to read X and Y coordinate values for data points in stacked panel plots
or contained in multiple graphs simultaneously.
58
Data Analysis
Use the vertical cursor gadget to read XY coordinates for multiple graphs and output the results.
Move or relocate the cursor line among the linked graph windows.
4.2.2.3 Steps
1. Open Origin and choose File:Import:Import Wizard. For the Data Source, browse to <Origin
Folder>/Samples/Curve Fitting and add the Step01.dat and Step02.dat files. The import filter Data
Folder:Step is automatically selected. Set Import Mode to Start New Books.
2. Click the Next button, navigate to the File Name Options page, clear the check box before Rename
Long Name for Book Only, then click the Finish button to import both files into two workbooks, and the
columns will be designated XY XY by the import filter.
3. Click the New Folder button on the Standard toolbar to create a new file folder in this project, this
folder should be open and named as Folder 2.
4. While Folder 2 is open, click the Import Wizard button on the Standard toolbar to import
Step03.dat file also under the path <Origin Folder>/Samples/Curve Fitting similar to steps 1 and 2.
5. Go to Folder 1 in Project Explorer, activate the workbook with long name Step01.dat and highlight the
whole worksheet. Select Plot:Multi-Panel:Stack from the menu item to open the Plotstack dialog.
6. Under the Plot Assignment branch, enter 3 for Number of Plots in Each Layer, accept other settings
as default and click OK to create a stacked graph.
7. Similarly create two other stacked graphs for the other two workbooks. So now we have Graph1, Graph2,
and Graph3 for workbooks Step01.dat, Step02.dat and Step03.dat respectively.
8. Activate Graph1 and choose Gadgets:Vertical Cursor to open the Vertical Cursor dialog.
9. Click the Link/Unlink Graphs button in this dialog and open the Graph Browser, you can choose
whether to link or unlink a graph to the current active graph.
59
Tutorials for Origin
10. Select Graph2 and Graph3 in the left panel and click the button to add the two graphs as linked
graphs to Graph1. Click OK.
Note:You can also unlink graphs in this dialog by using the button to remove a graph from the right
panel.
On the upper right-hand corner of each linked graph, a icon appears to indicate that it belongs to a
group of linked graphs.
11. Make sure Graph1 is active and the Vertical Cursor dialog is open, the asterisk before the graph
name marks the current active plot on which the cursor is on. Enter 25 as the X value, uncheck the
60
Data Analysis
box before Snap Cursor to Nearest X and click the Move Cursor to X button to read the data
points in each plot when X=25.
12. Click the Add Tag and Label button to add tags at X=25 for all linked graphs.
13. Click the Output Report button and then the Go to Report Worksheet button to generate and
open the results worksheet. The XY coordinates of all plots in linked graphs are listed in the report sheet.
14. Activate Graph2, click on the icon and select Move Cursor Line here, the cursor line will be moved to
Graph2.
15. In the Vertical Cursor dialog, double click any row of Graph3 to activate its graph window. Select the
previously added tag, press the Delete key to delete the tag, click on the icon and select Go to
Cursor Line Window to go back to Graph2 where the cursor is currently on. You can see that the tags in
linked graphs are deleted.
61
Tutorials for Origin
4.2.3.1 Summary
The Integrate Gadget performs numerical integration on a data plot to calculate the area under the curve. You
can select an arbitrary range of the data plot using the region of interest (ROI) object overlaid on the plot.
How to easily integrate a segment of data plot under the rectangular region.
How to display the integral curve inside the ROI and calculate quantities including: peak area, peak
height, peak center, and FWHM.
1. Start with a new workbook and import the Origin sample data Multiple Peaks.DAT which is located in
<Origin Program Folder> \Samples\Curve fitting.
2. Highlight the Col(C) and select Plot>2D: Line: Line from the Origin menu to draw a graph.
3. Select Gadgets: Integrate from the Origin menu when a graph is active, to bring up the Integrate:
addtool_curve_integ dialog box.
In Integration tab, choose Restrict to Rectangle in the Integral Curve drop-down list to plot the
62
Data Analysis
4. Click OK button. You will see that a yellow rectangle and a blue integral curve are added to the plot. The
integral area is filled with gray, and the value is shown at the top of the rectangle.
63
Tutorials for Origin
5. Move the yellow region of interest rectangle to set the region for the single peak you want to integrate.
64
Data Analysis
6. Click the triangle button at the top right corner of the ROI tool to open the fly-out menu and choose
New Output. Then the Gadget Integration Results will display in the Script Window.
1. Start with a new workbook and import the file <Origin Program Folder>\Samples\Spectroscopy\ Peaks
with Base.DAT
65
Tutorials for Origin
2. Highlight Col(B) and Col(C) and select Plot>2D: Line: Line from the Origin menu to draw a graph.
3. Select Gadgets: Integrate from the Origin menu when a graph is active, to bring up the Integrate:
addtool_curve_integ dialog box.
4. In Baseline tab, choose Use Existing Dataset for the Mode. Then select Plot(2): Base as Dataset and
click OK button.
66
Data Analysis
5. Click the triangle button and select Expand to Full Plot(s) Range in the fly-out menu to integrate the
whole range of the curve starting from the baseline.
6. Select New Output from the fly-out menu to output the results to the script window.
Some gadgets operate on a single curve at a time, but you can repeat your analysis for
other curves by clicking on the fly-out menu and choosing New Output for All Curves or
New Output for All Layers.
67
Tutorials for Origin
4.2.4.1 Summary
When there is more than one curve in a graph layer, you might want to calculate the intersection data points
of these curves. Since Origin 8.6, a new gadget Intersect is available to calculate the intersection points of
the input curves on the graph.
4.2.4.3 Steps
1. Open Tutorial Data.opj and browse to the Curve Intersection Gadget folder in Project Explorer (PE).
2. Highlight the Col(A)~col(D) in workbook Book6, and then click Plot:Line:Line to plot a line graph.
68
Data Analysis
3. Select Gadgets: Intersect... from the main menu to open the dialog. Go to the Options tab.
69
Tutorials for Origin
4. Check the Intersection Label check box in the Options tab, set Size as 15, set Type as Y and set
Rotate(deg.) as 0.
5. Click OK button to go back to the graph window. The yellow ROI box will be added onto the graph.
70
Data Analysis
6. Click the Arrow button at the top right of the ROI box, select Expand to Full Plot(s) Range from
the context menu. The ROI box will be expanded to cover full plot range as shown below.
7. Click the Arrow button at the top right of the ROI box. Select Preferences... from the context
menu to open the Intersect Preferences dialog. Go to the Output To tab and input
[Book6]Intersections in the Result Worksheet Name box.
71
Tutorials for Origin
8. Click OK button to go back to the graph window. Click the arrow button at the top right of the ROI box,
select New Output from the context menu.
9. The results will be output to the Script Window. Click the arrow button again, select Go To
Report Worksheet from the menu. The X and Y coordinates of the intersection points will be listed
in the results worksheet.
4.2.5.1 Summary
The Rise Time Gadget can be used to analyze the rising and falling stages of a step-like signal in a graph. With
this gadget, you can intuitively select an area on the graph with a rectangle, and then calculate the rise time
or fall time within that area.
How to select a specific region of the signal by moving and resizing a region of interest (ROI).
72
Data Analysis
How to mark Rise Time (Fall Time) and Rise Range (Fall Range ) in the graph.
How to switch the tool between Rise Time and Fall Time.
1. Start with a new workbook and click the button to import the Step Signal with Random Noise.dat
file under the <Origin EXE Folder>\Samples\Signal Processing path.
2. Highlight Column B and select Plot: Line: Line in the menu to create a graph.
3. Double-click the X axis to open the Axis dialog box. Go to the Scale tab and set the axis range and major
ticks as shown in the image below.
73
Tutorials for Origin
74
Data Analysis
4. Click the OK button and the graph will be updated as shown below:
5. Select Gadgets: Rise Time from the Origin menu to open the Rise Time: addtool_rise_time dialog
box. Go to the Display on Graph tab, and click the Rise Time and Rise Range check boxes.
75
Tutorials for Origin
6. Click OK button, and you will see that a yellow rectangle is added to the plot. Move the rectangle
horizontally on the rise signal step.
In the graph, you can see the Rise Time and Rise Range values are shown at the top of the rectangle.
The two blue vertical lines go through the two indicators marking the Rise Time.
The two blue horizontal lines that display the Low Reference Level and High Reference Level go
through the two indicators marking the Rise Range.
The two red horizontal lines display Low State Level and High State Level.
7. Click the triangle button at the top right corner of the rectangle. Then select New Output. The results
will be output to the Script Window.
76
Data Analysis
1. This gadget also allows you to get the fall time and fall range in a graph. Move the rectangle horizontally
on the fall signal step.
2. Click the triangle button and select Preferences in the fly-out menu to open the Rise Time
Preferences dialog. Go to the ROI Box tab and select Fall Time in the Tool drop-down list.
77
Tutorials for Origin
3. Click the OK button, the Fall Time and Fall Range values are shown at the top of the rectangle.
4. Click the triangle button and select New Output. The results will be output to the Script Window.
78
Data Analysis
4.2.6.1 Summary
Origin supports the interpolate gadget to perform quick interpolation on a ROI (Region of Interest) range when
a graph is active. And you can easily to change the interpolate region by moving the ROI.
How to quickly find out an interpolated Y value from any given X value.
How to output the interpolated values to Script Window, Result Log, or a specified worksheet.
4.2.6.3 Steps
1. Open Tutorial Data.opj and browse to the Interpolate Gadget folder in Project Explorer (PE).
2. Highlight the Col(A) and col(B) in workbook Book1R and plot a Line +Symbol graph.
3. Select Gadgets: Interpolate from the Origin menu when a graph is active, to bring up the Interpolate:
addtool_curve_intep dialog box.
4. Go to the Interpolate/Exterpolate Options tab. Choose Cubic Spline for the Method, and then select
Interpolate/Extrapolate to Rectangle Edge for Fit Limits To.
79
Tutorials for Origin
5. Click OK button. It will add an interpolation line onto the plot. And the Y values of interpolation line at
right and left are shown at the top of the rectangle region.
6. You can change the data range by moving or resizing the yellow region of interest rectangle, the
interpolated curve displayed will update as the ROI is being moved.
Click the triangle button and select Expand to Full Plot(s) Range in the fly-out menu to interpolate
the total area for the curve.
80
Data Analysis
7. This gadget also allows you to find Y values from a given X value. Select Interpolate X/Y in fly-out menu
to open the Interpolate Y from X dialog. You can enter multiple X values and click the interpolate
button. This tool will output the interpolated Y values for each of the X values.
8. The interpolated Y values can be output to Script Window, Result Log, or a specified worksheet.
81
Tutorials for Origin
4.2.7.1 Summary
Origin supports the Cluster Gadget to perform simple statistics on a region of interest (ROI) in a graph. The
gadget can also be used to edit, clear, mask, or categorize data points. The statistics results are dynamically
updated as the ROI object is moved or resized.
How to edit the data points such as clear, or mask points in graph using menu options or buttons.
How to view or output the statistic for points inside and outside of the ROI.
How to categorize data points and color map points with the categorical data
1. Start with a new workbook and import the Origin sample data Categorical Data.dat which is located in
<Origin Program Folder> \Samples\Graphing.
Right-click on Col(D) and select Sort Worksheet: Ascending. Then you will see the worksheet is sorted
by the category of Drug.
82
Data Analysis
3. Select Plot: Symbol: Scatter from the main menu to create a graph. The graph with three plots
display the recovery for each drug.
83
Tutorials for Origin
4. Right-click on the graph legend and select Properties to open Object Properties dialog. Then edit
the legend as shown below. Click OK button.
5. Select Gadgets: Cluster from the Origin menu to bring up the Cluster: addtool_cluster dialog box.
Choose Circle in the Shape drop-down list of the ROI Box tab.
84
Data Analysis
6. Click OK button. It will add a yellow circle for ROI on the plot and bring up the Cluster Gadget
dialog.
85
Tutorials for Origin
7. Move the yellow circle to the region for which you want to get statistics and see the results shown on
the Inner Points tab of the dialog.
86
Data Analysis
8. Click the Output Statistics Report button . The results are output to the Result Log, Script Window,
and the Cluster workbook.
9. Click the Go to Report Worksheet button , then the Cluster workbook will be shown.
In this section, we will show you how to exclude a specific plot from the cluster. Based on the example above,
we will do simple statistics on Recovery of Drug A and Recovery of Drug B, excluding Recovery of Placebo.
87
Tutorials for Origin
1. Click the Data menu in the Cluster Gadget dialog and uncheck Plot(1) and Plot(2). The first and
second rows become gray in the lower panel, and they can no longer be manipulated by the buttons in the
dialog.
2. Click Mask Data Points button . The Recovery of Placebo data points in the ROI are masked and the
color becomes red. At the same time the statistics results for Recovery of Placebo become missing values.
3. Click the Output Statistics Report button . The results are output to the Result Log, Script Window,
and the Cluster workbook.
1. Click Settings: Preferences from the Cluster Gadget dialog's menu to open the Cluster Manipulation
Preferences dialog.
2. Go to the Calculation tab. Click the Calculate Outer Points check box.
88
Data Analysis
3. Click the OK button, the statistics results for points out of the ROI are shown on the Outer Points
tab of the dialog.
89
Tutorials for Origin
4. Click the Output Statistics Report button . The results for inner and outer points are shown in the
Result Log, Script Window, and the Cluster workbook.
You can categorize data points from graph directly and output the Categorical group column to the source
worksheet, and further map symbol characters to the categorical group column.
Create a new workbook and re-import the sample data <Origin Program
Folder>\Samples\Graphing\Categorical Data.dat. Highlight Column(B) and plot a Scatter graph.
Data points cluster into 4 groups. We will use the Create Categories feature of Cluster Gadget to create a
categorical column according to the cluster groups and map symbol color to this column.
90
Data Analysis
1. Select Gadgets: Cluster to bring up the Cluster: addtool_cluster dialog. Choose Circle in the Shape
drop-down list of the ROI Box tab.
Click OK button to add a yellow circle for ROI on the plot and bring up the Cluster Gadget dialog.
2. Move and adjust the size of the ROI box to circle only the first cluster of data points at the low-left
corner.
Click the Create Categories button on the Cluster Gadget dialog to open the Create
Categorical Value dialog. Enter Group for Category Group Name and 1 for Category. And select
the Color Data by Category check box.
Click the OK button. A new categorical column named "Group" is added to the source data sheet and
data points inside ROI are tagged as "1" in this column(Group). Also, scatter plot use this
categorical column as the color index.
91
Tutorials for Origin
3. Repeat step 2 for the rest of 3 clusters and tag them as 2, 3, 4 in sequence.
92
Data Analysis
93
Tutorials for Origin
5. Delete the original legend. Select Graph: Legend: Categorical Values to bring up the legendcat
dialog. Uncheck the Show All Categories checkbox. Click OK. The scatter plot with new legend
should look like following.
4.2.8.1 Summary
94
Data Analysis
The Quick Fit gadget can be used to quickly perform curve fitting within the ROI (Region of Interest) range.
4.2.8.3 Steps
1. Open Origin and choose File:Import:Import Wizard. For the Data Source, browse to <Origin
Folder>/Samples/Curve Fitting and add the Step01.dat. Note that when this file is selected, the import
filter Data Folder: step is automatically chosen (this is shown in in the Import Filters for Current Data
Type box). Click Finish to import the file.
2. Highlight through column A to F and click the button to generate a scatter plot.
3. Select Gadgets: Quick Fit: 1 Linear(System) from the main menu to add a region-of-interest
(ROI) box on the graph. Click the arrow button and select Expand to Full Plot(s) Range from
the fly-out menu to expand the ROI box to the full plot range.
95
Tutorials for Origin
4. Click the arrow button and select Preferences... from the fly-out menu. This opens the Quick Fit
Preferences dialog. In this dialog, go to the Label Box tab, select Equation with Values for the
Equation drop-down list.
96
Data Analysis
5. Go to the Report tab, select Worksheet for the Output To drop-down list.
97
Tutorials for Origin
6. Click OK to close this dialog. Click the arrow button to select New Output from the fly-out menu.
This outputs the plot fitting results "Sensor 01" to the report worksheet and adds a label box to the
graph window. The label box reports your analysis results.
98
Data Analysis
7. Select the label box on the graph and delete it. Click the arrow button and select Preferences... from
the fly-out menu. This opens the Quick Fit Preferences dialog. In this dialog, go to Label Box tab,
uncheck the Add Label Box to Graph check box and click OK.
8. Click the arrow button again to select New Output for All Curves(N) from the fly-out menu, so that
the customized linear fit process will be performed on all data plots.
9. Click the arrow button one more time to select Go to Report Worksheet. You will see the fitting
results of all three plots in the report worksheet. Note, the first result row has been created at step 6
above and the last three rows are our current results.
Note: With the ROI box shown on graph, you can click the arrow button to select Switch to Linear
99
Tutorials for Origin
Fit... from the fly-out menu to transfer your current settings to the Linear Fit dialog. Then, you can do
further operations in this more powerful dialog to do linear fitting.
1. Start with a new workbook and import the Origin sample data Gaussian.DAT which is located in <Origin
Program Folder>\Samples\Curve fitting path.
2. Highlight the Col(B) and select Plot>2D: Scatter: Scatter from the Origin menu to draw a graph.
3. Select Gadgets: Quick Fit: 4 Peak - Gauss (System) from the Origin menu to add a ROI box to
the graph.
100
Data Analysis
4. Click the arrow button to select Expand to Full Plot(s) Range from the fly-out menu to expand the
ROI box to the full plot range.
5. Click the arrow button and select Preferences... from the fly-out menu. This opens the Quick Fit
Preferences dialog. In this dialog, go to the ROI Box tab, and set the Parameter List as below.
101
Tutorials for Origin
6. Click OK to close this dialog. Click the arrow button and select New Output from the fly-out
menu. A label box will be added to the graph as shown below.
102
Data Analysis
7. Click the arrow button and select Preferences... from the fly-out menu. This opens the Quick Fit
Preferences dialog again. In this dialog, go to the Label Box tab, choose Use ROI Box Tab
Settings for Parameter Table. Click OK to close this dialog.
103
Tutorials for Origin
8. Click the arrow button and select Update Last Output from the fly-out menu. The Label box will
be updated and only the parameters "xc" and "FWHM" will be displayed.
104
Data Analysis
9. Click the arrow button and select Save Theme from the fly-out menu. In the Theme Save as...
dialog, set the Theme Name as My_Gauss and click OK.
10. Go back to the worksheet, highlight col(C) and select Plot>2D: Scatter: Scatter from the top menu. This
draws a scatter graph.
105
Tutorials for Origin
11. Click on the new plot to activate it and select Gadgets: Quick Fit: 9 My_Gauss to load the theme. A ROI
box will be added to the graph with parameters xc and FWHM displaying above the ROI.
12. Click the arrow button to select Expand to Full Plot(s) Range from the fly-out menu to expand
the ROI box to the full plot range, and then select New Output from the fly-out menu to output the
result. You can see that our theme is applied as the label box on the graph only reports the values of
parameter "xc" and "FWHM".
Note: With the ROI box shown on graph, you can click the arrow button to select Switch to NLFit...
from the fly-out menu to transfer your current settings to the NLFit dialog. Then, you can do further
operations in this more powerful dialog to do nonlinear fitting.
4.2.9.1 Summary
The Quick Peaks gadget can be used to pick peaks, subtract baseline, integrate the peaks and/or fit peaks in a
ROI (Region of Interest). It is also possible to use this tool in combination with the Peak Analyzer. Please
refer to this tutorial for details.
106
Data Analysis
Find and subtract baseline for spectrum with the Quick Peaks gadget.
4.2.9.3 Steps
1. Create a new workbook by clicking the New Workbook button . Click the Import Single ASCII
button and import the Zircon.dat file in the <Origin Folder>\Samples\Spectroscopy\ path. Both
buttons are located on the Standard toolbar.
2. Highlight Col(B) and plot a line graph with the Line button on the 2D Graphs Toolbar.
3. Select Gadgets: Quick Peaks from the main menu and open the Data Exploration:
addtool_quickpeaks dialog.
4. On the Baseline tab, set Mode to 2D Derivative, and then set Range to Full Plot Range. Click OK to
apply.
107
Tutorials for Origin
5. The peaks within the yellow ROI box will be found and marked. Resize the ROI box so that it covers X
range[0,7000] as shown in graph below, the baseline and peak finding need a further refinement.
6. Click the triangle button and select Preference from the fly-out menu, so you can further adjust the
Smoothing Method in Baseline tab follows the graph:
108
Data Analysis
click Apply to apply, and further adjust the values in Find Peak tab:
7. Click OK to apply the settings and close the dialog, the baseline and peaks finding are better than before
which can be attribute to the optimizing Threshold and Maximum Anchor Points for Baseline and
109
Tutorials for Origin
8. Click the triangle button and select New Output from the fly-out menu to output the peak finding
results to a report worksheet.
Return to the gadget fly-out menu and select Go to Report Worksheet to view the quantities output:
9. Activate the graph window to which the gadget was applied, click the triangle button and select
Subtract Baseline, click OK for pop-up window, the baseline was subtract from the data:
Click cross button on the top left corner to close the gadget. The finished graph is shown like this:
110
Data Analysis
Note: For advanced fitting options, you can combine Quick Peaks gadget with Peak Analyzer.
4.2.10.1 Summary
The Quick Sigmoidal Fit gadget can be used to quickly perform a sigmoidal fit on a portion of your graph that
you define interactively as your region of interest (ROI).
4.2.10.3 Steps
111
Tutorials for Origin
1. Open Tutorial Data.opj and browse to the Quick Sigmoidal Fit Gadget folder in Project Explorer
(PE).
2. Highlight Col(A) through Col(D) in the workbook DoseResponseN and from the menu choose
Plot:Symbol:Scatter to plot a scatter graph.
3. Double-click the X axis to open Axis dialog. In the Scale tab, set the Type as Log10 and click OK
button to close the dialog.
112
Data Analysis
4. Click the Rescale button to show the plot with the proper scale.
113
Tutorials for Origin
5. Select Gadgets: Quick Sigmoidal Fit... from the main menu to open the addtool_sigmoidal_fit
dialog box. Select the function Logistic5 from the Function drop-down list on the Settings tab.
6. Click the ROI Box tab and uncheck the parameters x0, h, and s under the Parameter List branch.
114
Data Analysis
7. Click the Fit Curve tab, select Mean, SD from the Plot Type drop-down list and Source Book, New
Sheet from the Output Fit Curve To drop-down list.
115
Tutorials for Origin
8. Click OK to add the ROI box to the graph. At the top right corner of the ROI box, click the Arrow
button to select Expand to the Full Plots Range from the menu. The ROI box will cover the full
data range on the graph.
116
Data Analysis
9. Click the arrow button again to select Preferences... from the menu. This opens the Sigmodial
Fit Preferences dialog box. In this dialog, click the Report tab and set Output To as None.
10. Click OK to close the dialog box. Click the arrow button to select Change Function: Logistic and
change the fitting function to Logistic. The label text on top of the ROI box will update automatically.
117
Tutorials for Origin
11. Click the arrow button to select New Output and output the fitting result to the worksheet and
graph.
118
Data Analysis
When using the Quick Sigmoidal Fit gadget you can easily switch to the NLFit tool. This makes it easy to get a
detailed fit report using the current fitting settings in the gadget.
2. Click the arrow button to select Switch to NLFit... to open the NLFit dialog with the inherited
settings.
119
Tutorials for Origin
3. Click the Fit button to perform curve fitting. The results are output to the result sheets and the
source graph.
120
Data Analysis
With his gadget you can also quickly find X/Y values on the fitted curve.
2. Click the arrow button to select Find X/Y... from the menu to open the Find X/Y dialog.
121
Tutorials for Origin
3. Select the Worksheet radio box and enter 40;45;50 for Y, then click Find X to show the
corresponding X values in the empty X box. Then, click the Output button and the X and Y values are
output to the specified worksheet.
4. Click the Go button beside the Worksheet radio box to open the Find X/Y workbook. Click the
Close button to close the Find X/Y dialog.
122
Data Analysis
4.2.11.1 Summary
Multiple gadgets can be used in combination to achieve certain goals. To avoid overlapping of several gadget
windows over same plot, we can arrange them into different layers to layout them onto different panels. The
results from all other gadgets can be eventually added to the last gadget window and kept updated at each
new output. In this tutorial, we will illustrate an example to show how we can combine the use of Quick
Peaks, Quick Fit and Intersect gadgets to find the intersection point between the baseline and slope of a
curve.
how to output Gadget analyzed results onto a specific graph and keep them updated.
how to find the intersection point of baseline with the linear fitting of a curve.
1. Start with a new workbook and import the file \Samples\Curve Fitting\Gaussian.dat.
2. To avoid overlapping the gadgets in one graph, we are going to prepare a multi-layer graph as shown
below with same data in each layer.
3. Click and select the second column and use the menu item Plot:Multi-Curve:4 Panel to create a 4 panel
plot.
123
Tutorials for Origin
Note: To make the explanation of following steps more clear, we marked above figure with blue font
to help you distinguish the layers in the graph.
4. Go back to the workbook, select the Amplitude column, and position the cursor at the edge of the
column, until you see the cursor turn into . Then you can drag-and-drop the column into layer 2 on
the graph page and click OK to close the appeared dialog box. Do it again to add the plot to layer 3 in the
panel, and then click the bottom right area to select the unwanted layer 4 and use the Delete key on the
keyboard to delete it.
124
Data Analysis
1. Select Gadgets:Quick Peaks from the Origin menu when layer 1 is active to bring up the Data
Exploration:addtool_quickpeaks dialog box. According to the lineshape of this curve, spline connection
would be a better choice for fitting the baseline. To do so, go to the Baseline tab, choose Spline in the
Connect Method drop-down list to connect anchor points with spline method.
125
Tutorials for Origin
2. Since we do not want to create new columns in the source sheet to save baseline data at every new
output, we can save the result to a new workbook and the newly created baseline data will replace
existing data instead. To do so, go to Output to tab, uncheck the Append to Worksheet box and check
the Output Baseline to Worksheet to output baseline data into a new book QkPeak with sheet name as
Baseline.
126
Data Analysis
3. Click OK to close the dialog box. Place the mouse cursor over the edge of the Region of Interest (ROI),
when the cursor turns into a double arrow icon, you can resize the box as needed.
127
Tutorials for Origin
4. Click the triangle button at the top right corner of the ROI to open the fly-out menu and choose New
Output(O) to output baseline data.
128
Data Analysis
4.2.11.5 Using Quick Fit to find the linear fit of the curve
1. Activate the second layer by clicking on the layer icon on the top left corner of the graph or directly
click on the plotting area of top right panel.
2. Select Gadgets:Quick Fit:Linear(System) from the Origin menu to bring up the Quick Fit ROI, and
adjust the position and range of appeared ROI properly to perform linear fitting over the left half of the
peak envelope.
129
Tutorials for Origin
3. Click the triangle button at the top right corner of the ROI to open the fly-out menu and choose
Preferences to customize Quick Fit Preferences dialog box.
4. Since we do not need other unnecessary output about this linear fitting, we can go to the Label Box tab,
uncheck Add Label Box to Graph.
130
Data Analysis
5. For the same purpose, to avoid outputting summary report we can go to the Report tab, choose None in
the Output To drop down list and click OK to close the dialog box.
131
Tutorials for Origin
6. Return to the triangle button at the top right corner of the ROI, choose New Output(O) to output
linearly fitted results to worksheet.
1. Before we apply the Intersect gadget, the first step to do is to add the fitted baseline and linearly fitted
line from last two gadgets to the third plot. To do so, click on the layer icon on the top left corner to
activate layer 3. Right click on the layer icon to choose Layer Contents to bring up Layer Contents-
Layer 3 window. Select the data with long name QuickFit Y1 and Baseline Y of Amplitude and add
132
Data Analysis
2. Click OK to close the window and the fitted baseline and linear line will display in the third layer.
133
Tutorials for Origin
3. Select Gadgets:Intersect from the Origin menu when layer 3 is active to bring up the Data
Exploration:addtool_curve_intersect dialog box. Click OK to close the dialog box and it will bring up
Intersect Gadget ROI.
4. Position and resize the ROI properly to have the intersection point between baseline and slope inside the
box. To exclude other intersection points with the original curve, go to the triangle button at the top
right corner of the ROI and uncheck Plot(1) Amplitude from the context menu of Change Data.
134
Data Analysis
5. Return to the triangle button at the top right corner of the ROI, choose New Output(O) to output the
result of intersection point between baseline and linearly fitted line.
135
Tutorials for Origin
1. Click on the layer icon to activate layer 1, reposition Quick Peaks ROI to create a new baseline. Then
go to the triangle button at the top right corner of the ROI, choose New Output(O) to output the
newly created baseline.
2. Click on the layer icon to activate layer 2, reposition Quick Fit ROI to the other side of the curve so it
will create a new linear fit line. Then go to the triangle button at the top right corner of the ROI,
choose Update Last Output(O) to output linearly fitted line result.
3. Click on the layer icon to activate layer 3, reposition Intersect ROI to have the intersection point
between newly created baseline and linearly fitted line inside the box. Then go to the triangle button at
the top right corner of the ROI, choose New Output(O) to output the result of new intersection point.
136
Data Analysis
137
Tutorials for Origin
Distribution Fit with the Probability Density Function and Cumulative Distribution Function
Fit Multiple Datasets by Fitting One and then Using Those Fit Parameters for Other Datasets
138
Data Analysis
4.3.2.2.1 Summary
An outlier is typically described as a data point or observation in a collection of data points that is "very
distant" from the other points and thus could be due to, for example, some fault in the measurement
procedure. Identification and removal of outliers is often controversial, and is typically "more acceptable" in
situations where the model used to describe the data is well known and well accepted.
Use the Recalculation mechanism to automatically update the result after outlier removal
The procedure described in this tutorial is also applicable to other fitting tools such as Polynomial and
Nonlinear Fitting
4.3.2.2.3 Steps
1. Start with a new workbook and import the file \Samples\Curve Fitting\Outlier.dat.
2. Click and select the second column and use the menu item Plot: Symbol: Scatter to create a scatter
plot.
3. With the graph active, use the menu item Analysis: Fitting: Linear Fit... to bring up the Linear Fit
dialog. Note that if you have used the Linear Fit dialog before, there will be a fly-out menu and you need
to select the Open Dialog... sub menu.
139
Tutorials for Origin
4. In the Fit Control tab, clear the Apparent Fit check box.
5. In the Residual Analysis tab in the dialog, and check the Standardized check box.
6. Change the Recalculate drop-down at the top of the dialog to Auto and press the OK button at the
bottom of the dialog. The dialog will close and linear regression will be performed on the data.
140
Data Analysis
7. Select the FitLinearCurve1 result sheet in the data workbook and scroll to the right side to view the
Standardized Residual column. You will note that the value in row 6 of this column is -2.54889:
8. Make the graph active and then click and hold down the mouse left button on the "Regional Mask Tool"
button in the Tools toolbar. Select the "Masked Points on Active Plot" submenu which will be the first item
in the fly-out menu:
9. With the above submenu selected, go to the graph and click on the 6th data point to mask the point (note
that you can drag out a rectangle around the point).
141
Tutorials for Origin
Masking this point changes the input data to the linear fit operation and the auto update mechanism will
trigger. The linear fit will be repeated with this particular masked point left out. The fit curve in the graph
and the parameters table will automatically update. The resulting graph should look like this:
142
Data Analysis
4.3.2.3.1 Summary
Non-linear kinetic models are widely used across many disciplines of natural science, such as, physics,
chemistry, biology. Experimentally, all the crucial parameters in kinetic models are obtained through fitting the
raw data. The intuitive way to fit the raw data is to do a non-linear fit with the expression directly from the
kinetic equation. Alternatively, linear fit can be applied if we can transform the equation in the way that the
dependent variable related to independent variable linearly.
Perform linear fit on same non-linear kinetic model using different linear transformations.
143
Tutorials for Origin
To perform linear fit on Langmuir model, we can transform it into linear equation in two different ways:
where the independent variable is y/x, dependent variable is y, slope is -1/K and intercept is ym.
2. Transform it into double reciprocal linear Langmuir equation:
where the independent variable is 1/x, dependent variable is 1/y, slope is 1/(ym*K) and intercept is 1/ym.
2. Click the Import Single ASCII button to bring up the Open dialog. Browse to \Samples\Curve Fitting
folder and select the file LangmuirModel.dat. Make sure the Show Options Dialog: check box is selected
and click OK to open the impASC dialog. Select No from Add Sparklines drop-down list under Import
Options node and click OK to finish importing.
3. Use Ctrl+D to bring up Add New Columns dialog, enter 4 and click OK to add 4 columns to store
transformed XY dataset later.
4. For traditional linear Langmuir model transformation, the independent variable is now y/x and dependent
variable is still y. Type y/x and y as the long name for column C and D respectively so that it will show as
X axis title, Y axis title respectively in later plot.
5. Type B/A in F(x) = formula cell in column C to set the value for independent variable y/x, and press
ENTER. Highlight column C, right click and select Set As:X to make it as the default X dataset for plotting
column D.
6. Type B in F(x) = formula cell in column D to set the value for dependent variable y, and press ENTER.
7. For double reciprocal linear Langmuir model transformation, the independent variable is 1/x and
dependent variable is 1/y. Similarly, make the long name of column E, F as 1/x, 1/y, respectively, and set
their column values as 1/A and 1/B accordingly. Set column E designation as X.
144
Data Analysis
1. First, we will perform linear fitting on traditional linear Langmuir transformation. Highlight column D and
select Plot:Symbol:Scatter to make a scatter plot.
2. To perform linear fitting, select Analysis:Fitting:Linear Fit:Open Dialog to bring up the Linear Fit
dialog box and click OK to close dialog. In the appeared prompt, choose No and click OK.
145
Tutorials for Origin
3. Similarly, to perform linear fit on double reciprocal linear Langmuir transformation, highlight column F
follow the steps above to create a scatter plot and then do a linear fit.
146
Data Analysis
The coefficients in Langmuir model are then can be calculated using corresponding slope and intercept
expressions.
Alternatively, we can use apparent linear fit to directly perform linear fit on raw non-linear kinetic data by
customizing only the axis scales. Take Langmuir kinetic model for example, based on double reciprocal
Langmuir linear transformation we found that the inverse of original dependent variable 1/y is in linear
relationship with the inverse of original independent variable 1/x. Therefore, if set the X scale as 1/x and set
the Y scale as 1/y, raw Langmuir kinetic data would appear with linearity.
1. To perform apparent linear fit on Langmuir kinetic raw data, highlight column B and select
Plot:Symbol:Scatter to make a non-linear scatter plot.
147
Tutorials for Origin
2. Double click on the X axis to bring up Axis dialog, set From as 0.08 and To as 3. Then select Custom
Formula from the Type drop-down list and input 1/x as the Direct Formula and 1/x as the Inverse
Formula. Choose Fixed From in the Rescale drop-down list. Click OK to close the dialog.
148
Data Analysis
3. As can be see from the plot, the default X axis ticks are not well separated. To make the ticks of X axis
display reasonably, we will create a dataset to set the positions of ticks. To do so, activate LangmuirModel
worksheet and use Ctrl+D to add one more column. Enter dataset 0.1, 0.15, 0.2, 0.3, 0.4, 0.7, 1, 3 in
newly added column G.
4. To use column G as major tick positions for X axis, double click on the X axis to bring up Axis dialog. Then
go to Major Ticks node choose By Custom Positions from Type drop-down list and choose
[LangmuirModel]LangmuirModel!G from the Dataset drop-down list.
149
Tutorials for Origin
5. Click Vertical icon on left panel, similarly, choose Custom Formula from Type drop-down list and input
1/x in both Direct Formula and Inverse Formula boxes. Click OK to close the dialog box.
150
Data Analysis
6. To perform apparent linear fit, select Analysis:Fitting:Linear Fit:Open Dialog to bring up the Linear
Fit dialog box. In the Fit Control tab, we can see that by default the Apparent Fit box is checked.
151
Tutorials for Origin
152
Data Analysis
7. Click OK to close dialog and choose No radio box in the prompt, then click OK to close it.
where the independent variable is ln(x), dependent variable is ln(y), slope is 1/n and intercept is ln(K), K and
n are the coefficients to be determined.
Apparent linear fit is recommended since Ln scale is a build-in scale setting. To fit this non-linear kinetic
model, use apparent fit with X and Y axis scales both set to be Ln scales.
Alternatively, you can perform linear fit after you calculate the Ln value of both X and Y dataset. See the
example of Langmuir model above for details.
The non-linear kinetic equation for Lagergren's pseudo-first oder model is as below:
153
Tutorials for Origin
Apparent linear fit is recommended since Log scale is a build-in scale setting. To fit this non-linear kinetic
model, first calculate and then use apparent fit with only Y axis scale set to be Log scale.
Alternatively, you can firstly calculate and use this newly created data to do linear fit
directly. Refer to the example of Langmuir model above for details.
where the independent variable is x, dependent variable is x/y, slope is and intercept is ,
and are the coefficients to be determined.
To linearly fit this model, you have to firstly calculate x/y and use this newly created data to perform linear fit.
where the independent variable is 1/x, dependent variable is 1/y, slope is and intercept is .
For this transformation, we can either perform linear fit once we created new independent variable data as 1/x
and new dependent variable data as 1/y. Or we can perform apparent linear fit by set both X and Y axis scales
as 1/x scale. Please refer to Langmuir model for more details.
154
Data Analysis
Distribution Fit with the Probability Density Function and Cumulative Distribution Function
Fit Multiple Datasets by Fitting One and then Using Those Fit Parameters for Other Datasets
4.3.3.2.1 Summary
Nonlinear fitting in Origin is performed using the NonLinear Fitting (NLFit) dialog box. The NLFit tool contains
more than 200 built-in fitting functions used in many different disciplines.
To do a quick and simple fit without opening the NLFit dialog, try the Quick Fit Gadget.
155
Tutorials for Origin
1. Click File:Open... to open the Intro_to_Nonlinear Curve Fit Tool.opj from the \Samples\Curve
Fitting folder and select the Built-In Function folder from the Project Explorer window.
2. With the Graph1 active, select the menu item Analysis: Fitting: Nonlinear Curve Fit to bring up the
NLFit dialog, and then select Gauss from the Function drop-down list:
3. In the Parameter tab, initial parameter values are automatically assigned, because the built-in functions
have parameter initialization code.
If you go to the Residual tab, you can see the current residuals and decide whether the current fit results
are acceptable.
156
Data Analysis
4. Note that a fitted curve drawn using the initial parameter values, is shown in the graph.
5. Click the Fit until converged button .To see if the fitting operation was successful, click the
Messages tab and note the number of iterations, reduced chi-sqr value, R^2 value, etc.
157
Tutorials for Origin
6. Click the OK button. The FitNL1 report sheet is created with fit results including parameter values and fit
statistics.
158
Data Analysis
7. Reopen the Nonlinear Curve Fitting dialog by clicking on the green lock icon on the upper left corner of the
graph and selecting Change Parameters.
8. Go to the Parameters tab, change the value of xc to 25 (note that by double-clicking in the cell, you can
edit the value) and select the Fixed check box.
9. Once again, click the Fit until converged button and then OK.
159
Tutorials for Origin
10. In the report sheet, you can see that fixing the value of xc to 25 results in a Standard Error of 0.
In this section, we will show you how to define your own fitting function and use it in the Nonlinear Curve Fit
tool
Our function is y=y0+a*exp(-b*x)
1. With the project file used in the first section opened. Select Tools: Fitting Function Builder... menu to
bring up the Fitting Function Builder dialog box.
2. On the Goal page, click Create a New Function, then click the Next button to go to the Name and
Type page.
3. On the Name and Type page, then name the function and select a Function Type. This function will be
put to the User Defined category by default.
160
Data Analysis
4. On the Variables and Parameters page, make sure Independent Variables reads x and Dependent
Variables reads y. Then input the comma-separated values y0, a, b into the Parameters text box. Click
the Next button.
161
Tutorials for Origin
independent variables x, click the Evaluate button , you will get a return value of the
dependent variable y which can be used to check the validity of this function.
162
Data Analysis
9. By successively clicking the 1 iteration button, you can see the change in parameter values as well as
the increasing conformance of the fitted curve.
163
Tutorials for Origin
164
Data Analysis
10. Click the OK button and the FitNL1 report sheet of fitting results is created. Here, you will find best-fit
parameter values and other fit statistics.
4.3.3.3.1 Summary
The NLFit dialog is an interactive tool which allows you to monitor the fitting procedure during the non-linear
fitting process. This tutorial fits the Michaelis-Menten function, which is a basic model in Enzyme Kinetics, and
shows you some basic features of the NLFit dialog. During the fitting, we will illustrate how to perform a Global
Fit, which allows you to fit two datasets simultaneously and share some parameter values.
165
Tutorials for Origin
4.3.3.3.3 Steps
4.3.3.3.3.1 Import the file
Click the Import Single ASCII button to bring up the Open dialog. Browse to \Samples\Curve Fitting
folder and select the file Enzyme.dat. Make sure to check the Show Options Dialog checkbox at the
bottom of the dialog, and then click Open.
In the impASC dialog, expand Import Options: Header Lines nodes, and select 3 from Comments
From drop down.
Select columns B and C and plot as a scatter plot by clicking the button.
166
Data Analysis
The single-substrate Michaelis-Menten function is a basic model used in enzyme kinetics studies.
The parameter is the reaction velocity, is the substrate concentration, is the maximal velocity,
and represents the Michaelis constant. Parameters and are important enzyme properties and
their values can be determined by fitting the M-M function to a vs. curve. While there is no M-M fitting
function in Origin, we can use a more general model, the built-in Hill function to perform the fit:
where is the cooperative sites. For a single-substrate model, we fix , thus simplifying the model so
that it behaves like the M-M function.
There are two curves, one is the reaction without an Inhibitor and the other is the reaction with a Competitive
Inhibitor. We will use the NLFit tool to fit these two curves simultaneously. Since for competitive inhibition
reactions, the maximum velocity is the same as with no inhibition, we can share the value during the
fitting procedure and perform a Global Fit.
With the graph active, select the menu item Analysis: Fitting: Nonlinear Curve Fit to bring up the
NLFit dialog. Select Hill function from Growth/Sigmoidal category on the Settings: Function Selection
page.
167
Tutorials for Origin
On the Settings: Data Selection page, click the triangular button next to the Input Data and choose
Add all plots in active page to set the data range.
Select Global Fit from Multi-Data Fit Mode drop-down list on the Settings: Data Selection page.
168
Data Analysis
Switch to the Parameters tab, check the Share box on the Vmax row. These Share check boxes are only
available when using Global Fit mode. Check the Fixed box for n and n_2, and make sure their values are
1.
Click the Fit button to generate the analysis reports. A table of fit parameters is pasted to the original
graph (only the fit parameter values table is shown in the following figure.)
169
Tutorials for Origin
From the fit result, we can conclude that the maximum velocity is 2162.8 . The value of for
the no inhibitor model is 1.78 . The value for the competitive inhibitor model is 4.18 .
As we know, the model parameters can also be estimated by the Lineweaver–Burk or double-reciprocal plot.
The Lineweaver–Burk plot takes the reciprocal of both sides of the M-M function and plots by 1/v vs. 1/[S]:
We will use the No Inhibitor data to illustrate how to calculate and by L-B plot.
170
Data Analysis
Go back to the raw data worksheet and add two more columns by clicking the button. Right-click on
column D and select Set As: X from the context fly-out menu to set it as an X column. Right-click on
column D again and select Set Column Values to bring up the Set Values dialog. In the dialog edit box,
enter: 1/Col(A) and set the Recalculate mode as None, since we don't need to auto update the
reciprocal values in this example.
Similarly, set column E's values as 1/Col(B). Enter the long name for column D & E as &
171
Tutorials for Origin
From the above equation, we know there is a linear relationship between 1/v and 1/[S], so we can
use the NLFit tool to fit a straight line on this plot. (You can also use the Fit Linear tool from Analysis:
Fitting: Fit Linear)
Bring up the NLFit dialog again, select Line function from Polynomial category, and then click the Fit
172
Data Analysis
From the plot, one may doubt that this is the best fit curve since there is a point located far away.
Actually, the right side of L-B plot is low substrate concentrations area, the measurement error may be
large, so we'd better exclude these points during fitting.
Click the lock icon on the graph upper-left corner, and select Change Parameters to bring back NLFit
dialog.
173
Tutorials for Origin
In Settings: Data Selection page, click the button on Input Data node, and then choose Reselect
All Data from Graph from fly-out menu.
174
Data Analysis
Then the NLFit dialog rolls up and your cursors become when you move to the graph page. Click
and draw a rectangle to select data points you want to fit. The input range is labeled by vertical lines.
You can also click-and-move these lines to change the input range.
Click the button on Select Data in Graph window to go back to NLFit dialog.
Click the Fit button on the NLFit dialog to recalculate the result. You can see from the graph that the
report table was updated.
175
Tutorials for Origin
Since the intercept of the fitted curve is , it is equal to 4.76191E-4 in this example. To get the
value, select Window: Command Window to open the command window, type
1/4.76191E-4 =
Origin returns the value 2099, which is close to what we got above, 2160. (When fitting the hill function
above, we shared when fitting two datasets. If you fit the No Inhibitor data only, this value will be
closer.)
4.3.3.4.1 Summary
176
Data Analysis
The term "global fitting" generally refers to simultaneous curve fitting operations performed on multiple
datasets. Because datasets remain distinct, they may or may not "share" parameter values during the fit
process. When a parameter is shared, a single parameter value is calculated for all datasets; When a
parameter is not shared, a separate parameter value is calculated for each dataset.
By contrast, "concatenated fitting" is performed by combining all datasets into a single dataset. Because curve
fitting operations are performed on a single dataset, only a single set of parameter values is returned.
Since 2016 SR2, an new app Sequential Fit has been released to do sequential fitting on multiple datasets.
With this app, the fit parameter values obtained from the current dataset will be used to initialize the
parameters of the next dataset. This is very applicable for those datasets, the common parameters of which
keep changing in turn.
4.3.3.4.3 Steps
2. Click the to import the file Enzyme.dat in the <Origin EXE Folder>\Samples\Curve Fitting\ folder.
3. Highlight column B and C and click the button to generate a scatter plot.
4. Keep the graph window activated and select the Analysis: Fitting: Nonlinear Curve Fit menu item to
open the NLFit dialog.
5. Set the Recalculate mode to Auto.
6. In the Function Selection page, choose the Hill function from the Growth/Sigmoidal category.
7. Go to the Data Selection page, click the triangle button next to the Input Data selection box and choose
Add All Plots in Active Layer, to add both plots as input data.
8. Select Global Fit mode from the Multi-Data Fit Mode drop-down list:
177
Tutorials for Origin
9. Go to the Parameters tab. Check the Fixed check box for n and n_2 to fix their values to 1.
10. Click the Fit button to fit curves. You will get these results from the Parameters table of the report
worksheet:
11. The fitted curves will be added to the original data plot.
178
Data Analysis
12. In this case, the maximum velocity Vmax may be the same, so we could share this parameter value when
fitting.
13. Click the green lock icon in the report worksheet and select Change Parameters to bring back the NLFit
dialog.
14. In the Parameters tab, check the Share check box for Vmax.
179
Tutorials for Origin
15. Click the Fit button again to update results. You can see the Vmax values for both curves are the same.
The asterisk in the parameter name indicates that this parameter is shared:
17.
4.3.3.5.1 Summary
This tutorial is aimed at solving the following problem: do global curve fitting on two or more curves using
different function for each curve, but sharing some parameters, the shared parameter was common to all the
datasets. This problem arises in a wide variety of scientific fields such as fiting for anisotropy spectrum.
180
Data Analysis
Perform global fit with parameter sharing for multiple fitting functions.
4.3.3.5.3 Steps
2. Click the to import the file MultiFunctionsFit.dat in the <Origin EXE Folder>\Samples\Curve Fitting\
folder.
3. Highlight column A, B and C and select the Analysis: Fitting: Nonlinear Curve Fit menu item to open
the NLFit dialog.
The user defined fitting function will be build in next 3 steps, the functions are built based on the
quantitative model below:
4. In the Function Selection page, choose the <new...> function from the User Defined category.
5. Enter "GlobalFit" as the function name, and set the Function Model and Function Type follows the graph
below:
181
Tutorials for Origin
182
Data Analysis
7. Type the expression which contained forluma of and in the function body box:
s*(A1*exp(-t/t0)+B1)/(A2*exp(-t/t0)+B2)-(s-1)*(A2*exp(-t/t0)+B2)
The parameter s is a switch for global fitting, if s=1, the is used for fitting, if s=0, is used for
fitting. The value of s will be controled in the following fitting procedure. Set the Initial Value of A1 and B1
183
Tutorials for Origin
8. Back to NLFit dialog, select GlobalFit function in User Defined Category. Go to the Data Selection Page,
Select Global Fit mode from the Multi-Data Fit Mode drop-down list:
9. Go to the Parameters tab. Check on the Share check box for A2, B2 and t0, then Check on the Fixed
box for s and s_2 to fix their values to 1 and 0, respectively. The setting of s will control fitting Col(B)
184
Data Analysis
10. Click the Fit button to fit curves. You will get these results from the Parameters table of the report
worksheet:
185
Tutorials for Origin
11. The fitted curves will be added to the graph window. You can check the fitted curve for Col(B)/ and
4.3.3.6.1 Summary
In previous Origin versions, one can only initialize fitting parameters with Origin C code. Since Origin 9.0 SR1,
it is also supported to use LabTalk script to initialize parameters. This implement is especially useful when one
wants to use worksheet values for the initial parameters.
186
Data Analysis
In this tutorial, three adsorption uptake curves at three different temperatures were measured, and the results
are exported in three .txt files. The experimental conditions are stored in the same .txt file as header info. We
are going to fit the data to the isothermal-spherical model, according to the following equation:
, where y is the normalized mass uptake (mg/g), x is the time span (s), T is the time constant (1/s), and the
fitting parameter.
There is an empirical equation describing the relationship between the temperature and time constant, which
is:
For the uptake curve at each temperature, we will calculate T from this equation and use it as the initial value
for the curve fitting.
Create a user-defined fitting function and use Labtalk script to do parameter initialization.
4.3.3.6.3 Steps
4.3.3.6.3.1 Write Parameter Initialization Script for a User-Defined Fitting Function
1. Select Tools:Fitting Function Builder(or press F8) to open the Fitting Function Builder, in the Goal
page, select Create a New Function and click Next.
2. In the Name and Type page, make sure the function is created under the User Defined category, name
the function UptakeCurveFit, keep the Function Model as Explicit, and select Origin C for Function
Type. Click the Next button.
3. In the Variables and Parameters page, keep the Independent Variables and Dependent Variables
as the default x and y, respectively. Set the Parameters to T and click Next.
4. In the Origin C Fitting Function page, type in the following equation in the Function Body edit box,
and then click Next.
y = 1 - 6/(pi^2)*exp(-(pi^2/T)*x)
187
Tutorials for Origin
5. In the Parameter Initialization Code page, select Use Custom Code radio butto, and then select the
Use Labtalk radio button to enable the use of Labtalk script. In the Initialization Code edit box, type in
the following script:
range rpage=ry.getpage()$;
range rlayer=ry.getlayer()$;
188
Data Analysis
int inext=rlayer.index;
win -a %(ry.getpage()$);
page.active=inext;
wks.col=2;
T=25000 - 58 * Temp;
Notes: The ry in the script above is an auto-defined range variable for the input data range of
parameter y, the syntax for such range variable is r+parameter name. For example, if the parameter
name is Temp, the range variable should be rTemp.
189
Tutorials for Origin
7. Click Finish to create the user defined fitting function UptakeCurveFit, you could find its .fdf file in the
User Files Folder.
1. Create a new Origin project by clicking the button on the Standard toolbar. Click the button (or
File:Import:Import Wizard or press Ctrl+3) to open the Import Wizard.
2. In the Data Source, select the UptakeCurve_343K.txt as the File, which is located under path
<Origin Folder>\Samples\Curve Fitting\. Click Next button to navigate to the Header Lines page.
Set the Long Names, Units, and Comments as 3, 4, and 1 to 1, respectively.
3. Click Finish to import the data file. Note that the experimental temperature is stored as the comment
of column 2, which will be retrieved by the Labtalk script for parameter initialization in the
UptakeCurveFit fitting function.
190
Data Analysis
4. Highlight column B and select Analysis:Fitting:Nonlinear Curve Fit (or press Ctrl+Y) to open the NLFit
dialog, select User Defined for Category and UptakeCurveFit(User) as Function.
5. An attention box pops up and shows the experimental temperature and the calculated initial value of
time constant.
6. Go to the Parameters tab, see that the initial parameter for T is 5106, which is calculated from the
experimental temperature. This indicates the parameter initialization script is successfully called.
7. Go to the Code tab and select the Parameter Init section, there you could double check the parameter
1. Go to the report sheet FitNL1 which is generated from previous steps, click the triangle button right
to the Summary table and choose Create Copy as New Sheet. A new sheet will be created, delete
column A in the new sheet and rename it as Result.
191
Tutorials for Origin
2. Keep the workbook active and select File:Save Workbook as Analysis Template to save this workbook
as MyUptakeFit.ogw.
3. Create a new Origin project and select File:Batch Processing to open the batchProcess dialog.
5. Click OK to carry out the batch processing, for every file being executed, the attention box pops up
and indicates the initial value being used, click OK every time to close the attention box and continue
the batch processing. Finally, a summary report will be created:
192
Data Analysis
4.3.3.7.1 Summary
Besides the 200+ built-in fitting functions, you can also create your own fitting functions in Origin. Origin
provides three tools for fitting with user defined function:
Simple Fit App provides a much more convenient way to fit simple functions that can be expressed in
the form y = f(x), you only need to type your formula, specify the initial values and then generate fitting
reports immediately. You can learn how to use this App in the linked File Exchange page.
Quick Fit gadget is another easy way to do both linear and nonlinear fitting without open the Linear Fit
or NLFit dialog which might look a little bit complicated but with many advanced controls. Start a fitting
process with this gadget, you need first add your own function into the Function List.
NLFit tool.
NLFit tool is a powerful fitting wizard which allows you to define more complex fitting functions and
control the fitting process in every possible way. For fitting user defined function in NLFit tool, you will
need to create it in Fitting Function Builder first.
In this tutorial, we will mainly illustrate how to create a user-defined fitting function in Fitting Function
Builder, carry out nonlinear curve fit with it and also show how to fix a parameter for curve fitting using NLFit
tool.
193
Tutorials for Origin
4.3.3.7.3 Steps
The data we are going to fit is the file ConcentrationCurve.dat under the <Origin EXE
Folder>\Samples\Curve Fitting\ path.
in which
In this section, we will show how to create a user defined fitting function in the Fitting Function Builder. But
there is an alternative tool Fitting Function Organizer which also can be used to create user defined fitting
functions(open it by selecting Tools:Fitting Function Organizer or pressing F9).
1. Launch Origin and choose Tools:Fitting Function Builder (or press F8) to open the Fitting Function
Builder.
2. In the Goal page, select Create a New Function and click Next.
194
Data Analysis
3. In the Name and Type page, change the setting as the following image and then click Next:
4. In the Variables and Parameters page, enter the variable and parameter names as the image below
and then click Next:
195
Tutorials for Origin
A*exp(R0*k*x-km)*sqrt(R0+c/(x-c0))
Note:You can also give different initial values each time before you actually carry out the fitting.
8. Can click the Evaluate button to quick check whether the function is valid(if it is valid, an actual value
will be returned for y).
196
Data Analysis
Note:If you used Origin C as Function Type at the beginning, you can also compile the function at this
stage to check if there is any error, this is especially useful for brackets matching.
9. Click the Next button three times until it goes to Derived Parameters page.
10. In this page, we will define the derived parameter A0, enter its equation in the Derived Parameters
Equations box:
A0=-A*exp(km)*1E-4
11. Click Finish to create this user defined fitting function. The .FDF file for it will be stored in the User Files
Folder.
You can always modify the user defined fitting function later, either in the
Fitting Function Builder(choose Edit a User-defined Function in Goal
page), or in the Fitting Function Organizer.
1. Create a new workbook.Click the button to import the ConcentrationCurve.dat file under <Origin
EXE Folder>\Samples\Curve Fitting\ path.
7. The parameters A and km have mutual dependence, so fixing either one will solve the problem. We will
fix A this time.
197
Tutorials for Origin
8. Go to the Parameters tab, click the to restore the initial value setting, check the Fixed box of
parameter A:
198
Data Analysis
11. A report sheet will be generated as well, in which the fitted value of all parameters(including the derived
parameter A0) are reported in the parameters table:
4.3.3.8.1 Summary
Origin provides a NonLinear Surface Fit tool to fit surface. Besides the built-in surface fitting functions, you
can also create your own fitting functions in Fitting Function Builder.
In this tutorial, we will illustrate how to create a user-defined surface fitting function in Fitting Function
Builder, and carry out nonlinear surface fit with it using NLFit tool.
Create a user-defined surface fitting function using the Fitting Function Builder.
4.3.3.8.3 Steps
The data we are going to fit is the file PolynomialSurface.dat under the <Origin EXE Folder>\Samples\Curve
Fitting\ path.
199
Tutorials for Origin
in which
In this section, we will show how to create a user defined surface fitting function in the Fitting Function
Builder. But there is an alternative tool Fitting Function Organizer which also can be used to create user
defined surface fitting functions(open it by selecting Tools:Fitting Function Organizer or pressing F9).
1. Launch Origin and choose Tools:Fitting Function Builder (or press F8) to open the Fitting Function
Builder.
2. In the Goal page, select Create a New Function and click Next.
3. In the Name and Type page, select Surface Fitting from Select or create a Category drop-down list
since Nonlinear Surface Fit tool lanches functions in the Surface Fitting category only.
4. Enter a name "MyPolynomialSurface" in Function Name and select Expression for Function Type. Click
Next.
200
Data Analysis
5. In the Variables and Parameters page, enter the variable and parameter names as the image below
and then click Next:
z0+A1*x+A3*x^3+B1*y+B3*y^3+C*x*y+C2*x^2*y+C3*x*y^2
201
Tutorials for Origin
7. Give estimated initial values to the parameters according to this particular data and function.
1. You can also give different initial values each time before you actually
carry out the fitting.
2. You Can click the Evaluate button to quick check whether the
function is valid(if it is valid, an actual value will be returned for z).
8. Click Finish to create this user defined fitting function. The .FDF file for it will be stored in the User Files
Folder.
You can always modify the user defined fitting function later, either in the
Fitting Function Builder(choose Edit a User-defined Function in Goal
page), or in the Fitting Function Organizer.
202
Data Analysis
1. Create a new workbook. Click the button to import the PolynomialSurface.dat file under <Origin
EXE Folder>\Samples\Curve Fitting\ path.
2. Right click column C and select Set As: Z.
3. Keep the worksheet activated, select Analysis:Fitting:Nonlinear Surface Fit to open the NLFit dialog.
4. In the Function Selection page, you can see that Category is read only and set as Surface. Set
Function as MyPolynomialSurface(User).
5. Click the Fit button to carry out the fit.
6. A report sheet will be generated, in which the fitted value of all parameters are reported in the parameters
table. A FitSurfaceCurve worksheet is added to the source workbook as well, in which the data of fitted
surface is stored.
7. Activate the source worksheet and highlight col(C). Click the button to generate a 3D scatter plot. To
add the fitted surface to the source data, double click on the Layer 1 icon. In the Layer Contents dialog
that opens, set the drop-down list in the upper-left corner to Worksheets in Folder. Select FitZ of
FitSurfaceCurve1 worksheet in the panel below the drop-down, then click the downward-pointing arrow in
the middle of the dialog and change the plot type to 3D - Surface. Click on the rightward pointing arrow
just below it to add the dataset to the right panel.
203
Tutorials for Origin
Note:
A Polynomial Surface Fit App is available for Origin 2016 and higher. If you want to fit a polynomial
surface, it is recommended to try this App first.
4.3.3.9.1 Summary
204
Data Analysis
Sometimes, one may want to perform "Dataset Fitting", that is, the output may be composed of one or several
datasets, like:
For example, you may want to analyze a composite spectrum to find the contributions/ratio from individual
component spectra. This can be accomplished either by defining multiple independent variables or by
calculating the "combination" inside the fitting function.
4.3.3.9.3 Steps
Import the Composite Spectrum.dat file from the \Samples\Curve Fitting\ folder. In this sample data, we can
see that column A is the index, columns B and C are the values for the spectrum of components A and B.
Column D contains values obtained after reading a composite spectrum of components A and B. By fitting
column D to an equation determined by the component spectra of the pure forms of columns B and C, the
coefficients for the contributions of B and C (call them c1 and c2 respectively) can be found. (Note: In this
case, we supposed the independent and dependent variables have the same size. If not, interpolation is need.)
Bring up the Fitting Function Organizer and define a new fitting function as follow:
Independent Variables: a, b
Dependent Variables: ab
205
Tutorials for Origin
4.3.3.9.4 Results
C1 0.37169 0.00483
C2 0.66469 0.0047
To verify the fitted results, you can add a new column and Copy + Paste the fitted value, which comes from
the fitted Y (col(C)) in the worksheet FitNLCurve1, into it. Then Highlight the Composite and the fitted data
and plot a line graph to see how good the fit is:
206
Data Analysis
4.3.3.10.1 Summary
The Function Organizer tool can be used to create user-defined functions with more than one independent or
dependent variable. The NLFit dialog can then be used to fit with such functions. The preview window in the
NLFit dialog is capable of plotting only one quantity versus another. However, even if the preview does not
"make sense", the fitting process will correctly proceed, once proper data and parameter assignments have
been made.
Note that if you wish to fit multiple independent variables with an equation of the type
y = A0 + A1 * x1 + A2 * x2 + ...
you can make use of the Multiple Regression tool instead of the nonlinear fitter dialog.
Create a user-defined fitting function with two independent variables and one dependent variable
4.3.3.10.3 Steps
1. Start with a new workbook and import the file \Samples\Curve Fitting\Activity.dat.
2. Select Tools: Fitting Function Organizer from menu (or press F9) to bring up the Fitting Function
Organizer and define a new fitting function named MultiIndep in NewCategory (create the category if
it does not exist) as follow:
207
Tutorials for Origin
3. NOTE: Since we are using OriginC, case must match between defined names and their use in the
function definition. e.g. Substr does NOT equal substr.
4. Click Save and then OK to save the function and close the Organizer.
5. For more details about User Defined Fitting Function please refer to User Defined Fitting Function
using Origin C.
6. Highlight ONLY column C and select Analysis: Fitting: Non-linear Curve Fit from menu to bring up the
NLFit dialog. Select the function MultiIndep from NewCategory on the Settings: Function Selection
208
Data Analysis
page. Set the input datasets in the Data Selection page as follow:
7. Select the Fitted Curves page and expand the Fitted Curves Plot branch. Then select Same as Input
Data from the drop-down list next to the X Data Type branch.
209
Tutorials for Origin
9. Click Fit button to generate the fitting reports. You can see these results from the report worksheet as
below:
From the Statistics table we can know that the fitting is fairly successful.
0.1 0.10517
0.2 0.2214
0.3 0.34986
0.4 0.49182
0.5 0.64872
0.6 0.82212
0.7 1.01375
210
Data Analysis
0.8 1.22554
0.9 1.4596
1 1.71828
1.1 2.00417
1.2 2.32012
1.3 2.6693
1.4 3.0552
1.5 3.48169
1.6 3.95303
1.7 4.47395
1.8 5.04965
1.9 5.68589
2 6.38906
2.1 7.16617
2.2 8.02501
2.3 8.97418
2.4 10.02318
2.5 11.18249
2.6 12.46374
2.7 13.87973
2.8 15.44465
2.9 17.17415
3 19.08554
3.1 21.19795
3.2 23.53253
2. Add the file ocgsl.h in (User Files folder), before next step, make sure the gsl dlls are copied to this same
location, see Calling GNU Scientific Library.
ocgsl.h
211
Tutorials for Origin
// you can directly search and copy gsl function prototypes here
struct gsl_function_struct
FUNC function;
void * params;
};
typedef struct
size_t limit;
size_t size;
size_t nrmax;
size_t i;
size_t maximum_level;
double *alist;
212
Data Analysis
double *blist;
double *rlist;
double *elist;
size_t *order;
size_t *level;
gsl_integration_workspace;
double a, double b,
int key,
gsl_integration_workspace * workspace,
3. Press F9 to open the Fitting Function Organizer and then add a new function as follows:
213
Tutorials for Origin
4. Press the button on the right hand side of the Function Field to open the code builder and add the following
codes and compile: _nlfgsl_integration_qag.fit
#include "..\ocgsl.h"
return exp(alpha*x);
214
Data Analysis
void _nlsfgsl_integration_qag(
// Fit Parameter(s):
// Independent Variable(s):
double x,
// Dependent Variable(s):
double& y)
gsl_function F;
F.function = f_callback;
F.params = &beta ;
215
Tutorials for Origin
gsl_integration_workspace_free (ww);
y = y0 + a*result;
Furthermore, a more elaborate but efficient version of the fitting function is given as follows
//----------------------------------------------------------
//
#include <ONLSF.h>
#include "..\ocgsl.h"
return exp(alpha*x);
void _nlsfgsl_integration_qag(
216
Data Analysis
// Fit Parameter(s):
// Independent Variable(s):
double x,
// Dependent Variable(s):
double& y)
if ( pCtxt )
NLSFCURRINFO stCurrInfo;
pCtxt->GetFitCurrInfo(&stCurrInfo);
if ( bIsNewParamValues )
vector vx;
pCtxt->GetIndepData(&vx);
217
Tutorials for Origin
vInteg.SetSize(nSize);
gsl_integration_workspace *ww =
gsl_integration_workspace_alloc(1000);
gsl_function F;
F.function = f_callback;
F.params = &beta ;
vInteg[ii] = result;
218
Data Analysis
gsl_integration_workspace_free (ww);
y = y0 + a*vInteg[nCurrentIndex];
x;
Parameter Init
sort( x_y_curve );
double coeff[2];
a = coeff[0];
y0 = coeff[1];
beta=1.0
6. Fit using the user-defined function gsl_integration_qag, here are the results:
219
Tutorials for Origin
y0 = -1.06363E-6
a=1
beta =1
4.3.3.12.1 Summary
Origin allows user to define an Origin C fitting function using NAG special functions. You can call NAG routine
to evaluate the special function.
Here , and are the model parameters we want to obtain from the data fitting. and are the first
kind of Modified Bessel function of order 0 and order 1, respectively. For current example, we use the sample
data in the end of this tutorial. The fitting procedure can be outlined into the following steps:
Press F9 to open the Fitting Function Organizer and then create a new Category named
FittingWithNAGSpecialFunc. Define a new fitting function FittingWithBessel in the new category as follow:
Independent Variables: t
220
Data Analysis
Function:
Click the button (icon) beside the Function box to open the code builder and define and compile and save the
fitting function as follows:
#include <origin.h>
// For example, if you want to fit with functions from the NAG library,
#include <OC_nag8.h>
// Add code here for other Origin C functions that you want to define in this file,
// You can access C functions defined in other files, if those files are loaded and
compiled
// in your workspace, and the functions have been prototyped in a header file that
you have
// included above.
// You can access NLSF object methods and properties directly in your function
code.
221
Tutorials for Origin
// For instance, if your parameter name is P1, you cannot use p1 in your function
code.
// When using fractions, remember that integer division such as 1/2 is equal to 0,
and not 0.5
// For more information and examples, please refer to the "User-Defined Fitting
Function"
//----------------------------------------------------------
//
void _nlsfFittingWithBessel(
// Fit Parameter(s):
// Independent Variable(s):
double t,
// Dependent Variable(s):
double& inorm)
222
Data Analysis
if(fail1.code !=NE_NOERROR)
printf("%s\n",fail1.message);
if(fail2.code !=NE_NOERROR)
printf("%s\n",fail2.message);
After the function body is defined, you can click the Compile button in Code Builder to check syntax errors.
And then click Return to Dialog button to go back Fitting Function Organizer dialog box. Now click the
Save button to generate the .FDF file (Function definition file).
Once you have a .FDF file, you can click the Simulate button to simulate a curve, this will be very helpful to
evaluate the initial values. In the simcurve dialog, enter some proper parameter values and X range, and see
what the curve looks like in the Preview panel.
As it is a user-defined fitting function, you have to supply the initial guess values for the parameters before
performing your fitting task for the data. You may do it by set them manually in the Parameter tab in
Nonlinear Curve Fit dialog. For the sample data shown below, you can just set the initial values for the
parameters A = 1, td = 1, t0 = 1. After the parameters are initialized, you can then do the fitting to obtain the
fitting result, as shown to the right of the sample data.
223
Tutorials for Origin
Copy the below sample data and use Import Wizard to import the data from Clipboard, then do the fitting
using the given initial values for the parameters: A = 1, td = 1, t0 = 1.
X Y
2 0.7868954118
2.080808081 0.8133022141
2.161616162 0.8178216765
2.242424242 0.8427866729
2.323232323 0.8315815363
2.404040404 0.8484657180
2.565656566 0.8618233553
2.646464646 0.8745962570
2.727272727 0.8921620316
2.808080808 0.8687399759
4.3.3.13 Fitting Integral Function with parametric limit using NAG Library
4.3.3.13.1 Summary
Before you start delving into this tutorial, you are recommended to read the relevant tutorial in Fitting with
Integral using NAG Library. And as far as programming is concerned, the two tutorials are basically the same,
except that here you will learn to define Origin C fitting function with fitting parameters in the integral limit,
while in the previous tutorial we in fact define a fitting independent variable in the integral limit. Also note that
a different NAG integrator is used here.
224
Data Analysis
Create a fitting function with Definite Integral using the NAG integration routine
Use a log function to scale a large return value from the fitting function
For example, we will fit the sample data at the bottom of this page with the following model:
Note that we use to indicate the integral independent variable while indicates the fitting independent
variable. The model parameters , , , and are fitted parameters we want to obtain from the sample data.
To prepare the data, you just need to copy the sample data to an Origin Work sheet. The fitting procedure is
similar to the previous tutorial:
Press F9 to open the Fitting Function Organizer and add the User-Defined integral fitting function
nag_integration_fitting_cosh to the Category FittingWithIntegral, similar to the first tutorial.
Independent
x
Variables:
Dependent Variables: y
Parameter Names: a, b, c, d
Function:
Click the button beside the Function box to open the code builder and define and compile the fitting
function as follows: (Note: Remember to save the Function after compiling it and returning to the Function
Organizer Dialog):
#include <origin.h>
225
Tutorials for Origin
// For example, if you want to fit with functions from the NAG library,
#include <OC_nag.h>
// Add code here for other Origin C functions that you want to define in this file,
struct user
};
double aa, bb, fitX; // temp variable to accept the parameters in the
Nag_User communication struct
aa = sp->a;
bb = sp->b;
226
Data Analysis
fitX = sp->fitX;
return cosh((x*x+bb*bb*fitX*fitX)/(bb+fitX))/(aa+(x*x+fitX*fitX));
// You can access C functions defined in other files, if those files are loaded and
compiled
// in your workspace, and the functions have been prototyped in a header file that
you have
// included above.
// You can access NLSF object methods and properties directly in your function
code.
// For instance, if your parameter name is P1, you cannot use p1 in your function
code.
// When using fractions, remember that integer division such as 1/2 is equal to 0,
and not 0.5
// For more information and examples, please refer to the "User-Defined Fitting
Function"
227
Tutorials for Origin
//----------------------------------------------------------
//
void _nlsfnag_integration_fitting_cosh(
// Fit Parameter(s):
// Independent Variable(s):
double x,
// Dependent Variable(s):
double& y)
// you may use epsabs and epsrel and this quantity to enhance your desired
precision
Nag_QuadProgress qp;
228
Data Analysis
Nag_User comm;
struct user s;
s.a = a;
s.b = b;
s.fitX = x;
comm.p = (Pointer)&s;
// you may want to exam the error by printing out error message, just
uncomment the following lines
// if (fail.code != NE_NOERROR)
// printf("%s\n", fail.message);
// For the error other than the following three errors which are due to bad
input parameters
// You will need to free the memory allocation before calling the
integration routine again to // avoid memory leakage
229
Tutorials for Origin
NAG_FREE(qp.sub_int_beg_pts);
NAG_FREE(qp.sub_int_end_pts);
NAG_FREE(qp.sub_int_result);
NAG_FREE(qp.sub_int_error);
y = log(result);
// note use log of the integral result as return as the integral result is
large,
In the above code, we define the integrand as a callback function f_callback just outside the fitting function
body _nlsfnag_integration_fitting_cosh. Note that we parametrize the integrand function with the
variables a, b and fitX, and pass them into the callback funtion through the Nag_User struct. After that we
perform the integration using NAG integrator d01sjc. Besides, you can also use other Quadrature Routines as
you want. In the current example, we also use a log scale for the fitting function. (The sample data are already
scaled by a log function)
Compile the code, return to the dialog and then Save the fitting function in the function Organizer and open
the Nonlinear Curve Fit dialog in the Analysis-Fitting menu. You can then select this user-defined fitting
function in the Function Selection page under Setting Tab.
Similarly, as it is a user-defined fitting function, you have to supply the initial guess values for the parameters.
You may manually set them in the Parameter tab in Nonlinear Curve Fit dialog. For current example, you
230
Data Analysis
can just set the initial values for the parameters , , , . After the parameters are
initialized, you can perform the fitting to obtain the fitting result, as shown in the following.
X Y
-5 498.19046
-4.33333 329.43196
-3.66667 210.28005
-3 126.55799
-2.33333 69.01544
-1.66667 31.3555
-1 9.1393
-0.33333 -0.84496
0.33333 -0.99914
1 6.86736
4.3.3.14.1 Summary
Origin allows user to define an Origin C fitting function which involves an integral. You can call NAG functions
to perform the integration while defining the fitting function. There are built-in functions in Origin C which
perform integration. For the current example, the NAG solution is recommended. It has a better performance
compared to the built-in integration algorithm. Note that an infinite NAG integrator is used here.
231
Tutorials for Origin
Create a fitting function with a Definite Integral using a NAG integration routine
Here , and are the model parameters we want to obtain from the data fitting. The fitting procedure
can be outlined into the following steps:
Press F9 to open the Fitting Function Organizer and then create a new Category named
FittingWithIntegral. Define a new fitting function nag_integration_fitting in the new category as follow:
Independent
x
Variables:
Dependent Variables: y
Function:
Click the button beside the Function box to open the code builder then follow the steps below:
1. Scroll up to go to line
232
Data Analysis
#include <OC_nag.h>
2. Go to line
};
233
Tutorials for Origin
amp = sp->amp;
center = sp->center;
width = sp->width;
3. Go to line
234
Data Analysis
in the integral
Nag_QuadProgress qp;
Nag_User comm;
235
Tutorials for Origin
struct user s;
s.amp = A;
s.center = xc;
s.width = w;
comm.p = (Pointer)&s;
// Perform integration
// There are 3 kinds of infinite boundary types you can use in Nag
infinite integrator
// if (fail.code != NE_NOERROR)
// printf("%s\n", fail.message);
// For the error other than the following three errors which are
due to bad input parameters
// You will need to free the memory allocation before calling the
236
Data Analysis
NAG_FREE(qp.sub_int_beg_pts);
NAG_FREE(qp.sub_int_end_pts);
NAG_FREE(qp.sub_int_result);
NAG_FREE(qp.sub_int_error);
y = y0 + result;
In the above code, we firstly define the integrand as a callback function f_callback just outside the fitting
function body _nlsfnag_integration_fitting. Note that we parametrize the integrand function with the
variables amp, center and width, and pass them into the callback funtion through the Nag_User struct.
Inside the fitting function, we perform the integration using NAG integrator d01smc.
Calling NAG functions should be more efficient than writing your own routines. Using an analogous method,
you can perform finite, infinite, one-dimension and multi-dimension quadrature in your fitting function. Please
read the NAG Quadrature page and select a proper routine.
4.3.3.14.3.2 Set the Initial Values for the Parameters or Setup the Initial Code
As it is a user-defined fitting function, you have to supply the initial guess values for the parameters. You may
do it later by setting them manually in the Parameter tab in Nonlinear Curve Fit dialog.
After entering the function body codes, you can click the Compile button in Code Builder to check syntax
errors. And then click Return to Dialog button to go back Fitting Function Organizer dialog box. Now click
the Save button to generate the .FDF file (Function definition file).
Once you have a .FDF file, you can click the Simulate button to simulate a curve, this will be very helpful to
evaluate the initial values. In the simcurve dialog, enter some proper parameter values and X range, and see
what the curve looks like in the Preview panel.
237
Tutorials for Origin
Before you start to fit the curve, it is very helpful to simulate the function first. Performing integration may
take some time, if there is any mistake, you may see Origin "freeze" after you click the Fit button. So in the
Fitting Function Organizer dialog, select the function we defined and click the Simulate button. This will
bring up the simcurve X-Function. Enter some "guess" values and click the Apply button. If the simulated
curve looks like your source data, you can go further to fit.
Standard
Value
Error
y0 -0.00806 0.18319
A 3.16479 0.39624
xc -0.19393 0.10108
w 1.77252 0.33878
4.3.3.15.1 Summary
Since version Origin 8.6, Origin introduces a new LabTalk function, integral(), to do one-dimensional
integration. This function returns the integral value of:
238
Data Analysis
Perform integration on specified lower and upper limit and return the integral value.
If need, pass the subsequent arguments (Arg1, Arg2, ...) into the integrand function.
Using this feature, we can define a fitting function with integral() function, and pass proper fitting parameters
to the integrand, to do integration in curve fitting.
In this tutorial, we will modify the other tutorial, calling NAG functions to do integration during fitting, into
LabTalk form, and show you how simple and straightforward to fit an integration function.
Beginning with Origin 2018b, you can define a an implicit function using integrals
There are four parameters in the fitting function, and we need to pass three of them into the integrand, and
use the independent variable as upper limit, to do integration. So you should define the integrand first, and
then use the integral() function to perform integration inside your fitting function body.
1. Press F8 to open Fitting Function Builder dialog. Make sure choosing Create a New Function option,
and click Next to navigate to the next page.
2. In the Name and Type page, enter a function name, say MyIntegGauss. Leave the default function type
as Expression, and then check the Include Integration During Fitting checkbox. This will lead you to
a new page in the next step.
239
Tutorials for Origin
3. In the Integrand page, you can define the expression of the integrand. Currently, Origin supports
one-dimensional integral only, so the integrand should have ONE integration variable. In this
example, the expression of the integrand is:
The other variables, like xc, w, and A, are parameters of the integrand. To distinguish from fitting
parameters, we named them Arguments here, and use the arguments name ixc, iw, and iA instead. Later,
we can pass fitting parameters into these arguments. So, the integrand definition should looks like:
240
Data Analysis
Note that this is a LabTalk function. To get the integration value, you must have a RETURN statement in
the function body. And the integrand expression in this example should be:
4. When all set, click Next to go to the Variables and Parameters page to define the variables and
parameters for the fitting function as below:
241
Tutorials for Origin
5. The next Function page is where you define the fitting function body. Once you choose to include
integration in your fitting function at the beginning of the fitting function builder wizard, there is an extra
tab, Integrand, shown on this page. In this tab, you can map the fitting variables and parameters with
elements of the integrand, including lower limit, upper limit, and integrand arguments. And in this
example, we will map the variables as below:
Upper Limit x
ixc xc
iw w
242
Data Analysis
iA A
6. Once set up all the mappings as above table, click the Insert button, then well prepared integral()
function is inserted into the Function Body box as:
7. This expression means perform integration on the function, whose name is MyIntegrand, from
negative infinite to x, and pass the three fitting parameters, xc, w, and A to the integrand.
8. By adding the constant parameter, y0, into the expression, the whole fitting function body should be:
10.
243
Tutorials for Origin
11.
12. Then active the Parameters tab, and give some proper initial values for each fitting parameters as:
Now, you can click Finish button to save this fitting function.
X Y
-1.69897 0.13136
-1.22185 0.34384
-0.92082 0.6554
-0.82391 0.73699
-0.69897 1.00157
0 1.70785
0.30103 2.31437
0.69897 2.77326
1 2.79321
Highlight the Y column, and press Ctrl + Y to open the NLFit dialog. Select the function you just defined, and
click Fit button to perform fitting. The fitting result should be the same like using NAG function directly:
244
Data Analysis
4.3.3.16.1 Summary
In some circumstance, one may want to create fitting function with multiple integrals:
We refer to Fitting with Integral using LabTalk Function for detailed description of parameters in the
expression.
In version Origin 8.6, however, Fitting Function Builder just supports one integral in fitting function.
Bypassing complex Origin C code, we can use Fitting Function Organizer to reach the goal.
In this tutorial, we will show you how to create a fitting function comprised of two integrals using function
organizer. Of course, one can include more integrals as desired.
Beginning with Origin 2018b, you can define a an implicit function using integrals.
245
Tutorials for Origin
There are four parameters in the fitting function, and we need to pass three of them into the integrand, and
use the independent variable as upper limit, to do integration.
1. Press F9 to open Fitting Function Organizer dialog. Add a new function by pressing New Function
after you select a category in which you want to put your function. One can also add new category by
pressing the New Category button.
2. Specify the function name in the Function Name edit box as you like. Define Independent Variables,
Dependent Variables and Parameter Names in corresponding edit box.
3. Select the Function Form in the drop box. One can find explanations in the Hints tab at the bottom of
the dialog.
246
Data Analysis
4. In the Function edit box, define your fitting function. The integrals are written in the form of LabTalk
integral function.
As described in Fitting with Integral using LabTalk Function, x, a, b and wc are parameters passed
into the integrand functions.
5. Press the button at the right corner of Parameter Settings box to active Parameter Settings dialog.
Set initial values as well as other constraints such as lower bounds, upper bounds for each parameter.
247
Tutorials for Origin
6. Define the two integrals in the LabTalk Functions Definition and Initializations box. In this case, the
functions should be:
return ia*t ;
248
Data Analysis
7. We have successfully set our two integrals fitting function. You can set other information in corresponding
box. Do not forget to Save your fitting function after you finish.
X Y
-3 2.47613
-2.6 2.24016
-2.2 2.01543
-1.8 1.83094
-1.5 1.85038
-1.1 2.17725
-0.9 2.44967
-0.7 2.61423
-0.5 3.02305
-0.3 3.23057
249
Tutorials for Origin
-0.1 3.37822
0.1 3.2827
0.3 3.18775
0.5 2.86194
0.7 2.69104
0.9 2.39315
1.4 2.04046
1.8 1.85287
2.2 1.85325
2.6 2.20569
Highlight the Y column, and press CTRL + Y to open the NLFit dialog. Select the function you just defined, and
4.3.3.17.1 Summary
We have showed you how to perform fitting with an integral using the NAG Library, and now you'll learn how
to do that without calling NAG functions. In this tutorial, we will show you how to do integration by the
trapezoidal rule and include the summation procedure in the fitting function.
250
Data Analysis
We will fit the same model as the integral fit using NAG:
The difference is that we will perform the integration within the fitting function. Using the trapezoidal rule, we
will first divide the curve into pieces and then approximate the integral area by multiple trapezoids. The
precision of the result then depends on how many trapezoids will be used. Since this is a semi-infinite
integration, we will set an increment (steps) and construct trapezoids from the upper integral limit, x, to the
lower integral limit, negative infinity and then accumulate the area of these trapezoids. When the increment of
the area is significantly small, we will stop the summation. Before doing the summation, you should guarantee
that the function is CONVERGENT, or you should include a convergence check in your code.
Select Tools:Fitting Function Organizer or alternatively press the F9 key to open the Fitting Function
Organizer and then define the function as follows:
Independent
x
Variables:
Dependent Variables: y
251
Tutorials for Origin
Function:
Click the button (icon) beside the Function box to open Code Builder. Define, compile and save the fitting
function as follows:
#include <origin.h>
//----------------------------------------------------------
//
void _nlsfsummation(
// Fit Parameter(s):
// Independent Variable(s):
double x,
252
Data Analysis
// Dependent Variable(s):
double& y)
// Initialization
// Steps, or Precision.
do
// Trapezia area.
// Accumulate area.
dIntegral += dTrapezia;
x -= dStep;
253
Tutorials for Origin
// Set y value.
y = y0 + dIntegral;
3. Set in the Set Column Values dialog. This will make a sigmoidal curve.
4. Highlight columns A and B and create a scatter plot.
5. Then bring up the NLFit dialog by pressing Ctrl + Y. Select the fitting function we just defined and go to
the Parameters tab, initialize all parameters to 1 and fit. You should see these results:
y0 -0.00806 0.18319
A 3.16479 0.39624
xc -0.19393 0.10108
w 1.7725 0.33878
4.3.3.18.1 Summary
When fitting with a complex function, we can easily separate the complex function to two functions: one
corresponding to its real part and the other corresponding to its imaginary part. With these two functions, we
can define the complex fitting function with two dependent variables by Fitting Function Organizer and can
access it in NLFit dialog. We will illustrate how to fit with complex function below. More details about fitting
with multiple dependent or independent variable please refer to Fitting with Multiple Independent Variables.
Create a user-defined complex fitting function with two dependent variables and one independent variable
254
Data Analysis
4.3.3.18.3 Steps
1. Select whole form below (including header line) and right click to choose Copy to put the data in
clipboard.
Omega Y1 Y2
0 3 0
255
Tutorials for Origin
2. Select Import/ Import Wizard to open Import Wizard dialog. Then choose Clipboard in Data Source
group and click Finish to import the data.
3. Select Tools: Fitting Function Organizer from menu (or press F9) to bring up the Fitting Function
Organizer and define a new fitting function named ComplexFitting in NewCategory (create the
category if not exist) as follow:
complex cc = A/(1+1i*omega*tau);
Function: y1 = cc.m_re;
y2 = cc.m_im;
4. Note: To use the imaginary unit "i" for creating complex numbers, you need to write it as "1i" in
Origin C, as in the above Function row. And complex is a class that implements a complex number
data type. It contains both a Real and an Imaginary component.
5. For more details about creating user-defined fitting function, please refer to User Defined Fitting
Function using Origin C.
6. Highlight all the columns and select Analysis: Fitting: Non-linear Curve Fit from menu to bring up the
NLFit dialog. Select the function ComplexFitting from NewCategory on the Settings: Function
256
Data Analysis
Selection page. Set the input datasets in the Data Selection page as follow:
8. Click Fit to generate the fitting report sheet. You can see the results from the report worksheet as below:
From the Statistics table, we can see that the fitting is fairly successful.
257
Tutorials for Origin
4.3.3.19.1 Summary
When performing curve fitting to experimental data, one may encounter the need to account for instrument
response in the data. One way to do this is to first perform deconvolution on the data to remove the
instrument response, and then perform curve fitting as a second step. However, deconvolution is not always
reliable as the results can be very sensitive to any noise present in the data. A more reliable way is to perform
convolution of the fitting function with the instrument response while performing the fitting. This tutorial will
demonstrate how to perform convolution while fitting.
If your data is a convolution of Gauss and Exponential functions, you can simply use
built-in fitting function GaussMod in Peak Functions category to directly fit your data.
The source data includes sampling points, output signal, and the impulse response. This experiment assumes
that the output signal was the convolution of an exponential decay function with a Gaussian response:
258
Data Analysis
Now that we already have the output signal and response data, we can get the exponential decay function by
fitting the signal with the below model:
Obviously, column 1 and column 2 are x and y respectively in the function. How about column 3, the impulse
response? We will access this column within the fitting function, and compute the theoretical exponential curve
from the sampling points. Then we can use fast Fourier transform to perform the convolution.
Press F9 to open the Fitting Function Organizer and define a function like:
#include <origin.h>
#include <ONLSF.H>
#include <fft_utils.h>
//
//
void _nlsfTestConv(
// Fit Parameter(s):
// Independent Variable(s):
259
Tutorials for Origin
double x,
// Dependent Variable(s):
double& y)
Worksheet wks;
DataRange dr;
int c1,c2;
if ( pCtxt )
if ( bIsNewParamValues )
260
Data Analysis
vResponse = dsResponse;
vSample = dsSampling;
vSignal.SetSize(iSize);
vResponse.SetSize(iSize);
vSample.SetSize(iSize);
vSignal = (vSample[1]-vSample[0])*vSignal;
261
Tutorials for Origin
NLSFCURRINFO stCurrInfo;
pCtxt->GetFitCurrInfo(&stCurrInfo);
y = vSignal[nCurrentIndex] + y0;
x;
Traditionally, for a particular x, the function will return the corresponding y value. However, when convolution
is involved, we need to perform the operation on the entire curve, not only for a particular data point. So, from
Origin 8 SR2, we introduced the NLFitContext class to achieve some key information within the fitter. In each
iteration, we use NLFitContext to monitor the fitted parameters; once they are updated, we will compute the
convolution using the fast Fourier transform by the fft_fft_convolution method. The results are saved in the
vSignal vector. Then for each x, we can get the evaluated y from vSignal with the current data index in
NLSFCURRINFO.
In the fitting function body, we read the response data directly from the active worksheet. So, you should
perform the fit from the worksheet.
1. Highlight column B and press Ctrl + Y to bring up the Nonlinear Fitting dialog.
2. Choose X Data Type from Fitted Curves page as Same as Input Data.
3. Go back to the Function Selection page to select the FitConv function you just defined.
4. Go to the Parameter tab to initialize the parameters as y0=0, A=10, t=1.
5. Click the Fit button to generate the results.
If you use a fitting function similar to this tutorial, please note when you run NLFit in Origin, in NLFit dialog,
choose X Data Type from Fitted Curves page as Same as Input Data.
262
Data Analysis
4.3.3.20.1 Summary
This tutorial will show you how to reference a built-in function when creating a user-defined fitting function.
4.3.3.20.3 Steps
4.3.3.20.3.1 Data
Start by importing the file \Samples\Curve Fitting\Asymmetric Gaussian.dat into a new workbook.
Highlight column B and create a graph. The peak in the data is slightly skewed to the right. How to fit such a
curve? One idea is to divide the curve into two parts - We can consider this curve to be composed of two
Gaussian function as below. These two Gaussian curves share the same baseline and peak center, but differ in
peak width and amplitude.
Press F9 to open the Fitting Function Organizer and define the function as below:
Independent Variables: x
Dependent Variables: y
263
Tutorials for Origin
Function: y = x<xc? nlf_Gauss(x, y0, xc, w1, A1) : nlf_Gauss(x, y0, xc, w2, A2);
Note:
For versions before Origin 8.1, the function body should be defined as:
y = x<xc? nlfxGauss(x, y0, xc, w1, A1) : nlfxGauss(x, y0, xc, w2, A2);
Listing the parameters at the end is used to avoid the "parameter not used inside the function body"
error, although you already use these parameters. This is required to compile the function successfully.
where FuncName is the fitting function name. Besides, the old notation, nlfxFuncName also supported.
The Parameter List follows the parameter order in function definition file for the built-in function (the FDF file.
You can open the FDF file in Notepad. The files are located in the \\Origin EXE Folder\FitFunc\). Note that, the
function name we use is the DLL interface name. The actual name in the [General Information] section of the
FDF file. Look at the Function Source item and the value is fgroup.FuncName, and use the FuncName. In
most cases, this function name is consistent with the function name visible in the NLFit dialog. For a few few
functions such as Voigt, these names are different.
For parameter initialization of this skewed gaussian function, we can simply copy the initialization code of the
built-in gauss function, and make a few minor modifications:
w2 = w1;
A2 = A1;
264
Data Analysis
Once compiled successfully, save the function and fit the curve. The results should be as below:
265
Tutorials for Origin
4.3.3.21.1 Summary
Where y0 can be treated as the "constant background". How about fitting a curve with a non-constant
background? One option is to use the Peak Analyzer we provide. The Peak Analyzer includes multiple methods
to subtract the baseline, including exponential or polynomial backgrounds. In this tutorial, we will show you
how to fit such curves without using the Peak Analyzer.
Let's start this tutorial by importing \Samples\Spectroscopy\Peaks on Exponential Baseline.dat. From the
worksheet sparkline, we can see that there are two peaks in the curve. To simplify the problem, we will fit just
one peak in this example.
Now bring up the Worksheet Query dialog from Worksheet : Worksheet Query. And we will extract data
from row 1 to row 240:
266
Data Analysis
As illustrated below, we can consider the source curve is the combination of an exponential decay component
(the background) with a Voigt peak:
267
Tutorials for Origin
So should we write down the whole equation to define the function? Like:
Well, this is a complicated equation and it includes infinite integration. Writing such an equation directly is
painful. Now that we already have these two built-in functions:
ExpDec1:
Voigt:
we can simply use the nlfxFuncName method to quote these two built-in functions and create a new one.
Press F9 to open the Fitting Function Organizer and define a function as below:
Independent Variables: x
Dependent Variables: y
268
Data Analysis
Function: y = nlf_ExpDec1(x, y0, A1, t1) + nlf_Voigt(x, y0, xc, A2, wG, wL) - y0;
Note:
1. Some of the built-in function names do not consistent with the actual DLL function name. Just
like this Voigt function, it's defined in Voigt5.FDF, and if you open the FDF file by Notepad,
you can see a line under [GENERAL INFORMATION] section says:
Function Source=fgroup.Voigt5
The name after "fgroup" is the actual name we should put into nlf_FuncName.
2. Besides, for versions before Origin 8.1 SR2, the function body should use old nlfxFuncName
notation and define as:
y = nlfxExpDec1(x, y0, A1, t1) + nlfxVoigt(x, y0, xc, A2, wG, wL)
- y0;
Listing the parameters at the end is done to avoid the "parameter not used inside the function
body" error, although you already use these parameters. If not, you will not compile the function
successfully.
Click the button on the right of the Parameter Settings and enter these parameter initial values:
y0: 0
A1: 5
t1: 50
xc: 100
A2: 50
wG: 10
269
Tutorials for Origin
wL: 10
In the above section, we set fixed parameter initial values. If you know the possible fitted results, you can set
the initial values in this way. But how about when the data is changed? Origin provides an Origin C interface to
"guess" the initial values. To use the parameter initialization code, make sure to check the Enable Auto
Initialization and Use OriginC checkboxes, and edit the code in Code Builder by clicking the icon.
(P.S: If you know the initial values very well, or you don't like coding, please skip this section.)
270
Data Analysis
Now that the curve is composed by two components, we can guess the parameter values by separating these
two parts, the initialization code includes:
1. Use the get_exponent function to fit the curve and get the parameter values for exponential component.
2. Remove the background -- exponential component -- from source data.
3. Approaching the peak by Gaussian peak using peak_pos function and set the initial values for peak
component
So, the initialization code in Code Builder should look like this:
void _nlsfParamExpVoigt(
// Fit Parameter(s):
double& y0, double& A1, double& t1, double& xc, double& A2, double& wG, double& wL,
// Independent Dataset(s):
vector& x_data,
// Dependent Dataset(s):
vector& y_data,
// Curve(s):
Curve x_y_curve,
int& nErr)
271
Tutorials for Origin
int nSign;
t1 = -1/t1;
A1 = nSign*exp(A1);
wL = wG;
Note:
When you check the Enable Auto Initialization and enter the initialization code, this code will cover
the initial values in Parameter Settings.
No matter what kind of parameter initialization method you used, highlight column B and press Ctrl + Y to
bring up the NLFit dialog, select the ExpVoigt function and fit. The result should be:
272
Data Analysis
4.3.3.22.1 Summary
We will show you how to define piecewise fitting function in this tutorial.
We can start this tutorial by importing the sample \Samples\Curve Fitting\Exponential Decay.dat data file.
Highlight column D and plot a Scatter Graph. You can fit this curve using built-in functions under
Growth/Sigmoidal category, however, in this tutorial, we will separate the curve into two parts by a piecewise
function.
Press F9 to open the Fitting Function Organizer and define a function like:
273
Tutorials for Origin
Independent
x
Variables:
Dependent Variables: y
Function:
Click the button on the right of the Function edit box and define the fitting function in Code Builder using:
void _nlsfpiecewise(
// Fit Parameter(s):
// Independent Variable(s):
double x,
// Dependent Variable(s):
double& y)
if(x<xc) {
274
Data Analysis
y = a+b*x+exp(-(x-xc)/t1);
} else {
y = a+b*x;
Press Ctrl + Y to bring up NLFit dialog with the graph window active. Select the piecewise function we defined
and initialize the parameter values:
xc: 1
a: 1
b: -1
t1: 0.1
xc: 0.24
a: 36.76585
b: -24.62876
t1: 0.04961
Note that this function is sensitive to xc and t1, different initial values could generate different results.
4.3.3.23.1 Summary
This tutorial shows you three methods to force a fit curve to go thru a particular point. Choice of method
depends on function expression and the data point you want the fit curve to go through.
275
Tutorials for Origin
This method works only when the point you want to fit through is related to a function parameter. One typical
example: force the fitted line to go through the origin point, (0, 0), when fitting a straight line,
. In this particular case we know that if we let , the line will go through (0,0).
5. Click the Fit until converged button . You can see from the Fit Curve tab that the curve does not
go through the origin point.
276
Data Analysis
6. Now go to the Parameters tab, check the Fixed checkbox for parameter A and fix the value to 0. Click
the Fit until converged to fit the curve again. Now you can see the curve go through zero.
277
Tutorials for Origin
Note: You can also use the Fix Intercept option in the Linear Fit dialog to force the linear fitted line
to go through the origin point.
This method works when the fitting function is based on a LINEAR model, such as Line, Parabola, or Cubic,
etc.
We will show you how to force the fitted curve to go through a particular point by using linear constraint:
3. Select Parabola ( ) from the Polynomial category. From the Fit Curve
tab, we can see the initial value already fits the data very well.
4. Suppose we want to force the curve through . Substitute to the fitting function
278
Data Analysis
5. Click the Fit until converged button . We can see the fitted curve deviates from the data points, but
it goes through the specified point.
If the parameters are some eigenvalues such as upper or lower asymptotes, and your raw data includes the
points you want to fit through, you can fit the curve by assigning larger weights to these particular points. This
is not an analytical solution, but you can assign larger weights to reduce the error:
279
Tutorials for Origin
newbook;
wks.addcol();
col(a) = log(col(a)) + 5;
col(c)[1] = 100;
col(c)[ii] = 1;
col(c)[wks.maxrows] = 100;
2. First, let's see how the fitted curve looks when there is no weighting. Highlight column B and bring up
NLFit dialog from Analysis: Fitting: Nonlinear Curve Fit. Select the Logistic function from
Growth/Sigmoidal category. Then click the Fit until converged button . From the Fit Curve tab,
we can see the curve does not go through any points near the top.
280
Data Analysis
3. Note that in the raw data worksheet, we have prepared column C and assigned large values for the first
and last data points. If we use this column as weights, these two points will contribute more impact on the
fitted curve and hence force the curve to go through these two points.
Now, activate the Data Selection page on the Settings tab. Expand the Input Data branch as below to
281
Tutorials for Origin
expose the weighting option. Choose the Direct Weighting method and assign column C as the
From the preview result, we can see that the fitted curve goes through the first and last data points.
4.3.3.24 Distribution Fit with the Probability Density Function and Cumulative Distribution Function
4.3.3.24.1 Summary
To know the location or scale parameters of a sample distribution, one can perform distribution fit on the data.
However, you can also fit a probability density function or cumulative distribution function on the binned data
to get these values. This tutorial shows you how to estimate these parameters by curve fitting.
282
Data Analysis
newbook;
col(2) = normal(1000) * 2 + 5;
This script generates 1000 normally distributed points where mean ≈ 5 and σ ≈ 2.
2. We can first perform simple descriptive statistics on this column to see the corresponding Moments
output.
Highlight the data column and select Statistics: Descriptive Statistics: Statistics on Column to open
the dialog. Select Quantities tab, then make sure the Mean and Standard Deviation checkboxes are
selected. And the click OK to generate report.
From the report worksheet, we can see the Mean and Standard Deviation are very close to the value we
just set.
1. To fit the data with the PDF, we should calculate the binned data with Frequency Counts tool first.
Highlight the source data column and select Statistics: Descriptive Statistics: Frequency Counts from
menu. This dialog will count the number of data points on specified bins.
o Expand the Computation Control branch, and make sure Bin Size radio button is selected
beside Step by. Set the Bin Size to 0.5 (you'll have to clear the Auto check box).
o Make sure the Bin Center, Count and Cumulative Count check boxes under Quantities to
Compute branch are selected. Then click OK to count the data.
2. Highlight the Count column on the Frequency Counts result worksheet, select Plot>2D: Bar: Column to
create a column graph. Now we have the histogram of the source data.
3. With the graph active, select menu Analysis: Fitting: Nonlinear Curve menu to open the NLFit dialog.
Then select the Gauss function from the Statistics category. Leave other options as defaults and click the
Fit button directly to output fitting report.
283
Tutorials for Origin
From the fitting report, we can see that the fitted xc and sigma are close to 5 and 2.
1. To fit the data with the CDF, we should start from the cumulative binned data. Select the FreqCounts1
sheet from the previous section. Highlight the Cumulative Count column. Select menu Plot>2D: Scatter:
Scatter to plot the CDF points.
2. With the graph active, select menu Analysis: Fitting: Nonlinear Curve Fit to open the NLFit dialog.
Select the NormalCDF function from the Statistics category. Leave other options as defaults and click
the Fit button directly to output fitting report.
From the fitting report, we can see that the fitted xc and w are close to 5 and 2.
After you got binned data from the Frequency Counts tool, you can also fit the binned
data with your user-defined probability density function or cumulative distribution
function. View this page for defining and fitting with a user-defined function.
284
Data Analysis
4.3.3.25.1 Summary
In this tutorial, we will show you how to define an integral fitting function with a sharp peak in the integral
function, and perform a fit of the data using this fitting function.
Because the integral function contains a sharp peak, the integral should be performed in three segments so
that the sharp peak can be integrated in a narrow interval.
285
Tutorials for Origin
Initial parameters are: a=1e-4, b=1e-4. Note that the integral function contains a peak whose center is about
a and width is 2b. And the peak's width (2e-4) is very narrow compared with the integral interval [0,1]. To
make sure it is integrated correctly at the neighborhood of the peak center, the integral interval [0,1] is
divided into three segments: [0,a-5*b], [a-5*b,a+5*b], [a+5*b,1]. It is integrated in each segment, and then
the three integrals are summed up.
The fitting function can be defined using the Fitting Function Builder tool.
return 1/(sqrt(2*pi)*b)*exp(-(t-a)^2/(2*b^2)-x*t);
5. In the Variables and Parameters page, type a, b in the Parameters field. Click Next button.
6. In the Expression Function page, click Parameters tab, and set Initial Value for parameters a and b
to 1e-4, click Integrand tab, and set Value for Lower Limit and Upper Limit to 0 and 1, Value for a,
b, x to a, b, x respectively.
7. In the Expression Function page, click Insert button. In the Quick Check group, type 0 in x= edit box,
click Evaluate button, and it shows y=9.3e-21. This implies that the peak is not integrated correctly
because y should approach 1 for x=0. Divide the integral into three segments, and type following script in
Function Body box.
Click Evaluate button again, and it shows y=0.84, hence it is clear that the peak is integrated
correctly this time.
286
Data Analysis
8. In the Expression Function page, update the script in Function Body box as follows.
1. Select Analysis: Fitting: Nonlinear Curve Fit from Origin menu. In the NLFit dialog, select Settings:
Function Selection, in the page select User Defined from the Category drop-down list and fintpeak
function from the Function drop-down list. Note that initial parameters have been set during defining the
fitting function.
2. Click Fit button to fit the curve.
287
Tutorials for Origin
a 4.98302E-4 1.07593E-5
b 1.94275E-4 8.21815E-6
The Adj. R-Square is 0.99799. Thus the fitting result is very good.
x y
0 -0.00267
60 -0.01561
240 -0.05268
500 -0.10462
1000 -0.22092
1500 -0.31004
2000 -0.40695
3000 -0.61328
4000 -0.75884
5000 -0.9127
6000 -0.98605
7000 -1.18957
9000 -1.43831
288
Data Analysis
10000 -1.41393
12000 -1.61458
15000 -1.88098
20000 -2.07792
4.3.3.26.1 Summary
In this tutorial we will show you how to define a piecewise fitting function consisting of two linear segments,
perform a fit of the data using this fitting function, and calculate the intersection location for two linear
segments from the fitting result.
2. Click the Import Single ASCII button to bring up the Open dialog. Browse to \Samples\Curve
Fitting folder and select the file Step01.dat.
3. Right click on the Sensor E x column (column J), and select Set As: X from the context menu. Highlight
Sensor E y column, and select Plot: Symbol: Scatter from Origin menu. The graph should look like:
289
Tutorials for Origin
From the above graph, the curve consists of two segments of lines. It can be fitted with a piecewise linear
function. The function can be expressed as:
where x1 and x2 are x values of the curve's endpoints and they are fixed during fitting, x3 is the x value at
the intersection of two segments, and y1, y2, y3 are y values at respectively.
The fitting function can be defined using the Fitting Function Builder tool.
5. In the Origin C Fitting Function page, click the button on the right of the Function Body edit box
and define the fitting function in Code Builder as follows.
290
Data Analysis
if( x < x3 )
y = (y1*(x3-x)+y3*(x-x1))/(x3-x1);
else
y = (y3*(x2-x)+y2*(x-x3))/(x2-x3);
Click Compile button to compile the function body. Then click Return to Dialog button. Click Next
button.
6. In the Parameter Initialization Code page, click the button on the right of the Initialization Code
edit box and initialize the fitting parameters in Code Builder as follows.
x3 = x1 + (x2 - x1)/2;
y1 = y_data[n1];
y2 = y_data[n2];
vector vd;
vd = abs( x_data - x3 );
291
Tutorials for Origin
y3 = y_data[n3];
Click Compile button to compile it. Then click Return to Dialog button. Click Finish button.
During function defined process, you can also define some additional derived Parameters such as slopes and
intercepts , which are computed from the function parameter values after the fitting process ends.
1. Click <<Back button twice to go back to Variables and Parameters page, type a1,b1,a2,b2 in the
Derived Parameters field.
2. Click Next button four times to go to Derived Parameters page, fill in the Meaning column and type
the equations in the Derived Parameters Equations area as follows, then click Finish button.
a1=(y1*x3-y3*x1)/(x3-x1);
b1=(-y1+y3)/(x3-x1);
a2=(y3*x2-y2*x3)/(x2-x3);
b2=(-y3+y2)/(x2-x3);
292
Data Analysis
1. Select Analysis: Fitting: Nonlinear Curve Fit from Origin menu. In the NLFit dialog, select Settings:
Function Selection, in the page select User Defined from the Category drop-down list and pwl2s
function from the Function drop-down list.
2. In the NLFit dialog, select Parameters tab, and fix parameters x1, x2 as shown in the dialog.
293
Tutorials for Origin
x1 0.8 0
y1 -0.0271 0.01063
x2 60 0
y2 0.95585 0.0083
x3 22.26316 0.58445
y3 0.66106 0.01197
a1 -0.05275 0.01123
b1 0.03206 8.7153E-4
a2 0.48715 0.01664
b2 0.00781 3.86455E-4
Thus the intersection point for the two segments is (22.26316, 0.66106).
Note that fitting with a piecewise linear function for more than two segments can be done in a similar way.
4.3.3.27.1 Summary
In this tutorial we will show you how to define an ordinary differential equation (ODE) in the Fitting function
Builder dialog and perform a fit of the data using this fitting function.
294
Data Analysis
In this tutorial, we will use a first order ordinary differential equation as an example:
where a is a parameter in the ordinary differential equation and y0 is the initial value for the ODE. NAG
functions d02pvc and d02pcc are called using the Runge–Kutta method to solve the ODE problem.
2. Click the Import Single ASCII button to bring up the Open dialog. Browse to the \Samples\Curve
Fitting folder and select the file Exponential Growth.dat.
3. Highlight B column, and select Plot: Symbol: Scatter from Origin menu. The graph should look like:
The fitting function can be defined using the Fitting Function Builder tool.
295
Tutorials for Origin
2. On the Fitting Function Builder dialog's Goal page, ensure the Create New Function radio button is
selected. Click the Next button.
3. On the Name and Type page, From the Select or create a Category drop-down list select User
Defined. For Function Name type FitODE. In the Function Type section select the Origin C radio
button. Click Next.
4. On the Variables and Parameters page, in the Parameters field type a, y0. Click Next.
5. On the Origin C Fitting Function page, click the button on the right of the Function Body edit box
and define the function in Code Builder as follows. Include header files for NAG and fitting:
#include <oc_nag.h>
#include <ONLSF.H>
Define a static function to solve ODE by calling NAG functions. Call NAG function d02pvc to establish
ODE model and d02pcc to solve the model:
double a;
};
static void NAG_CALL f(Integer neq, double t, double y[], double yp[],
Nag_User *comm)
t; //Independent variable
296
Data Analysis
y; //Dependent variables
double a;
a = sp->a;
yp[0] = a*y[0];
static bool nag_ode_fit( const double a, const double y0, const double
tstart,
return false;
297
Tutorials for Origin
vP.SetSize( nout );
vP[0] = y0;
Nag_RK_method method;
int i, j;
Nag_ErrorAssess errass;
Nag_ODE_RK opt;
Nag_User comm;
struct user s;
s.a = a;
comm.p = (Pointer)&s;
298
Data Analysis
ystart[0] = y0;
thres[i] = 1.0e-8;
errass = Nag_ErrorAssess_off;
hstart = 0;
method = Nag_RK_2_3;
tinc = (tend-tstart)/(nout-1);
tol = 1.0e-3;
NagError nagErr1;
//Setup ODE
return false;
299
Tutorials for Origin
NagError nagErr2;
//Solve ODE
return false;
vP[j] = ygot[0];
d02ppc(&opt);
return true;
300
Data Analysis
if ( pCtxt )
if ( bIsNewParamValues )
tinc = (tend-tstart)/(nout-1);
nSize = vX.GetSize();
301
Tutorials for Origin
return;
Click the Compile button to compile the function body. To return, click Return to Dialog button. The
Evaluate button on the dialog has a black figure of a running person. Clicking on it will show
y=2.6627270424371. This implies that the function works. Click Next.
6. In the Parameter Initialization Code page, select Use Custom Code radio butto, and type the code in
the Initialization Code box:
y0 = y_data[0];
a = 1;
Note: In order to monitor the the fitted parameters, NLFitContext class was introduced in defining fitting
function to achieve some key information within the fitter
1. Highlight B column, then select Analysis: Fitting: Nonlinear Curve Fit from Origin menu. In the NLFit
dialog, select Settings: Function Selection, in the page select User Defined from the Category drop-
down list and FitODE function from the Function drop-down list.
302
Data Analysis
a 1.30272 0.00858
y0 0.77038 0
Note: Fitting with more complex ODE fitting functions can also be done in a similar way.
4.3.3.28.1 Summary
In this tutorial, we will show you how to define a convolution of two functions, and perform a fit of the data
with non-evenly spaced X using this fitting function.
303
Tutorials for Origin
If your data is a convolution of Gauss and Exponential functions, you can simply use
built-in fitting function GaussMod in Peak Functions category to directly fit your data.
Sample a function.
2. Click the Import Single ASCII button to bring up the Open dialog. Browse to \Samples\Curve
Fitting folder and select the file ConvData.dat. Note that column A is not evenly spaced. We can use
LabTalk diff function to verify it.
3. Right click on column C, and select Set As: Y Error from the short-cut menu. Highlight column B and C,
and select Plot: Symbol: Scatter from the Origin menu. The graph should look like:
304
Data Analysis
where ,
The fitting function can be defined using the Fitting Function Builder tool.
305
Tutorials for Origin
x0 = 3.1
xL = 6.3
tL = 0.4
s = 0.14
y0 = 1.95e-3
b1 = 2.28e-5
b2 = 0.2
w1 = 1.98005
xc1 = -0.30372
w2 = 5.76967
xc2 = 3.57111
A2 = 9.47765e-2
Click the button on the right of the Function Body edit box and define the fitting function in Code
Builder as follows:
#include <ONLSF.H>
#include <fft_utils.h>
306
Data Analysis
if ( pCtxt )
if ( bIsNewParamValues )
//Sampling Interval
double dx = 0.05;
nSize = vX.GetSize();
307
Tutorials for Origin
//Function f(x)
//Function g(x)
vG = 1/(w1*sqrt(pi/2))*exp(-2*vX^2/w1^2);
vA.SetSubVector( vF );
vB.SetSubVector( vG );
308
Data Analysis
vY.SetSize(nSize);
//Baseline
//Fitted Y
Click Compile button to compile the function body. And click the Return to Dialog button.
Click Evaluate button, and it shows y=0.02165 at x =1. And this indicates the defined fitting function
is correct. Click Next.
6. Click Next. In the Bounds and General Linear Constraints page, set the following bounds:
0 < x0 < 7
0 < xL < 10
309
Tutorials for Origin
0 < tL < 1
0 <= s <= 5
0 < b2 <= 3
Click Finish.
Note: In order to monitor the the fitted parameters, NLFitContext class was introduced in defining fitting
function to achieve some key information within the fitter
1. Select Analysis: Fitting: Nonlinear Curve Fit from the Origin menu. In the NLFit dialog, select
Settings: Function Selection, in the page select User Defined from the Category drop-down list and
convfunc function from the Function drop-down list. Note that Y Error Bar is shown in the active graph,
so column C is used as Y weight, and Instrumental weighting method is chosen by default.
2. Click the Fit button to fit the curve.
310
Data Analysis
x0 3.1424 0.07318
xL 6.1297 0.1193
tL 0.42795 0.02972
s 0.14796 0.00423
y0 0.00216 1.76145E-4
b1 4.90363E-5 1.61195E-5
b2 0.07913 0.02855
Note that you can set a smaller value for dx in the fitting function body, the result may be more accurate, but
at the same time it may take a longer time for fitting.
4.3.3.29.1 Summary
In this tutorial, we will show you how to calculate initial parameters for rational fitting functions using the
multiple linear regression method, and perform a fit of the data using calculated initial parameters.
where x is the independent variable, y is the dependent variable, and a, b, c, d, e are fitting parameters.
311
Tutorials for Origin
Hence estimating initial parameters for a rational polynomial fitting function becomes a multiple linear
regression problem with linear coefficients a, b, c, d, e.
Origin provides a function ocmath_multiple_linear_regression in Origin C for multiple linear regression, which
can be called in initialization code.
312
Data Analysis
The fitting function can be defined using the Fitting Function Builder tool.
(a+b*x+c*x^2)/(1+d*x+e*x^2)
Click the Evaluate button, and it shows y=1 at x=1, hence this implies the expression is correct.
Click the Next button.
6. In the Parameter Initialization Code page, select Use Custom Code radio butto, click the Open Code
Builder button to the right of the Initialization Code box, and initialize fitting parameters as follows,
in terms of the algorithm.
313
Tutorials for Origin
vCa = 1;
mX.SetColumn( vCa, 0 );
vCb = x_data;
mX.SetColumn( vCb, 1 );
vCc = x_data^2;
mX.SetColumn( vCc, 2 );
vCd = -x_data*y_data;
mX.SetColumn( vCd, 3 );
vCe = -x_data^2*y_data;
mX.SetColumn( vCe, 4 );
314
Data Analysis
LROptions stLROptions;
stLROptions.UseReducedChiSq = 1;
a = stFitParameters[1].Value;
b = stFitParameters[2].Value;
c = stFitParameters[3].Value;
d = stFitParameters[4].Value;
e = stFitParameters[5].Value;
Click the Compile button to compile the code. And click the Return to Dialog button. Click Finish to
close the Fitting Function Builder dialog.
315
Tutorials for Origin
1. Select Analysis: Fitting: Nonlinear Curve Fit from Origin menu. In the NLFit dialog, select Settings:
Function Selection, in the page select User Defined from the Category drop-down list and
rationalfunc function from the Function drop-down list.
2. Click the Parameters tab. Initial parameters calculated from initialization code are listed in the dialog,
and the fitting function curve for initial parameters is shown as follows. It seems that initial parameters
from initialization code are very good.
316
Data Analysis
a 3.17139 0.30284
b -1.65602 1.76748
c 0.26407 1.81764
d 3.6884 0.26362
e 5.31812 0.55265
x y
-1.5 1.13173
-1.39474 0.8262
317
Tutorials for Origin
-1.28947 1.06999
-1.18421 1.37155
-1.07895 0.79569
-0.97368 2.11346
-0.86842 2.32006
-0.76316 3.9205
-0.65789 5.81904
-0.55263 7.38037
-0.44737 8.31272
-0.34211 11.39718
-0.23684 8.39808
-0.13158 4.7305
-0.02632 4.11105
0.07895 2.39105
0.18421 1.65394
0.28947 0.42953
0.39474 0.83337
0.5 1.18758
318
Data Analysis
Note: You can also use this method to initialize parameters for other rational polynomial fitting functions.
Origin provides several built-in surface fitting functions which can be used to perform fitting on 3D data. The
surface fitting function is similar to the nonlinear fitting function.
4.3.3.30.2 Steps
This tutorial is associated with the Surface Fitting (Pro Only) folder in the Tutorial Data.opj (<Origin EXE
Folder>\Samples\Tutorial Data.opj).
1. With the matrix sheet active, click Analysis on the main menu, and then click Nonlinear Matrix Fit... to
open the NLFit dialog. (Alternatively, you can plot the matrix as a 3D surface or contour, and then select
Nonlinear Surface Fit... to open the same dialog.)
2. Click Function Selection, select Gauss2D from the Function dropdown menu.
3. Click Advanced, set Number of Replicas to 3, and set Peak Direction as Positive.
319
Tutorials for Origin
4. Click Fit to perform a multiple peak fit and generate a report worksheet with fitting results.
4.3.3.31.1 Summary
Origin supports fitting functions with multiple dependent or independent variables. With the nonlinear fitting
function, you can define multiple variables and separate them with semicolons. Since global fitting allows you
to fit only one function at a time, this is a good way to defeat that limitation.
Origin ships with three built-in functions with multiple dependent and independent variables. These functions,
available in the Multiple Variables category, are actually composites consisting of two ordinary functions. The
GaussianLorentz function, for example, is a combination of the Gaussian and Lorentz functions, sharing y0 and
xc:
Use Nonlinear Multiple Variables Fitting to fit a curve with two different functions.
4.3.3.31.3 Steps
1. Start with a new project or create a new workbook and import the data file \samples\curve
fitting\Gaussian.dat.
320
Data Analysis
2. Highlight Column(A) and Column(B). In the main menu, click Analysis, then point to Fitting, and then
click Nonlinear Curve Fit.
3. In the NLFit dialog’s left panel, select Function Selection. In the right panel, select Multiple Variables
in the Category dropdown menu. In the Function dropdown menu, select GaussianLorentz.
As you can see on the Sample Curve tab, the equations in this fitting function share the same parameters,
y0 and xc.
321
Tutorials for Origin
4. In the NLFit dialog’s left panel, select Data Selection. In the right panel, expand the Range node and
assign data to the fitting variables. In this example, we have assigned column B to both y1 and y2, which
means that both expressions will fit the same dataset.
322
Data Analysis
5. Click Fit until converged to fit, then OK. In the results sheet, compare parameters A and w, with the
Gaussian and Lorentz functions sharing the same offset and peak center.
323
Tutorials for Origin
4.3.3.32.1 Summary
Derived parameters are additional parameters computed using the fitted parameter values. You can define
your own derived parameters for any built-in or user-defined fitting functions.
They are not involved in the fitting process and are computed only at the end of the fitting session.
How to add derived parameters in a built-in fitting function by Fitting Function Organizer.
How to remove derived parameters in a built-in fitting function by Fitting Function Organizer.
1. The built-in Gauss function fits the peak area with the following equation:
Suppose that you also want to know the peak height, which can be computed as follows:
2. Select Tool: Fitting Function Organizer in the menu. In the left panel of the dialog, select Origin Basic
Funcions: Gauss.
324
Data Analysis
Note:
o Each derived parameter should be specified in a separate row.
o Derived parameters cannot be computed from other derived parameters.
4. Click on Save and the OK button.
5. Create a new workbook and import the data file \samples\curve fitting\Gaussian.dat, using File:
Import: Single ASCII.
6. Highlight column A and B, then select Analysis: Fitting: Nonlinear Curve Fit to open the Nonlinear
Curve Fitting dialog, and select Gauss from the Function drop-down list.
325
Tutorials for Origin
7. Go to Code tab and click Derived parameters on the left panel. You can see the Derived Parameters
listed on the right panel.
8. Click Fit button to generate report sheets. After fitting, Origin will compute the height and include the
result in the Parameters table on the fitting results worksheet.
326
Data Analysis
9. If you want to obtain the confidence interval for derived parameters, you can click on the green lock and
select Change Parameters to go back to the NLFit dialog. Click Advanced option under Settings tab,
expand Quantities node on the right panel and check the LCL and UCL checkboxes under Fit
Parameters branch. Click Fit button to recalculate.
10. Then confidence interval 95% LCL and 95% UCL are calculated for both parameters and derived
parameters as below:
327
Tutorials for Origin
You can also remove derived parameters from result sheet. Continue with the tutorial above, follow the steps
below:
1. Select Tool: Fitting Function Organizer in the menu to open the dialog again. In the left panel of the
dialog, select Origin Basic Functions: Gauss.
328
Data Analysis
2. Go to Derived Parameters section and remove expression h=A/(w*sqrt(PI/2)) from that panel.
3. You may need to wait one or two seconds before the Save button is enabled. Click Save button and then
OK button to close dialog.
4. Click on the green lock on the top left corner in result sheet FitNL1 to change parameters and click Fit
button again in the appeared NLFit (Gauss) dialog. We will see the derived parameter h has been
removed from result table.
329
Tutorials for Origin
4.3.3.33 Fit Multiple Datasets by Fitting One and then Using Those Fit Parameters for Other Datasets
4.3.3.33.1 Summary
In some cases, you might have multiple datasets, and want to fit them using the user-defined function without
parameter initial code. For increased efficiency, you can fit one and then apply the fit parameters for other
datasets.
4.3.3.33.3 Steps
4.3.3.33.3.1 Create a User-Defined Function in Fitting Function Builder
The Fitting Function Builder can be used to create or edit a user-defined function. In the following section,
we will define a fitting function MyExp with this tool.
1. Select Tools: Fitting Function Builder... from the main menu (or press F8) to open the Fitting
Function Builder. Select the Create a New Function radio box.
330
Data Analysis
2. Click the Next button to go to the Name and Type page. Enter MyExp in the Function Name box
and select the Origin C radio box for the Function Type.
331
Tutorials for Origin
3. Click the Next button to go to the Variables and Parameters page. Enter the variables and
parameters as shown in the following screenshot:
332
Data Analysis
4. Click the Next button to go to the Origin C Fitting Function page. Enter the function body
y=y0+a*exp(b*x) in the Function Body box. To verify the correctness of the function, click the
button beside the Function box to open the Origin Code Builder.
333
Tutorials for Origin
In the Code Builder, click the Compile button to compile the function. If passed, the message Compile
Done will show, and then you can click the Return to Dialog button to return to the Fitting Function
Builder.
334
Data Analysis
3. Select the function just defined in Settings tab, Function Selection page:
335
Tutorials for Origin
4. Switch to Parameters tab, enter 80, 100, -5 on the Value column as initial values for y0, a, b of the
first dataset. Then select 1 from the independent fit drop-down list and iterate the first dataset until
converged.
5. The parameter values are calculated and the fitting result is hinted in the buttom left corner of this
dialog.
336
Data Analysis
6. To initialize the parameters of other datasets, apply the parameter values of the first dataset to other
datasets by right-clicking the values, and then selecting Apply Whole Set of "Value" to All
Datasets from the fly-out menu.
337
Tutorials for Origin
4.3.3.34.1 Summary
This tutorial will show you how to define an implicit fitting function with three independent variables, then
perform implicit fitting with it on fitting data.
1. Click the Import Single ASCII button to bring up the Open dialog. Browse to \Samples\Curve
Fitting folder and select the file Ellipsoid.dat file.
2. Highlight column C, right click on selection and choose Set As: Z from the context menu. Select Plot: 3D
Symbol/Bar/Vector: 3D Scatter from Origin menu. Double click on the graph. In the Plot Details
dialog, select Layer1 in the left panel, click Axis tab, set X, Y, Z Length as 100, 75, 50 respectively.
338
Data Analysis
Click the Fit frame to layer button in the 3D Rotation toolbar. The graph should look like:
The graph can be fitted with an ellipsoid. The function can be expressed as:
where is the ellipsoid's center location, a, b and c are semi-principal axes lengths, x, y and z
are three independent variables for fitting data.
The fitting function can be defined using the Fitting Function Builder tool.
339
Tutorials for Origin
(x-x0)^2/a^2+(y-y0)^2/b^2+(z-z0)^2/c^2-1
340
Data Analysis
In the Quick Check group, click Evaluate button, it shows f=-0.667 at x=1, y=1, z=1.
6. In the Bounds and General Linear Constraints page, set lower bounds for a, b and c,
1. For implicit fitting with more than 2 independent variables, Origin only supports input data from
workbooks not graphs. So we have to make the workbook for fitting data active before fitting. Select
341
Tutorials for Origin
Analysis: Fitting: Nonlinear Implicit Curve Fit from Origin menu. In the NLFit dialog, select
Settings: Function Selection, in the page select Ellipsoid function from the Function drop-down list.
2. Select Data Selection page, expand Input Data: Range1, and choose column A as X, column B as Y
and column C as Z. An error message is shown at the bottom of the Settings panel. Following the
suggestion of the error message, go to the Fitted Curves page and change the Data Type of X to Fitted
Point for Input Data. The Data Type of y and z should automatically change as well.
Note that Origin doesn't support Fit Curve preview in the NLFit dialog or fitted surface in the fitted
report for implicit fitting with more than two independent variables.
3. Since initial parameters have been set in Fitting Function Builder dialog, we can click Fit button to fit
the curve.
Switch to the fitted report. Parameters and Statistics tables are shown in the report.
x0 0.41073 0.01576
342
Data Analysis
y0 0.32043 0.01352
z0 0.00147 0.00749
a 4.00325 0.02076
b 3.00097 0.01881
c 1.99972 0.00933
And Adj. R-Square is 0.99823, which means the fitted result is very good. Note that this result is from
Origin9.0 32Bit, while in Origin9.0 64Bit the result is slightly different, and the latter is better.
In the FitODRCurve1 worksheet, the first three columns show XYY coordinates for fitted points.
Note that in the implicit fitting, x ,y and z are all independent variables, they will all be adjusted during
iterations in the fitting.
Although Origin9.0SR1 doesn't show the fitted surface in the fitted report for implicit fitting with more than two
independent variables, in this example you can plot the fitted ellipsoid using 3D Parametric Function Plot
tool in Origin as follows.
1. Make the fitted report active, run following LabTalk script in the Script Window in order to get fitted
parameter variables.
getnlr tr:=tt;
x0=tt.x0;
y0=tt.y0;
z0=tt.z0;
a=tt.a;
b=tt.b;
c=tt.c;
343
Tutorials for Origin
2. Make Graph1 active. Select File: New: Function Plot: 3D Parametric Function Plot from Origin
menu. In the Create 3D Parametric Function Plot dialog, set u from 0 to pi, v from 0 to 2*pi. And
define X ,Y and Z as follows.
X(u,v)=x0+a*sin(u)*cos(v)
Y(u,v)=y0+b*sin(u)*sin(v)
Z(u,v)=z0+c*cos(u)
And choose Add to Active Graph from the drop-down list at the bottom left of the dialog.
Click OK button to close the dialog. A 3D ellipsoid plot will be added to Graph1.
344
Data Analysis
3. Double click on the graph. In the Plot Details dialog, you can customize the graph as follows.
Note that only OpenGL of 2.1 or higher version supports 3D transparency in Origin9.0. You can select
Tools: 3D OpenGL Settings from Origin menu to see your OpenGL version, if your OpenGL version is
lower than 2.1, you should ignore the setting for 3D transparency in Step 3.2.
1. Select Layer1 in the left panel, click Size/Speed tab, clear Worksheet data, maximum
points per curve check box in the Speed Mode, Skip Points if needed group. Click Lighting
tab, choose Directional in the Mode group, and select blue color as Ambient color in the Light
Color group.
2. Select the second plot in the Layer1 branch, click Surface tab, set Transparency as 50%.
Select Fill tab, and change Fill piece by piece color to white in the Front Surface group. Click
OK button to close the dialog.
4.3.3.35.1 Summary
When performing non-linear curve fitting to experimental data, one may encounter the need to account for
errors in both independent variables and dependent variables. In Origin, you can utilize the Orthogonal
345
Tutorials for Origin
Distance Regression (ODR) to fit your data with implicit or explicit functions. This tutorial will demonstrate how
to perform non-linear curve fitting on data with both X errors and Y errors using ODR with a built in function.
This tutorial will show you how to use Orthogonal Distance Regression to fit nonlinear data with both X and Y
errors.
2. Click the Import Single ASCII button to bring up the Open dialog. Browse to the \Samples\Curve
Fitting folder and select the file ODR fitting.dat.
3. Highlight column XError (long name) and right click to select Set As: X Error to set it as X error column.
4. Highlight column YError (long name) and right click to select Set As: Y Error to set it as Y error column.
5. Highlight all four columns and go to Plot:Symbol:Scatter to make a scatter plot with both X and Y error
bars.
6. Go to Analysis:Fitting:Nonlinear Curve Fit:Open dialog... to open NLFit dialog.
7. On Function Selection page, select Category as Polynomial, Function as Poly4 and Iteration
Algorithm as Orthogonal Distance Regression (Pro).
8. Since X error and Y error columns have been specified in step 3, 4 so that when Orthogonal Distance
Regression is selected as iteration algorithm these two columns will be automatically assigned as
corresponding weight for X and Y data respectively. You can go to Data Selection page and expand x
346
Data Analysis
9. Click Fit button and choose No radio box in the appeared Reminder Message dialog, and click OK to
close it, the fitting results are as shown below:
347
Tutorials for Origin
You can refer to this page for the details of the algorithm of ODR as well as Levenberg Marquardt (L-M)
algorithm. Another example of using Orthogonal Distance Regression for Implicit Functions can be found here.
Smoothing
IIR Filter
Convolution
Wavelet
Rise Time
Sound Processing
4.4.2.1 Summary
FFT (Fast Fourier Transform) is able to convert a signal from the time domain to the frequency domain. IFFT
(Inverse FFT) converts a signal from the frequency domain to the time domain. The FFT of a non-periodic
signal will cause the resulting frequency spectrum to suffer from leakage. Origin provides several windows for
performing FFT to suppress leakage.
Origin's FFT gadget places a rectangle object to a signal plot, allowing you to perform FFT on the data
contained in the rectangle. This is convenient for quickly observing the FFT effect on the data.
The following tutorial shows how to use the FFT gadget on the signal plot.
348
Data Analysis
1. Start with a new workbook, and import the data <Origin Installation Directly>\Samples\Signal
Processing\Chirp Signal.dat.
2. Highlight column B and make a line plot by clicking menu item Plot>2D: Line: Line.
3. With the plot active, select menu Gadgets: FFT... to start the FFT gadget.
349
Tutorials for Origin
4. Using the default settings, click OK to add the rectanglar Region of Interest (ROI) to the graph.
5. Note that the FFTPREVIEW graph is created showing the FFT results for the selected data.
350
Data Analysis
6. You can move the rectangle left and right to cover different portions of the data. You can also change the
width of the rectangle to cover different numbers of data points. Repositioning or resizing the ROI changes
the FFTPREVIEW graph.
4.4.2.4 FFT
In this example, we are going to change the window for suppressing the spectrum leakage.
3. In the dialog, check the Auto Preview box at the bottom to preview the result in the right panel.
Change the Window to Blackman, but keep the remaining default settings. In the right panel, we
can see that there is a sharp narrow peak spectrum for Amplitude. The Blackman window has
suppressed the spectrum leakage very well.
351
Tutorials for Origin
4.4.2.5 IFFT
This example will show how to recover the signal from the results of doing an FFT. To do so, both settings for
FFT and IFFT need to be the same, and the Spectrum Type needs to be Two-sided and Window needs to
be set to Rectangle.
1. Start with your FFT results, above, and click on any of the green locks. Select Change
Parameters... from the menu to open the dialog box again.
352
Data Analysis
2. As mentioned above, the Window needs to be set to Rectangle, and Spectrum Type should be
Two-sided, so edit these two settings.
4. Go to the FFTResultData1 worksheet. We can see one column is Complex, one column is Real, and
one is Imaginary. Here, we can use the Complex column (the Real column and Imaginary column also
can be used). Highlight it and select the menu item Analysis: Signal Processing: FFT: IFFT... to
open the FFT: ifft1 dialog. (Note, if using Real and Imaginary columns, the first line for Input should
be the Real column, and the Imaginary box should point to the Imaginary column.) Check the Auto
Preview check box at the bottom to preview the result in the right panel.
353
Tutorials for Origin
6. Now, we can make a comparison between the IFFT result (in IFFTResultData1 worksheet) and the
original signal data. As the image below shows, they are almost the same.
4.4.3.1 Summary
Origin offers an FFT filter, which performs filtering by using Fourier transforms to analyze the frequency
components in the input dataset.
354
Data Analysis
There are six types of filters available in the FFT filter function: low-pass, high-pass, band-pass, band-block,
threshold and low-pass parabolic. Low-pass filters block all frequency components above the cutoff frequency,
allowing only the low frequency components to pass. High-pass filters work in the opposite way: they block
frequency components that are below the cutoff frequency.
This tutorial will show you how to perform the low-pass and band-pass filtering using Origin's FFT filter.
2. Select File:Import:Sound(WAV) menu item and import the file Origin 8 Message.wav located at
<Origin EXE Folder>\Samples\Signal Processing\. Accept the default import settings.
3. Highlight column A(Y) and click the Line button on the 2D Graph toolbar to create a line plot.
4. This signal is a sound wave and it is already known that the high frequency components can be regarded
as noise, and should be blocked. So we will use the Low Pass method in the FFT Filter tool to
approximate the low frequency component for further analysis.
5. Make sure the line plot is active, then select Analysis:Signal Processing:FFT Filters to open the
fft_filters dialog box.
6. Make sure the Filter Type is set to Low Pass.
355
Tutorials for Origin
The top two images show the signal in the time domain, while the bottom image shows the signal in the
frequency domain after Fast Fourier Transform. The X position of the red vertical dot line indicates the
cutoff frequency. By moving the vertical line horizontally, you can preview the comparison between the
original signal and the filtered signal in real time, in the top part of this panel.
8. Move the vertical line to the X position of the peak amplitude (as in the image below). Note that
human error may be introduced during this step, but it is acceptable since we only want to roughly
filter the signal.
356
Data Analysis
10. The signal after filtering will be added to the data plot of original signal. Select Graph:Speed Mode
and turn off speed mode in this graph. The resulting graph should look like this:
11. In the resulting graph, we can see that the high frequency components are blocked by the Low Pass FFT
filter.
357
Tutorials for Origin
2. Click the Import Single ASCII button and import the file fftfilter3.dat located at <Origin EXE
Folder>\Samples\Signal Processing.
3. Highlight column B and click the Line button on the 2D Graphs toolbar to generate a line plot.
4. With the graph active, select Analysis:Signal Processing:FFT Filters. This opens the fft_filters dialog
box.
5. Check the Auto Preview box to enable the Preview panel.
6. From the plot of frequency domain (the image below), we can see that this signal has components at
several different frequencies> Now we are going to get the component at about 300Hz. So we will use
the Band Pass method.
358
Data Analysis
When Band Pass is chosen, there will be two vertical red lines in the preview panel, marking the Lower
Cutoff Frequency and Upper Cutoff Frequency. You can similarly move these two lines and get the real
time preview of filtering results in the top parts of this panel.
8. Enter the values of the lower and upper cutoff frequencies according to the image below:
As long as only the desired amplitude peak stays within the cutoff frequency range, the error in filtering
could be considered as acceptable even though the values of upper and lower cutoff frequencies may
slightly differ for different cases.
359
Tutorials for Origin
4.4.4 Smoothing
4.4.4.1 Summary
Smoothing is a common technique for removing noise from signals. Origin provides multiple smoothing
methods, including Adjacent Averaging, Savitzky-Golay, Percentile Filter, and FFT Filter. Additionally, there is a
wavelet-based tool available.
For matrix data, Origin's smoothing is performed in two ways. If the number of columns or rows is less than
32, it will expand the matrix first, then shrink it back to the original size. If greater than 31, the matrix if first
shrank, then expanded.
Smooth a 3D surface.
360
Data Analysis
2. Select menu item File: Import: Single ASCII... to import the data Signal with High Frequency
Noise.dat under the folder <Origin Installation Directory>\Samples\Signal Processing\.
3. Highlight column B in the worksheet. Then, the select menu item Analysis: Signal Processing:
Smooth... (if the tool has been used before, select Open Dialog) to open the Smooth dialog box.
4.4.4.3.1 Adjacent-Averaging
1. Choose Adjacent-Averaging for Method. Set the Points of Window to 100 and Boundary
Condition to Periodic. To preview the result in the right panel, check the Auto Preview check box.
361
Tutorials for Origin
4.4.4.3.2 Savitzky-Golay
The Savitzky-Golay method is good for preserving the shapes of signal peaks.
1. Select column B again. On the Analysis menu, click Signal Processing: Smooth:Open Dialog....
2. In the smooth dialog box, set Method to Savizky-Golay. Set Points of Window to 100,
Boundary Condition to Periodic and Polynomial Order to 3.
3. Click OK.
1. Select column B again. On the Analysis menu, click Signal Processing: Smooth:Open Dialog.....
2. For Method, choose Percentile Filter. Set Points of Window to 100, Boundary Condition to
Periodic, and for Percentile accept the default value of 50.
3. Click OK button.
362
Data Analysis
1. Select column B again. On the Analysis menu, click Signal Processing: Smooth:Open Dialog.....
4. Note that in the worksheet, there are now four added columns containing the results of your four
smoothing operations. Highlight those four columns (C,D,E,F), then from the menu select Plot>2D:
Line: Line to make a line graph with these four datasets.
363
Tutorials for Origin
5. Comparing the results of the four methods, you can see that the Savitzky-Golay method did the best job
of preserving peaks in the data, while the FFT Filter method did the poorest job of preserving peaks.
2. Select menu item File: Import: Single ASCII... to import the data Signal with High Frequency
Noise.dat under the folder <Origin Installation Directory>\Samples\Signal Processing\ .
364
Data Analysis
3. Highlight column B, and from the menu select Analysis: Signal Processing: Wavelet: Smooth... to
open the Smooth: wtsmooth dialog box.
4. In the dialog, set Wavelet Type to DB6, and Cutoff (%) to 98. Check Auto Preview to preview
the result in the right panel.
6. To see the difference between the original signal and the smoothed signal, highlight all columns in the
worksheet and from the menu select Plot>2D: Line: Line.
365
Tutorials for Origin
4. With the converted matrix activated, select menu View: Image Mode to view this matrix as image.
366
Data Analysis
5. To perform smoothing, select Analysis: Signal Processing: Smooth.... This opens the Smooth:
msmooth dialog box.
6. Accept the default settings and click OK. To view the result, select View: Image Mode from the
menu.
367
Tutorials for Origin
4.4.5.1 Summary
Short-Time Fourier Transform (STFT) is a time-frequency analysis technique suited to non-stationary signals.
Short-Time Fourier Transforms can provide information about changes in frequency over time.
4.4.5.3 Steps
1. Start with a new workbook, and import the data <Origin Installation
Directory>\Samples\Signal Processing\Chirp Signal.dat.
368
Data Analysis
2. Highlight column B, and select menu Analysis: Signal Processing: STFT... to open the STFT: stft
dialog box.
3. In the dialog box, check Auto Preview at the bottom of the dialog so that you can preview your
results in the right panel. Uncheck the Auto check box next to Window length and Overlap, then
change Window length to 8, and Overlap to 7. Set Window Type to Hanning and Option to
Amplitude Result.
369
Tutorials for Origin
4. Click OK to perform STFT with the chosen settings and obtain your results, including a matrix book
with data and a color fill contour plot.
370
Data Analysis
5. We can see from the above image that the time resolution is good, but the frequency is not so
apparent. Click on the lock on the graph, then choose Change Parameters...from the menu. This
reopens the STFT dialog box. Change the Window Type to Rectangle and click OK.
371
Tutorials for Origin
6. Now, we are better able to see resolution of both time and frequency. Please note that it is not possible to
optimize for both time and frequency; the best we can do is to find the balance between them.
7. To view the result in 3D, activate the resulting matrix, then select menu Plot>3D:Surface:3D Color Map
Surface to create a 3D surface of the result.
8. Double click on the 3D graph to open the Plot Details dialog, and go to the Colormap/Contours
tab in the right panel. Click the Line... heading to open the Contour Lines dialog and Hide All lines.
372
Data Analysis
373
Tutorials for Origin
10. Click OK to finish the settings. To get a better view, rotate the graph.
374
Data Analysis
4.4.6.1 Summary
In OriginPro, it is possible to design, analyze, and implement IIR (Infinite Impulse Response) digital filters. The
IIR filter supports four methods, including Butterworth, Chebyshev Type I, Chebyshev Type II, and
Elliptic.
4.4.6.3 Steps
375
Tutorials for Origin
1. Start with a new worksheet and import the EMG Recording.dat file from \Samples\Signal Processing\.
2. Highlight column B and Select Analysis:Signal Processing:IIR Filter from the top menu to open the
dialog.
3. Change the Response type as High Pass, keep the Method as Butterworth, uncheck the Minimum
for Filter Order and set it as 4. In the Frequency Specification branch, set the Cutoff Frequency(Fc) as
20, then check the Forward-Backward Filtering. The dialog settings should look like the following
figure, and the IIR filter is designed.
376
Data Analysis
5. A new column will be added to the original data as a new column of filtered data and a new SOS Matrix
worksheet.
1. Highlight column B in the original worksheet, perform FFT filter by Analysis:Signal Processing:FFT
Filters.
2. In the opened dialog, choose High Pass for Filter Type and set 20 as Cutoff Frequency.
3. Click OK button. Column C in the EMGRecording worksheet is the filtered result of the previously designed
IIR filter, highlight column B and column C to generate a line plot with the button (Graph 1).
4. Use the scale in button to zoom the area between 12.5s and 13.3s.
5. Column E in the EMGRecording worksheet is the filtered result of the FFT filter, highlight column B and
6. Also use the scale in button to zoom the area between 12.5s and 13.3s, the two graphs could be
used for visualized comparison.
377
Tutorials for Origin
378
Data Analysis
Note that there are many ripples in the FFT filter result, but almost no ripples in the IIR filter result.
1. Highlight column E and click on the button to create a line plot (Graph 3).
2. Activate Graph 3, choose Gadget:FFT and set the X Scale as From 12.664 To 13.052.
3. Click OK to bring up the preview window, in which ripples are almost pure 20.125 Hz sine.
4. Now we would try to remove the ripples at 20.125 Hz by applying another high pass filter at 25 Hz, keep
highlighting column E and select Analysis:Signal Processing:FFT Filters.
5. Select High Pass for Filter Type and set Cutoff Frequency as 25.
6. The result is listed in Column G, highlight column G and click on the button to create a line plot(Graph
4).
7. Activate Graph 4, choose Gadget:FFT and set the X Scale as From 12.664 To 13.052, in the
preview window, there are still ripples, and they are shifted from 20.125 Hz to 25.157 Hz.
379
Tutorials for Origin
Note that the ripples could not be removed by FFT filter for this dataset.
4.4.7.1 Summary
2D FFT (2-dimensional Fast Fourier Transform) can be used to analyze the frequency spectrum of 2D signal
(matrix) data. Conversely, 2D IFFT (2-dimension Inverse Fast Fourier Transform) is able to reconstruct a 2D
signal from a 2D frequency spectrum. OriginPro provides both for conversion between time and frequency
domains in 2 dimensions, together with the 2D FFT filter to perform filtering on a 2D signal.
4.4.7.3 Steps
4.4.7.3.1 2D FFT
1. Start with a new matrix book, and select menu item File: Import: Image to Matrix... to import the
image <Origin Installation Directory>\Samples\Image Processing and Analysis\cell.jpg.
380
Data Analysis
2. Because Origin is not able to perform analyses on image data directly, we need to convert the image
to matrix data first. So, select menu item Image: Conversion: Convert to Data to bring up the
Convert to Data: img2m dialog box. Set Type to byte(1).
3. Click OK to finish the conversion. The result shows below. You can choose menu item View: Data
Mode and View: Image Mode to convert between data mode and image mode.
381
Tutorials for Origin
4. With the converted result matrix active, select the menu item Analysis: Signal Processing: FFT:
2D FFT... to open the 2D FFT: fft2 dialog box. Check the DC Shift Center check box to shift the
direct current to center. In the Output node, only check Complex Matrix and Log Amplitude
Matrix.
382
Data Analysis
5. Click the OK button to generate the FFT results. Both the complex matrix and the log amplitude
matrix are in the same matrix book. Change to image mode (View:Image Mode) for the log
amplitude matrix. The results should look like this:
383
Tutorials for Origin
4.4.7.3.2 2D IFFT
1. Start with the complex matrix (FFT2_Complex1) generated in the 2D FFT section above. Make it the
active window.
2. Select the menu item Analysis: Signal Processing: FFT: 2D IFFT... to bring up the 2DIFFT: ifft2
dialog box.
3. In the dialog box, the imaginary matrix is not needed because the Input Matrix is a complex matrix.
Check Undo Shift because DC has been shifted. Output should have the Real Matrix and
Imaginary Matrix boxes checked.
4. Click the OK button, and the result will be output to the same matrix book as the input complex
matrix.
384
Data Analysis
5. From the comparison shown below, the IFFT has recovered the original signal.
1. Start with an empty matrix book and from the menu select File: Import: Image to Matrix... to
import the image <Origin Installation Directory>\Samples\Image Processing and
Analysis\myocyte1.tif.
385
Tutorials for Origin
2. With the imported image active. select the menu item Image: Conversion: Convert to Data. This
opens the Convert to Data: img2m dialog box. Set Type to byte(1) and click OK to finish the
conversion.
386
Data Analysis
3. Activate the converted matrix and select the menu item Analysis: Signal Processing: 2D FFT Filters....
This opens the 2D FFT Filters: fft_filter2 dialog box.
4. In the dialog box, check the Auto Preview check box at the bottom to view the result in the right
panel. Set Filter Type to Band Pass, and set Lower Cutoff Value and Upper Cutoff Value to
0.05 and 0.25 respectively. For other controls, keep the default values.
5. Click OK to obtain the filtered result. As the image below shows, the background noise (the light) is
removed.
387
Tutorials for Origin
4.4.8 Convolution
4.4.8.1 Summary
Convolution is commonly used in signal processing. Origin uses the convolution theorem, which involves the
Fourier transform, to calculate the convolution.
With this tutorial, you will learn how to perform convolution in Origin.
4.4.8.3 Steps
388
Data Analysis
3. Highlight column B and C, and from the menu select Analysis: Signal Processing: Convolution.... This
opens the Convolution: conv dialog box. In the dialog, column B is labelled as Signal, and column C as
Response and the Sample Interval will be set according to the input signal's associated X column.
4. Expand the Options node and change Convolution Type to Circular, to repeat the data within range
for the data outside range, but not pad with zeroes.
389
Tutorials for Origin
6. In the worksheet, highlight column B and E (press CTRL to select non-adjacent columns), then from
the menu select Plot: Line: Line to make a graph with input signal and the output signal.
390
Data Analysis
4.4.9 Wavelet
4.4.9.1 Summary
Wavelet transforms are useful for analyzing signals which exhibit sudden changes of phase and frequency,
local maxima and minima, or related parameters. Wavelet transforms have become a popular tool in time-
frequency analysis, especially for analysis of non-stationary signals. OriginPro provides wavelet transform tools
for both continuous and discrete transforms.
1. Perform one-level discrete wavelet decomposition and reconstruct a signal from approximation coefficients
and detail coefficients.
2. Apply multi-level discrete wavelet decomposition.
3. Perform continuous wavelet transform.
4. Remove noise from signals by using wavelet transform.
5. Perform 2D wavelet decomposition and reconstruction on matrix data.
6. Convert an image to matrix data.
7. Merge graph windows into one graph.
4.4.9.3.1 Decomposition
391
Tutorials for Origin
1. Start with a new workbook, and select menu File: Import: Single ASCII... to import the data
<Origin Installation Directory>\Samples\Signal Processing\Chirp Signal.dat into the
worksheet.
2. Highlight column B, and select menu item Analysis: Signal Processing: Wavelet: Decompose... to
open the Decompose: dwt dialog.
3. In the dialog, choose DB6 for Wavelet Type & Order, and Zero-padded for Extension Mode.
4. Click OK to close the dialog box and output the approximation coefficients and the detail coefficients.
392
Data Analysis
5. Highlight columns B, C, and D (columns C and D should contain your approximation coefficients and your
detail coefficients, respectively). From the menu, select Plot: Multi-panel: Stack... to open the Stack:
plotstack dialog box.
6. In this dialog, clear the Link Layers check box in the Options node. Check the Auto Preview check
box at the bottom to see the preview graph in the right panel.
393
Tutorials for Origin
Note: To perform level 2 (3, 4, etc.) discrete wavelet decomposition, repeat steps 2 to 4 on the approximation
coefficients (column C, in our example). Multi-scale wavelet decomposition (available in OriginPro) is
demonstrated below.
4.4.9.3.2 Reconstruction
Reconstruction is the inverse operation of decomposition and this example will recover the signal from the
result generated above.
1. Highlight columns C and D (your approximation coefficients and detail coefficients, from above).
2. Choose menu item Analysis: Signal Processing: Wavelet: Reconstruction... to bring up the
Reconstruction: idwt dialog box.
3. To reconstruct the signal, we need to specify the same Wavelet Type, and Boundary, so set them
to DB6 and Zero-padded, respectively.
394
Data Analysis
5. Press CTRL and select columns B and E. From the menu, choose Plot: Line: Line to make a graph
with these two columns of data.
6. We can see from the resulting graph that the original signal and the recovered signal overlay each other.
395
Tutorials for Origin
1. Start with a new workbook, and then import the same data used in the Decomposition section above.
2. Highlight column B and select menu item Analysis: Signal Processing: Wavelet: Multi-Scale DWT...
to open the Multi-Scale DWT: mdwt dialog box.
3. In the dialog, change Extension Mode to Zero-padded, and Decomposition Level to 3. Click the
arrow button beside Multiple Coeff Data and select [<input>]<input> from the menu.
4. Click OK to obtain 3rd level discrete wavelet decomposition results. The coefficients are stored in the
same worksheet as the input signal.
5. Select all columns in the worksheet, then choose menu Plot: Multi-panel: Stack... to open the
Stack: plotstack dialog box. Click the arrow button to the right of Dialog Theme and select
System Default. Check the Auto Preview check box at the bottom of the dialog box to preview the
graph.
396
Data Analysis
397
Tutorials for Origin
1. Start with a new workbook with two empty columns (columns A and B) in a single worksheet.
2. Select column A and then right-click and choose Set Column Values... from the shortcut menu. This
opens the Set Values dialog box. In the text box, enter data(0, 1, 1/1023) and click Apply. This fills
column A with data.
398
Data Analysis
3. Click the >> button to select column B. Enter sin(1.5/(0.25-col(A)))+cos(0.2/(0.2-col(A))) and click
OK.
4. We can make a plot to see how the data looks. With column B selected, choose Plot: Line: Line from
the menu.
399
Tutorials for Origin
5. With the worksheet active, add a new column to the worksheet by selecting Column: Add New
Columns... from the menu. In the dialog box, accept the default value of 1 and click OK.
6. Column C is added to the worksheet. Select it, right-click and choose Set Column Values from the
shortcut menu. In the text box, enter data(1, 512) and click OK.
400
Data Analysis
7. Select both columns B and C, then from the menu, select Analysis: Signal Processing: Wavelet:
Continuous Wavelet... to open Continuous Wavelet: cwt dialog box.
8. In the dialog, set Wavelet Type to MexHat, and check Coefficient Matrix.
401
Tutorials for Origin
10. The coefficients are output to a new worksheet and a matrix and a contour plot is added. Double-click
on the plot to open the Plot Details dialog box. Select the Colormap tab and click on the Fill...
heading. The Fill dialog box opens with color contols. Click Load Palette, and choose Pumpkin
Patch from the Select Palette menu. Click OK to return to the Plot Details dialog box.
11. Click OK to change the color of the contour plot. It should now look like the graph below.
402
Data Analysis
1. Start with a new workbook and from the menu, select File: Import: Single ASCII.... Import the file
<Origin Installation Directory>\Samples\Signal Processing\Signal with Shot Noise.dat .
403
Tutorials for Origin
2. We can see from the Sparklines in the image above that there is shot noise in the signal. Highlight column
B and select menu Analysis: Signal Processing: Wavelet: Denoise... to bring up the Denoise:
wtdenoise dialog box.
3. Check Auto Preview to preview your result. Set Wavelet Type to DB9, Extension Mode to Zero-
padded, Threshold Type to sqtwolog, and Thresholding Level to 7.
4. Click OK to remove the shot noise from the signal. Results are output to worksheet columns C and D.
404
Data Analysis
5. Highlight all columns in the worksheet, then choose menu item Plot: Line: Line to make a graph
with the original signal and the cleaned-up signal. We see from the graph below that the shot noise
has been removed.
405
Tutorials for Origin
1. Start with a new matrix book. From the menu, choose File: Import: Image to Matrix... and import
the image, <Origin Installation Directory>\Samples\Image Processing and
Analysis\Car.bmp.
406
Data Analysis
2. To begin, we need to convert the image into data. To do this, select menu item Image: Conversion:
Convert to Data. The Convert to Data: img2m opens. Set Type to byte(1).
4. With the converted matrix active, select menu Analysis: Signal Processing: Wavelet: 2D
Decompose... and open the 2D Decompose: dwt2 dialog box.
407
Tutorials for Origin
5. Accept the default settings and click OK. This performs 2D wavelet decomposition on the matrix data.
A matrix book with four matrix sheets (CA, CH, CV, and CD) is generated. CA, CH, CV, and CD
contain approximation coefficients, horizontal detail coefficients, vertical detail coefficients, and
diagonal detail coefficients respectively. You can change the view mode to image mode by choosing
View: Image Mode from the menu.
408
Data Analysis
6. With the CA matrix sheet active, make an image plot by selecting Plot: Image Plot from the menu.
Repeat for CH, CV, and CD matrix sheets.
7. Double click on graph of them to open the Plot Details dialog, in the left panel, activate Layer1, and
then go to the Size/Speed tab in the right panel, and uncheck Matrix data, maximum points per
dimension. Click OK. select the axes related objects (including axis, label) in the graph and press the
DELETE key to delete them.
4.4.10.1 Summary
Coherence measures the degree of linear dependency of two signals by testing for similar frequency
components. If two signals correspond to each other perfectly at a given frequency, the magnitude of
coherence is 1. If they are totally unrelated coherence will be 0.
Correlation is another measure of the relationship between two signals. A correlation coefficient is used to
evaluate similarity. If two signals have a high degree of similarity, the magnitude of the computed correlation
coefficient is large. If there is little or no linear relationship between two signals, the magnitude of the
coefficient is small.
1. Test coherence and find out the frequency where two signals are in the highest degree of linear
dependency.
2. Perform correlation and find the lag to translate a dataset.
4.4.10.3 Coherence
2. Select the menu item File: Import: Single ASCII... to import the data <Origin Installation
Directory>\Samples\Signal Processing\Coherence.dat.
409
Tutorials for Origin
3. Select column A, then right-click and select Set As: Y from the shortcut menu. This sets the plot
designation for column A to Y.
4. Highlight the two columns and from the menu select Analysis: Signal Processing: Coherence.... This
opens the Coherence: cohere dialog box.
410
Data Analysis
6. Two columns of data are added to the worksheet. Highlight these two new columns and from the
menu select Plot: Line: Line to plot coherence against frequency.
411
Tutorials for Origin
7. Select the Data Reader on the Tools toolbar to read the strongest peak in the graph. The image above
shows that at a frequency of 0.25 there is a strong peak, indicating a strong correspondence between the
two signals at this frequency.
4.4.10.4 1D Correlation
2. Select menu File: Import: Single ASCII... and import the file <Origin Installation
Directory>\Samples\Signal Processing\Correlation.dat.
3. Select column A. Right click on it to open the shortcut menu, then choose item Set As: Y to set this
column's plot designation to Y.
4. Highlight the two columns and from the menu select Analysis: Signal Processing: Correlation....
This opens the Correlation:corr1 dialog box. Accept the default settings.
412
Data Analysis
6. The correlation result and a time lag column are output to the worksheet. Highlight column D, and
from the menu select Plot: Line: Line to plot the result.
413
Tutorials for Origin
7. The Data Reader in the image above shows that at Time = 49, there is a strong positive peak, which
means that the second dataset needs to be translated forward 49 units to align these two signals.
8. Return to the worksheet, highlight column A and B, then from the menu select Plot: Multi-Panel:
Vertical 2 Panel to plot the two signals to two separate graph layers.
9. Double click on the top plot to open the Plot Details dialog box. In the left panel, select Layer 2
(take care not to clear the check box). Go to the Link Axes Scales tab in the right panel and click
the Straight (1 to 1) radio button in the X Axis Link group.
414
Data Analysis
10. Click OK and both X axes now have the same scale.
11. To make the datasets movable, delete the lock by clicking on it and choosing Recalculate Mode: None.
Click OK if the Reminder Message dialog pops up.
415
Tutorials for Origin
12. Select the top plot, then select menu Analysis: Data Manipulation: Horizontal Translate to add a
vertical line to the layer, together with a triangle button. Click on the triangle button to open a menu
and uncheck Keep Tool after Translation. Open the menu again, select Translate Duplication in:
New Columns from the menu. Another two columns will be added and the source data of current
curve will be copied to these two new columns.
13. Again, open the menu and click Shift Curve... to bring up the Shift Curve dialog box. Set Value to
49.
416
Data Analysis
14. Click OK to translate the plot. This should align the two signals.
4.4.11.1 Summary
Decimation is used to reduce the size of the signal sequence by merging every N samples into one.
Envelope detection adds an envelope curve to the input signal. Origin's signal envelope tool computes an
envelope and plots an upper envelope, a lower envelope, or both.
4.4.11.3 Decimation
In this tutorial, we are going to perform decimation on sunspot count data. Measurements of sunspot number
were collected every month for more than 200 years. We will use decimation to reduce our dataset to one
sunspot count for each year.
1. Start with a new workbook, and import the data <Origin Installation
Directory>\Samples\Signal Processing\Sunspot.dat.
417
Tutorials for Origin
2. Select column A. Right click on the column and choose Set As: Y to set this column's plot designation to
Y. This will ensure that sunspot number is not associated with column A as X. That is because decimation
needs the X column data to be strictly monotonic.
3. Select column C and from the menu choose Analysis: Signal Processing: Decimation.... This opens the
Decimation: decimate dialog box.
4. In the dialog, set Resample Factor to 12. Set the Filter Type to Moving Average Filter. To
preview the result in the right panel, check the Auto Preview check box.
418
Data Analysis
7. Highlight the newly inserted column and right click on it and choose Set As: X from the context menu
to change this column's plot designation to X. Right-click on the column again and choose Set
Column Values... to bring up the Set Values dialog box and enter
into the text box and and click OK.
8. Select column A, then right-click to choose Set As: X from the shortcut menu, to set the column's
plot designation back to X. The final worksheet will look similar to the one below.
419
Tutorials for Origin
9. Press CTRL and select columns C and E. From the menu, choose Plot: Multi-Panel: Vertical 2 Panel
to make a graph. Note that the decimated line looks smoother as the image below shows.
420
Data Analysis
2. Select menu item File: Import: Single ASCII... to import the data <Origin Installation
Directory>\Samples\Signal Processing\Gaussian Envelope.dat.
3. Highlight column B and from the menu choose Plot: Line: Line to create a line plot.
421
Tutorials for Origin
4. With this graph active select Analysis: Signal Processing: Envelope... from the menu. This opens the
Envelope: envelope dialog box.
5. In the dialog box, set Envelope Type to Both Envelopes, and Smooth Points to 10. Check the
Auto Preview box to preview the result in the right panel.
422
Data Analysis
6. Click OK to create the graph showing upper and lower envelope curves.
423
Tutorials for Origin
4.4.12.1 Summary
In a step-like signal, rise time refers to the time required to change from a specified low value to a specified
high value (or from a specified high value to a specified low value in the case of fall time). Origin's rise time
tool allows you to graphically select a rectangular area tracing a rising or falling step in the signal, and from it
calculate the rise time or fall time for this selected step.
1. Use the Rise Time gadget tool to calculate the fall time.
2. Change the settings for fall time calculation.
3. Set the display elements on the graph.
4. Select the desired output options and output the result to worksheet.
4.4.12.3 Steps
2. Select menu File: Import: Single ASCII... to import the data file <Origin Installation
Directory>\Samples\Signal Processing\Step Signal with Random Noise.dat.
3. Highlight column B and make a line plot of it by selecting Plot: Line: Line from the menu.
424
Data Analysis
4. Click the Scale In ( ) button on the Tools toolbar, then select a range along the X axis from
about 500 to 700, so that we can focus on this portion of the plot.
5. With the graph active, choose Gadgets: Rise Time... from the menu to launch the tool.
425
Tutorials for Origin
6. In the dialog box, click the ROI Box tab and set X Scale From to 510 and To to 650. Set Tool to
Fall Time and Method to Histogram.
7. Click the Fall Range tab and change From (%) of Step Height to 20 and To (%) of Step Height
to 80.
8. Click the Quantities tab, check only three check boxes: Dataset Name(name), Fall Range(dVref)
and Fall Time(dT).
426
Data Analysis
9. Click the Output To tab, clear Script Window and check Append to Worksheet.
10. Click the Display on Graph tab, expand the Indicator branch, and change Edge Color to Blue.
Check Fall Range.
427
Tutorials for Origin
12. As the above image shows, the two red horizontal lines delineate the upper level and lower level. The
vertical distance between the two blue lines is the fall range, shown by the two indicator points on the line
plot. At the top of the rectangle, the fall time and fall range are reported.
428
Data Analysis
13. Click on the triangle button in the upper-right corner of the ROI to open a menu and select Fix ROI
Position, so that the yellow ROI rectangle is locked in place.
14. Open the menu again and click New Output to output the results. Open the menu again and choose
Go to Report Worksheet.
429
Tutorials for Origin
15. The report worksheet is activated and we can see that the three parameters that we chose on the
Quantities tab are reported.
4.4.13.1 Summary
Origin features some useful signal processing tools, such as smoothing, FFT filtering, and spectral analysis
tools like the Fast Fourier Transform (FFT) . These can be useful for performing sound analysis. This tutorial
will remove a specific noise from an audio signal (.WAV file) based on the spectral range of the noise.
4.4.13.3 Steps
In this tutorial, we will use "Origin8 Message.wav" and "Dial Tone.wav" which can be found under the
subfolder "\Samples\Signal Processing\" of the Origin installation folder.
Play the sound file "Origin 8 Message.wav" and you will hear a dial tone noise in the background. The 2nd file
is a recording of the dial tone.
1. Start Origin, and create a new project with an empty worksheet in a workbook.
2. Select menu File: Import: Sound (WAV)... to open the Sound dialog. (Hint: if this menu item is
not shown, select menu File: Import: Customize... to open the Import Menu Customization
dialog to add it.) Navigate to the "\Samples\Signal Processing\" folder and double click "Origin 8
430
Data Analysis
Message.wav" and "Dial Tone.wav" to add them to the import list. Make sure Show Options Dialog
is checked and click OK.
3. In the Import and Export: impWav dialog, click the triangle button to to the right of Dialog
Theme, and select System Default from the context menu. Then expand Import Options node,
change Multi-File (except 1st) Import Mode to Start New Sheets.
431
Tutorials for Origin
worksheets :
5. In each worksheet, we can see the Sampling Interval has the same value of 2.26757E-5 (second).
Click the i icon in the top left corner of the column and the Column additional information dialog
pops up with the sampling interval information. Click OK to close this dialog.
432
Data Analysis
6. With Dial Tone worksheet activated, highlight column A, and select menu Plot: Line: Line to make a
line plot.
7. Using this graph, select menu Gadgets: FFT... to open the Data Exploration: addtool_curve_fft
dialog. Using the default settings, click OK button to perform an FFT of the data and create the
FFTPREVIEW graph with the results.
433
Tutorials for Origin
8. Uncheck the Log Scale checkbox on the FFTPREVIEW graph, and then select menu Graph:
Rescale to Show All to rescale the graph. We can see that the distribution of frequency is mainly
under 2000 Hertz with the largest peaks being under 500 Hertz.
434
Data Analysis
9. Activate the worksheet Origin 8 Message and highlight column A. Select menu Analysis: Signal
Processing: FFT Filters to open the Signal Processing: fft_filters dialog. In the dialog, change
Recalculate to None, select High Pass for Filter Type, uncheck the Auto checkbox for Cutoff
Frequency and change value to 500. Clear Keep DC Offset checkbox. We can auto preview the
result by ticking the Auto Preview checkbox at the bottom, and the result will be shown in the right
panel, which can be shown or hidden by using the button in the bottom right corner of the left panel.
Note: If Recalculate is not None, the results need to be copied to new columns without the recalculate
lock for changing the Data Type, see step 11 below.
10. Click OK to generate the results. We can see that the filtered result is in floating point format. In
order to create a new WAV file, we need to convert this to an integer format.
435
Tutorials for Origin
11. Highlight column D (the filtered result column), and then choose Properties... item from the right-
click context menu, to open the Column Properties dialog. In this dialog, expand Options node, set
Format to Numeric, then change Data Type to Short(2). Click OK to apply these settings to column
D and close this dialog.
436
Data Analysis
12. Keeping column D highlighted, select menu File: Export: Sound (WAV).... In the open dialog, enter a
file name (such as Origin 8 Message_filtered.wav) and save to a familiar location. Make sure the Show
Options Dialog checkbox is ticked.
13. Click Save button and the Import and Export: expWAV dialog pops up. Clear the Auto checkbox
for Column, and change it to 4.
437
Tutorials for Origin
Note: The Column is specified for the Y column, and Origin will find its sampling interval if exists or its
associated X column. If no X column or the X column is not even spacing, there will be error messages.
14. Click OK to export column D as a wave file. Now you can play this wave file and hear that the dial tone
has been removed. Note that information with the same spectra as the dial tone is also removed.
4.5.1.2 Batch Peak Analysis Using Theme with Script Before Each Process
Integrating Peaks
438
Data Analysis
Setting the Fix, Share Status or Bounds for Multiple Peak Parameters Simultaneously
4.5.2.1 Summary
In OriginPro, the Peak Analyzer is capable of creating and subtracting baseline. There are various ways for
baseline creation. You can generate baseline anchor points automatically or manually and then connect them
with interpolation or fit them with a function.
How to create baseline with Asymmetric Least Squares (ALS) Method (Pro)
4.5.2.3 Steps
2. In the first page (the Goal page) of the Peak Analyzer, select Create Baseline as Goal. Click Next
to go to the Baseline Mode page.
439
Tutorials for Origin
3. Next we are going to create an user defined baseline for this spectrum by defining anchor points. On the
Baseline Mode page, select User defined from the Baseline Mode dropdown list. Check on Snap to
Spectrum to make sure when you add or move a baseline anchor point, it will be pulled back onto the
spectrum.
4. The first two methods in Anchor Points Finding are the most commonly used, and they can find
anchor points automatically based on the derivative of the spectrum. If the baseline is approximately
constant, 1st Derivative and 2nd Derivative is more powerful, otherwise, we should use 2nd
Derivative. In this example, the baseline is more curly, so we use 2nd Derivative method for
locating anchor points.
440
Data Analysis
For other methods in Anchor Points Finding and related smoothing parameters, you can refer to the
link: Baseline Mode Page.
5. Now click the Find button in the Baseline Anchor Points group. You can preview the anchor points
in preview window.
441
Tutorials for Origin
6. Click Next to go to the Create Baseline page, select Interpolation in the Connect by drop-down
list. In Interpolation method group, select Spline from the drop-down list. You can preview the
spectrum in preview window, and then click Finish to get the baseline data.
442
Data Analysis
1. Start from the Baseline Mode page, and select the Asymmetric Least Squares Smoothing
Baseline (ALS) as the baseline method. The ALS baseline can be tuned easily with a few parameters
without pre-selecting any anchor points.
443
Tutorials for Origin
2. Click Next go to Asymmetric Least Squares Smoothing Baseline page, adjust the parameters to
make the baseline optimal, then click Finish button to output the results table and graph.
444
Data Analysis
1. If you want to subtract baseline, select Subtract Baseline as the Goal at start page.
2. After you created a baseline, click Next button to go to Subtract Baseline page.
3. Click Subtract button for previewing the subtracted data. The baseline data and subtracted spectrum
will be outputted after clicking Finish button. The figures below displayed the Subtract Baseline
page and the preview of the subtracted spectrum.
445
Tutorials for Origin
4.5.3 Use Script to Search for Baseline Anchor Points in Peak Analyzer
4.5.3.1 Summary
446
Data Analysis
In OriginPro, the Peak Analyzer is capable of creating and subtracting baseline. You can create a baseline by
finding baseline anchor points first and then connect those anchor points either by interpolation or by fitting.
To search for those baseline anchor points, you can either use built-in methods or define the search method on
your own using LabTalk scripts.
4.5.3.3 Steps
447
Tutorials for Origin
Dataset dspos;
pkfind iy:=(dsx, dsy) dir:=p npts:=5 value:=200 ocenter:=dspos; // Find major peak
positions
apt_y.SetSize(npk+1);
448
Data Analysis
apt_y[1] = dsy[1];
apt_y[npk+1] = dsy[nn];
apt_x[ii+1]=dsx[ind];
};
The script will firstly find all major peak positions and then treat the minimum between every two adjacent
peaks as one baseline anchor point, then add the first and last data points as two baseline anchor points.
Note: You can still uncheck Enable Auto Find checkbox and then use Add or Modify/Del to add or remove
baseline anchor points.
5. Click Next button to go to Create Baseline page, make sure Connect by is selected as Interpolation and
the Interpolation Method is Line. Then click Finish to obtain integration areas for each peak.
4.5.4 Batch Peak Analysis Using Theme with Script Before Each Process
4.5.4.1 Summary
Origin can perform batch peak analysis of multiple datasets using an Analysis Theme. You can choose to pre-
process the peak data, e.g., exclude unwanted datasets, before actually input it for peak analysis using script
specified before each process.
449
Tutorials for Origin
4.5.4.3 Steps
1. Open Tutorial Data.opj and browse to the Script Before Process in Batch PA folder in Project
Explorer (PE).
2. Click on worksheet Data1 in the workbook. Highlight column B and go to menu Analysis: Peaks and
Baseline: Peak Analyzer to open dialog. Select Fit Peaks(Pro) as Goal.
3. Click Next button, select None(Y=0) as Baseline Mode. Click Next button twice to go to Fit
Peaks(Pro) page, expand Configure Graph subnode under Result node and set Create Summary
Graph to <None> to turn off generating report graph, which can speed up the analysis process.
4. Now click the button next to the Dialog Theme control and select Save as ... to open Theme Save
as... dialog. In the Theme Name edit box, enter MyPeakAnalysis and click OK button to save it.
5. Click Finish Button to perform the analysis and output results.
The Batch Peak Analysis Using Theme dialog provides three edit boxes to allow running script before each
process, after each process and at the end of all processes. In this section we will mainly show how to write
script before each process to pre-process the peak data.
1. Activate worksheet Data1 again, we can see from the sparkline of each dataset that some of peak data
are very noisy, e.g., column C, E, F, and we want to exclude such noisy dataset if it reaches certain noise
level.
2. The way used to identify whether data is noisy in this tutorial follows the routine below:
o Filter raw data with a high-pass FFT filter to obtain the high-frequency noise from the data.
o Find the standard deviation(SD) of the noise and the corresponding raw data.
o Set a criteria that if the ratio of the square of SD of the noise over the square of SD of the raw
data is over 30%, it will be regarded as noisy data and will be excluded for batch analysis.
3. Follow the routine above, the script for pre-excluding noisy data is as following:
450
Data Analysis
dataset dr;
stats dr;
stats _ry;
_skip=1;
else
_skip=0;
where _ry refers to current y data, _skip determines whether to skip current dataset.
1. Activate worksheet Data1, highlight all columns in the sheet and go to menu Analysis: Peaks and
Baseline: Batch Peak Analysis Using Theme... to open dialog.
2. Select MyPeakAnalysis from Theme drop-down list, Peak Properties(Pro) from Result Sheet drop-
down list.
3. To output results to a specified sheet, you can enter the range syntax in Output Sheet edit box. Suppose
we want to export to MyResults sheet in MySummary book, you can input [MySummary]MyResults! in the
edit box.
451
Tutorials for Origin
4. Input the script we wrote in section above into Script Before Each Process under Script node.
452
Data Analysis
5. Click OK button to perform batch peak analysis and you will see noisy datasets(say column C, E and F)
are excluded in MyResults sheets.
4.5.5.1 Summary
The Quick Peaks gadget provides an intuitive way to carry out peak analysis, and Peak Analyzer provides
further options for peak finding, fitting, etc. You can first use Quick Peaks gadget to find peaks and then use
the Peak Analyzer to analyze the peaks. You can save the whole analysis as a theme in the Peak Analyzer for
future use and/or batch processing.
Further analyze the peaks found in Quick Peaks gadget using the Peak Analyzer.
4.5.5.3 Steps
1. Open Tutorial Data.opj and browse to the Quick Peaks Gadget folder in Project Explorer (PE).
2. Highlight all columns in the Nitrate worksheet and click the button on 2D Graph toolbar to generate
a line graph.
3. Activate the generated graph window and select Gadgets:Quick Peaks.
4. In the ROI box tab, change the From and To values of X scale to 34.75 and 35 respectively, select
the Fixed(Prevent moving by ROI) check box.
453
Tutorials for Origin
5. In the Baseline tab, select the Full Plot Range radio button for Range.
6. In the Find Peak tab, change the Method for Peak Filtering to By Number, and set the Number
of Peaks as 3, select Blue as the color of the Peak Label.
454
Data Analysis
455
Tutorials for Origin
8. In the Quantities tab, you can decide which quantities to output. Leave only the check boxes for
Peak ID, Peak X, Peak Y, Height, Peak Area and FWHM checked, and clear the other check
boxes. Click OK to add the gadget to the plot.
456
Data Analysis
9. Click the triangle button to the right of the ROI box and select New Output to generate the report
worksheet.
10. Bring up the context menu again to select Go to Report Worksheet to open the result worksheet.
11. Now we are going to open the Peak Analyzer to carry out peak fitting. Bring up the context menu and
choose Switch to Peak Analyzer.
457
Tutorials for Origin
12. The Peak Analyzer is opened, the Fit Peaks goal is already selected, the baseline mode and peak finding
method follow the settings in the Quick Peaks gadget.
13. Go to the Fit Peaks page directly and click the Fit button to fit the three found peaks with default
Gaussian function.
14. Click the button and select Save As in the context menu to save this analysis as a theme with the
name MyQuickPeaks.
458
Data Analysis
15. In the Peak Analyzer, click the Finish button to generate the peak fitting results.
Notes: The theme can be used in the batch peak analysis. Select Analysis:Peaks and Baseline:Batch
Peak Analysis using Theme to open the paMultiY dialog. The batch peak analysis is very useful when
you have multiple data files that are similar. You can refer to this example for more details.
459
Tutorials for Origin
4.5.6.2.1 Summary
The Peak Analyzer provides several methods to pick peaks automatically. Also, user can opt to
add/delete/modify the peaks manually.
Labels are added to the peak centers after they are found or added, to show user the positions of the current
peaks.
How to use and customize the auto peak finding in the Peak analyzer
4.5.6.2.3 Steps
5. In the first page (the Start page), select the Find Peaks radio button in the Goal group. Then click
the Next button to go to the next page.
460
Data Analysis
1. Expand the Peak Finding Settings branch. Make sure that Local Maximum is selected for
Method. Then click the Find button. Only five peaks are detected.
2. Change Method to 2nd Derivative (Search Hidden Peaks). Click the Find button again.
This time, seven peaks are detected.
461
Tutorials for Origin
3. Click Finish to complete the analysis. We will get this final graph:
462
Data Analysis
Integrating Peaks
4.5.7.2.1 Summary
Use the Peak Analyzer to integrate peaks and find their areas.
4.5.7.2.3 Steps
1. Start a new workbook and import the file \Samples\Spectroscopy\Peaks with Base.DAT.
2. Highlight the second column.
3. In the main menu, click Analysis, then point to Peaks and Baseline, and then click Peak Analyzer.
463
Tutorials for Origin
4. In the first page (the Goal page) of the Peak Analyzer, select Integrate Peaks in the Goal group. Click
Next to go to the Baseline Mode page.
5. On the Baseline Mode page, select Use Existing Dataset from the Baseline Mode dropdown list. Click
the triangular button to the right of the Dataset dropdown menu, and then select
[PeakswithBase]"Peaks with Base"!C"Base" on the fly-out menu. Click Next to go to the Baseline
464
Data Analysis
6. Select the Auto Subtract Baseline check box. Click the Integrate Peaks page icon in the upper panel
(or click Next twice to go to the Integrate Peaks page). In the preview graph, you will see two numbered
465
Tutorials for Origin
yellow rectangles representing two peaks found with the default settings.
7. For Integration Window Width, select Adjust on Preview Graph. On the graph, click inside the
rectangle marked with 1. A pair of "handles" appears on either side of the yellow integration window. Drag
these handles to adjust the range for which integration will be performed. Click inside the rectangle
466
Data Analysis
marked with 2 and adjust the integration range for the second peak.
8. In the Integrate Peaks page of the Peak Analyzer, make sure all the desired quantities to compute have
been selected in the Quantities group. For example, if you want to calculate the peak centroid for each
peak, select the Peak Centroid check box. If you don't want to output the percent areas, clear the
Percent Area check box. When you are done, click Finish to perform the analysis.
467
Tutorials for Origin
468
Data Analysis
If the Area check box was selected in the Quantities group, peak area data appears in the Area column of
the result worksheet.
Setting the Fix, Share Status or Bounds for Multiple Peak Parameters Simultaneously
4.5.8.2.1 Summary
In OriginPro, the Peak Analyzer is capable of performing multiple peak fitting with several baseline
subtraction options.
There are various ways to create a baseline for your spectrum data. You can select a few anchor points and
then fit them with a function. The fitting of the baseline can be done along with the peak fitting.
4.5.8.2.3 Steps
1. Start a new worksheet and import the file <Origin Program Folder>\Samples\Spectroscopy\Peaks on
Exponential Baseline.dat.
469
Tutorials for Origin
3. Select Analysis: Peaks and Baseline: Peak Analyzer from the main menu to open the Peak Analyzer.
470
Data Analysis
4. Select the Fit Peaks radio button in the Goal group on the first page.
5. Click Next to go to the Baseline Mode page. In the Baseline Mode page, select User Defined from the
Baseline Mode drop-down list. Click the Find button in the Baseline Anchor Points group. Eight anchor
471
Tutorials for Origin
472
Data Analysis
6. Click Next to go to the Create Baseline page. In the Create Baseline page, select Fitting with the
Connect By drop-down list. In the Fitting group, select ExpDec2 from the Function drop-down list.
473
Tutorials for Origin
7. Click Next to go to the Baseline Treatment page. In the Baseline Treatment page, select the Fit
Baseline with Peaks check box.
474
Data Analysis
8. Click Next to go to the Find Peaks page. In the Find Peaks page, click the Find button to search peaks.
Two peaks should be found.
9. Click Next to go to the Fit Peaks page. In the Fit Peaks page, click the Fit Control button to open the
Peak Fit Parameters dialog.
475
Tutorials for Origin
10. In the Peak Fit Parameters dialog, make sure that both peak types are Gaussian. Click the Fit Until
Converge button.
4.5.8.3.1 Summary
In some cases, you may want to perform peak fitting with preset peak parameters. For example, you may
have many datasets with fixed numbers of peaks and the centers of these peaks do not vary from dataset to
dataset. What you are interested in is mainly other parameters of the peaks, for example, heights. Using the
theme feature of the Peak Analyzer, you may carry out peak fitting with fixed peak parameters easily.
4.5.8.3.3 Steps
4.5.8.3.3.1 Save a theme with peak positions and peak parameters
476
Data Analysis
2. Highlight the second column and select Analysis: Peaks and Baseline: Peak Analyzer from the Origin
menu to open the Peak Analyzer.
477
Tutorials for Origin
3. On the first page, select the Fit Peaks radio button in the Goal group. Click Next to go to the Baseline
Mode page.
478
Data Analysis
4. In the Baseline Mode page, select None (Y=0) with the Baseline Mode drop-down list. Click Next to
go to the Find Peaks page.
479
Tutorials for Origin
a. Clear the Enable Auto Find check box, because we want to find the peaks manually. Click the
Peaks Info button to open the Peak Info dialog.
b. In the Peak Info dialog, click the Add button seven times to add 7 peaks. Enter the peak
centers and heights as follows:
480
Data Analysis
c. Click the right-sided triangle button to the right of Dialog Theme in the upper panel. Select
Save As from the short-cut menu. The Theme Save as dialog opens.
d. In the Theme Save as dialog, enter MyFitting after Theme Name. Clear and select the check
boxes as the screenshot below:
481
Tutorials for Origin
Click OK to save the theme. This should bring you back to the Peak Analyzer dialog.
e. Click the Finish button in the Peak Analyzer to complete the analysis.
1. Start another new workbook and import the file <Origin Program
Folder>\Samples\Spectroscopy\HiddenPeaks.dat.
2. Highlight the second column
3. Select Analysis: Peaks and Baseline: Peak Analyzer from the Origin menu to open the Peak
Analyzer dialog.
482
Data Analysis
4. On the first page of the Peak Analyzer, click the right-sided triangle button to the right of Dialog
Theme. From the short-cut menu, pick MyFitting.
5. Click Next to check if the settings in every step are correct. Note that in the Find Peaks page, you can
see the peak centers and heights are same as last time.
6. When you reach the last page, click the Fit Control button to open the Peak Fit Parameters dialog.
Make sure that all peak centers are fixed and the values are the same as last time. Click OK to return to
the Peak Analyzer.
7. Click Finish to complete the analysis. Check the results to see whether they are the same as the results
we got last time.
4.5.8.4 Setting the Fix, Share Status or Bounds for Multiple Peak Parameters Simultaneously
4.5.8.4.1 Summary
483
Tutorials for Origin
When performing peak analysis, one often wants to fix parameter values, or share parameters between
multiple peaks, or specify bounds. If your data has a few peaks, you can simply perform these settings for
each peak. But if your data has many, it may be time consuming to set individually. To make the process more
efficient, the Peak Analyzer offers context menus which can allow you to set the fix, share status or bounds
for multiple peak parameters simultaneously. For more details about these settings, please refer to the Origin
Help File.
How to set upper bounds and upper bound values to multiple peak parameters simultaneously.
4.5.8.4.3 Steps
1. Start a new workbook and import the file <Origin Program Folder>\Samples\Spectroscopy\Positive &
Negative Peaks.dat.
2. Highlight the second column and select Analysis: Peaks and Baseline: Peak Analyzer to open the
Peak Analyzer dialog. In the first page (the Start page), select the Fit Peaks radio button in the Goal
group. Then press the Next button to go to the next page.
3. In the Baseline Mode page, select Constant with the Baseline Mode drop-down list and choose
Mean in the Constant group. Then click Fit Peaks in the wizard map to directly go to the Fit Peaks
page.
484
Data Analysis
2. Make sure the Parameters tab is active and then select 1 in the Share column of the wG_1
row. Then right click on it and select Apply Same "Share" to All wG. Then you will find
that all the parameters with the wG prefix are shared in the same group.
485
Tutorials for Origin
3. Then select 2 in the Share column of the wL_1 row. Then right click on it and select Apply
Same "Share" to All wL. Then you will find that all the parameters with the wL prefix are
shared in the same group. After this, the Parameters tab should look like below:
486
Data Analysis
4. Activate the Bounds tab. Double-click in the cell in the first Gaussian width row and the second
< or <= column. And you will find <= is shown in this cell (the < will be shown if you double-
click in the cell for one more time). Then type 5 into the Upper Bounds column in the same row.
5. Then right click on it and select Apply Same "Bounds" to All wG.
487
Tutorials for Origin
488
Data Analysis
5. Click the Fit Until Converged button. When the fitting is done, click OK to close the dialog.
6. Back in the Fit Peaks page, click Finish to complete the analysis. See the results in the source workbook
and the graph report.
Worksheet Query
Data Reduction
Data Filter
489
Tutorials for Origin
4.6.2.2.1 Summary
Origin provides several ways to fill a worksheet column with values. Use Auto Fill or script commands to fill a
series of values. Use the F(x) row or the Set Values dialog box to define a mathematical formula to generate
or transform a data set. Refer to values in other columns from the same sheet or from other sheets and books.
Select from a large collection of built-in functions to compute values. Create variables from metadata stored in
worksheets or column headers, and use these variables in your column formula.
This tutorial will show you how to compute column values by:
Beginning with version 2018 SR0, Origin supports to use a formula to set cell values.
490
Data Analysis
3. Move the mouse to the bottom right-hand corner of the second cell. The cursor will change to display
"+".
4. Drag the mouse toward the bottom of the column. The column will be filled with 1, 3, 5, 7, ... .
491
Tutorials for Origin
Note that a row can also be auto filled by dragging towards the right. To repeatedly
copy values instead of generating new values, hold down the CTRL key and drag the
mouse toward the bottom of the column.
1. Right click on the column B and select Fill Column with: A Set of Numbers from the context menu to
bring up the PatternN dialog
492
Data Analysis
3. After you click the OK button, Column B will be filled with values: 1, 3, 5, 7, ...., 23
We will show you how to enter expressions in the F(x) row to set column values.
1. Create a new workbook. Import US Metropolitan Area Population.dat from the \Samples\Data
Manipulation\ folder.
2. Add a new column to the worksheet (right-click to the right of the last column in the worksheet and select
Add New Column from the context menu). Change the Long Name of the column to Population/Sq. Mi.
3. To calculate the population density, enter the expression, B/A, in the F(x) row of column E.
4. The column will get computed using data from the other two columns.
1. Create a new workbook. Import Step Signal with Random Noise.dat from the \Samples\Signal
Processing\ folder.We are going to calculate the moving average of column B, that is, calculating the
adjacent average value at each point of column B.
2. Click the Add New Columns button on the Standard toolbar to add a new column C. Highlight this
column and right-click, and then click Set Column Values... to open the Set Values dialog.
493
Tutorials for Origin
3. In Set Values dialog, click the Search and Insert Functions button to search for keyword adjacent
average.
4. Double click function name Movavg(vd,back,forward) to insert it into dialog and close the dialog.
494
Data Analysis
5. Highlight the characters vd. replace vd with B, replace back with 0 and replace forward with 2. Your
formula should look like this:
6. Click OK. The last column will fill with the moving average from column B.
When referring to another column in the same worksheet, you can use index (e.g.
"col(1)"), short name (e.g. "A" or "col(A)"), or long name (e.g. "signal with noise") to
identify the column.
The Set Values dialog provides an Variable menu to easily insert range variables that point to columns in
other books/sheets, which can then be used to compute column values for the current column.
495
Tutorials for Origin
1. Open the project \Samples\Data Manipulation\Setting Column Values.opj and click on the
Columns from Other Sheets subfolder.
2. In the workbook, right-click on the worksheet tab labelled Sample and select Duplicate Without Data.
Rename(by double-clicking on the current name) the new sheet as: Corrected Sample.
3. Now you will fill these three columns with data based on formulas that reference columns in the other
sheets. Highlight the first column and right-click on it to select Set Columns Values to open the dialog.
Select Variables: Add Range Variable by Selection to open the Select from Worksheet dialog. With
this dialog, you could select a column from worksheet and insert it as a range variable to the Before
Formula Script panel.
4. When the Select from Worksheet dialog is open, activate the Sample sheet, highlight column A to
select and click the button to confirm selection and click OK (accept Column Notation) in the
Insert Mode dialog box that appears.
5. "range r1 = Sample!Col(A);" will be automatically inserted into the Before Formula Scripts panel. Edit
the formula to read as:
6. Then enter rTime in the Column Formula and click the OK button to generate data for the first column
and close the dialog.
7. In the Corrected Sample worksheet, highlight column B and column C and right-click on them. From the
shortcut menu, select Set Multiple Column Values to open the dialog. Select Variables: Add Range
Variable by Selection and insert two range variables, one by one, to the Before Formula Script panel
similarly as the previous steps. Edit these new entries as follows:
496
Data Analysis
and
8. Now we will edit the range variables in the Before Formula Scripts panel and use another expression to
get the same results. Remove the column names Col(B) of the two range variables and select Variables:
Predefined Variables: wcol(j) in both lines so it looks as follows:
10. Then input the following expression into the Column Formula:
497
Tutorials for Origin
11. Click the OK button to generate data for the column B and column C of the Corrected Sample
worksheet.
1. You reference a particular cell value with square brackets, so [1] in the Column
Formula expression above means the first element.
2. You can select Formula: Save and Formula: Load in the Set Column Values
dialog to save your formulas and reload them into other columns to generate new
data.
498
Data Analysis
Values contained in specific worksheet cells can be referenced and used to compute the formula for setting
column values. This provides an easy way to use worksheet cells as control cells for updating values in a
column.
1. Open the project \Samples\Data Manipulation\Setting Column Values.opj and switch to the Cells
in a Worksheet subfolder in Project Explorer.
2. Right-click on column C and select the Set Column Values... context menu to bring up the Set Values
dialog.
3. Use the Variables: Add Range Variable by Selection menu item to open the Select from Worksheet
dialog. Then select column G(Value) in this worksheet, click the button.
Click OK when the Insert Mode dialog appears (accept Column Notation) to add its expression to the
Before Formula Scripts panel.
4. In the Before Formula Scripts panel, change the name of the range variable to be rControl and add
these additional lines so that the script looks like below
//range r1 = Col(7);
oy:=(1,3);
The script calls the differentiate X-Function and passes the cell values from column G as arguments for
polynomial order and number of points, which controls the Savitzky-Golay smoothing performed during
the differentiation.
499
Tutorials for Origin
6. Click OK to close the dialog and see the results in column C. Now you can try to change the values in
column G, to change the output.
The graph shown in the worksheet was first created and then embedded into the
worksheet by merging a group of cells.
Metadata stored in the workbook, such as variables saved when importing data using the Import Wizard, can
be referenced and used for computing column values.
500
Data Analysis
4. Select the Variables: Add Info Variable menu item to open the Insert Variables dialog. Select
Numeric int from the Variable Type drop-down list. Expand the USER.VARIABLES node and click to
highlight NUMBEROFPOINTS row with Value as 3800. Press the Insert button to insert this variable
into the Before Formula Scripts panel.
5. Next, set Variable Type to Numeric double. Hold the Shift key down to select both
StartFrequencyKHz and StepFrequencyKHz, and then press Insert to insert these two variables.
Press the Close button to close the dialog.
6. In the upper Column Formula panel, input {d1:d2:d1+(n1-1)*d2} and then press the OK button to
generate data and close the dialog. The column will be filled with frequency values.
7. Highlight the first and second columns, right-click on them and select Set As: XYY to change the plotting
designations to X and Y. After you change the long name of the first column to Frequency, the worksheet
501
Tutorials for Origin
In the Cell-Edit Mode, you can enter a cell formula beginning with an equals sign "=" into a cell (a data cell or
UserDefined Parameter Row cell) just as below.
Once the formula has been entered, you exit edit mode (in-place edit or Edit: Edit Mode) to see the resulting
cell value.
Let us use an example to show you how cell formulas work in Origin:
502
Data Analysis
2. Import the sample data "automobile2.dat" located at the folder <Origin Program
Folder>Samples\Statistics into the workbook.
3. Right-click on the header cell of column label row "F(x)=" and select Add User Parameters from the
context menu to add a user parameter.
4. Here, let's add two user parameters and enter Mean and Std Dev as their parameter names separately.
And then, add one more column at the end of this worksheet, enter Power/Engine Displacement as the
column Long Name.
5. Select Edit: Edit Mode menu to switch to the Edit Mode. And then, in the cell Mean and Std Dev of
Col("Power"), enter =mean(this) and =stddev(this) respectively. Once the edit done, click outside the cell
503
Tutorials for Origin
to exit cell-edit mode reselect the Edit: Edit Mode menu item to display cell formula results.
Note: About the meaning of the variable "This", please refer to this page.
6. Click the cell Mean of Col("Power") to select it, put the cursor to the lower right corner of this cell. When
the cursor turns to a cross +, grab this "+" handle and drag with your mouse horizontally to Col("Engine
Displacement"). Release the cursor, you will found other cells of this row will be filled with some result
values.
7. Double-click those Mean cells, you will found the filled formulas are all same, =mean(this).
8. Do the same thing for the Std Dev row to calculate the standard deviation for all these five columns.
504
Data Analysis
9. Go to the last column we just added, in the first cell enter =E1/I1.
Note: Here, E1 means the first cell of col(E) and I1 means the first cell of col(I). You can refer to
this page to learn more about the formula.
10. Release your cursor to execute the division. Use the same way at Step 6 to grab this "+" handle and drag
with your mouse vertically to the end cell of this column (Hint: If you hover on the lower-right corner of
the cell, directly over the cell handle, the cursor changes to a "+" sign. When this "+" sign appears,
double-click to extend the formula to the end of the column. This is faster and easier than dragging with
your mouse).
11. Release the cursor to get all division results of col(E)/col(I) at each row.
505
Tutorials for Origin
12. Select Edit: Edit Mode menu, you can check and edit all these cell formulas.
Note: Additionally, you are also allowed to extend formulas acroos rows and columns.For more details
about setting cell values with formula, please refer to this page.
Worksheet Query
Data Reduction
Data Filter
4.6.3.2.1 Summary
This tutorial will show you how to use the Worksheet Query dialog.
506
Data Analysis
Start with a new workbook and import the file \Samples\Statistics\body.dat, click the menu item Worksheet:
Worksheet Query to open the dialog as follows:
Basically, there are two main panels in the Worksheet Query dialog. The left panel lists all the columns in the
active worksheet, you can right-click and select some column properties you want to see, such as Format, 1st
Value, etc.
Note the Extract column in this panel, only data selected in the Extract checkbox will be extracted.
The right panel is where you set and test extract conditions. For example, you can select the column you want
to use in the extract condition, and then click the button to move it into the Select Column Variable for
If Test group.
507
Tutorials for Origin
When there are available columns in the Select Column Variable for If Test group, the Condition edit box
becomes editable for you to set conditions. For example, select height and weight to the group, Origin will
automatically set an alias for each column. You can click into the Alias cell and rename the alias:
These alias can be used directly in the extract condition. Let's keep the default alias, h and w in this example.
The buttons on the right side of Condition edit box can be help to establish extract conditions. For example,
to extract data that is no less than 160cm, highlight the column on Select Column Variable for If Test and
click Add... button and build the first condition as follow:
Click OK to close the dialog. When there are multiple conditions, you can also combine these conditions by
logical operation using AND, OR, NOT buttons. Now click AND button and then highlight w on Select Column
Variable for If Test group and click Add... button again, this time, we are looking for weight no greater than
50kg:
508
Data Analysis
When the condition is done, click All Rows button to select all rows, then click the Test -- select if true
button and Origin will return 5 found records. Of course, if you familiar to logical operation syntax, you can
type the condition on the edit box directly:
Accept other default settings and click the OK button. A new workbook is created with these 5 records.
When extracting strings, you need to enclose the string by double quotation marks ". For example, select the
gender column into the Select Column Variables for If Test group. Using the alias g, you can extract all
female data by:
g == "F"
Date and Time data are internally saved as numeric values in Origin. Date is the integer part of the numeric
value, while Time is the fractional part. In Origin, you can use the int() and frac() functions to return the
integer and fractional part of a number, and use the Date(MM/DD/YY) and Time(HH:mm:ss) functions to
transfer string to time data. We can combine these functions to extract time data.
For example, using data from Import Time Data tutorial, you can extract data within time period 10:00 ~
11:00 by:
You can see Origin found 120 records. Similarly, if you want to extract Date data, you can try some condition
like:
509
Tutorials for Origin
4.6.3.3.1 Summary
Worksheet datasets can be reduced in size using various tools. Origin offers six tools which can be used for
data reduction, including the Data Filter, Worksheet Query and four data reduction x-functions, which reduce
the number of data rows by different methods.
4.6.3.3.3 Steps
4.6.3.3.3.1 Reduce to Evenly Spaced X
1. Create a new workbook and click the button to import the file Signal with High Frequency
Noise.dat under <Origin EXE folder>\Samples\Signal Processing path.
510
Data Analysis
3. Click OK. A new column (column C) is added to the worksheet. This column contains its own sampling
interval information. Right click on its column header and select Show X Column. In the Show X
Column: colshowx dialog box, click OK to generate an X column using the sampling interval. You
can see that the original XY dataset has been reduced by generating a new, larger sampling interval.
4. Highlight column B and D (hold down the Ctrl key for multiple selection), and click the button to
generate a line plot for original (Black) and reduced (Red) data.
5. You can see from the plot that the data size is considerably reduced:
511
Tutorials for Origin
1. Create a new workbook and click the button to open the Import Wizard. Select the data files
Step01.dat, Step02.dat and Step03.dat under the file path <Origin EXE Folder>\Samples\Curve
Fitting\. Change the Import Mode to Start New Rows and make sure the default import filter step is
applied. Click Finish to import these data files.
512
Data Analysis
3. Click OK to apply settings and in the results sheet Sheet2, we can see that for each X value, 3
duplicates are found. In the reduced dataset, the Y values for each duplicated X have been replaced
by the sum of the Y values.
513
Tutorials for Origin
514
Data Analysis
2. Entire worksheet rows are reduced into the average values of merged rows which are determined by
duplications in the selected column. A new column Counts is added to the end of the result
worksheet wdeldup and it reports the number of duplicates found for each X value.
515
Tutorials for Origin
The tool Reduce Duplicate X works for XY dataset only, while the tool
Remove/Combine Duplicate Rows works for an entire worksheet.
You can also remove duplicate XY data from an XYZ dataset by using the Statistics on
Columns tool, please refer to this Quick Help.
1. Open a new workbook, then click the button to import the Magnetization.dat file under <Origin EXE
folder>\Samples\Data Manipulation path.
2. Highlight columns A and B and click the button to generate a line plot.
3. Activate this graph and select Analysis:Data Manipulation:Reduce by Group to open the
reducexy dialog. Edit your settings as below:
516
Data Analysis
4. Click OK to reduce the data. The reduced XY dataset will be added as two new columns at the end of
original worksheet:
517
Tutorials for Origin
5. The reduced XY dataset is added as a new data plot to the original graph:
518
Data Analysis
1. Open a new workbook, then Click the button to import the file Nitrite.dat (path is <Origin EXE
folder>\Samples\Spectroscopy). There are 6392 data points in this file.
519
Tutorials for Origin
2. Highlight both columns in the Nitrite worksheet and select Worksheet:Reduce Rows to open the
wreducerows dialog, and edit the settings to match the image below:
520
Data Analysis
Note: You can select the arrow button right to the Output select box and choose <new>:New
Column(s) to make the selection.
3. When you click OK, only the first of every 10 rows is kept. Ninety percent of data points are
discarded. Remaining data points are output to new columns:
4. Select the entire worksheet and click the button to generate line plots for original (Black) and
reduced (Red) data:
521
Tutorials for Origin
5. Note that peak heights were changed with data reduction. To maintain data plot shape, we should keep
more data points. Click the green lock on Graph 1 and choose Change Parameters to open the
wreducerows dialog again. Change the value of Delete Rows to 3 and click OK.
6. This time 25% of data points were kept, better preserving the shape of the original data plot.
522
Data Analysis
4.6.3.4.1 Summary
The Data Filter is a column-based tool to reduce rows of worksheet data, and consequently also hide the
undesired rows for relevant data analysis and graphing. Three data formats are supported: numeric, text and
date/time.
Auto update the graphs and analysis results when apply a column filter
4.6.3.4.3 Steps
523
Tutorials for Origin
1. Create a new workbook by clicking the New Workbook button . Then click the Import Single ASCII
button to import the automobile.dat file in the <Origin Folder>\Samples\Statistics\ path. Both
buttons are located in the Standard toolbar.
2. Highlight column C(Power), right click and choose Set As:X in the context menu to set this column as X.
3. Highlight column C and G (hold Ctrl key when clicking), click the button on the 2D Graph toolbar to
generate a scatter plot from these two columns.
4. Activate the generated graph and select Analysis:Fitting:Linear Fit from menu item to open the
Linear Fit dialog. In this dialog, set Recalculate to Auto to ensure auto update of the analysis
result, accept other settings as default and click OK to carry out the analysis.
5. A fitted curve and a result table will be added to the graph. Activate the graph again and double click
on the X axis to open the Axis dialog. Select the Horizontal icon in the Scale tab, then choose Auto
for Rescale. Do the same for the Y axis (Vertical icon) and also set its rescale mode to Auto. Click
OK to apply the settings and close the dialog.
524
Data Analysis
6. Go back to the original worksheet automobile and click Column: Add New Columns and add 7 columns
to the worksheet.
7. Right-click in the gray area to the right side of the worksheet columns and select Add Graph... in the
context menu to open the Graph Browser. In this dialog, select the previously generated graph in
the left panel and click OK to add this graph as a floating chart to the worksheet. Drag the floating
chart onto the empty worksheet columns you just created and resize it using the selection handles.
525
Tutorials for Origin
8. Highlight column A and B and click the Add/Remove Data Filter button on the Worksheet Data
toolbar to add empty data filters to both columns.
9. Click the Filter icon on the column header of column B, clear the check boxes before Buick,
Chrysler, GMC, Kia, Lincoln, Mercedes, Saab, Volvo to hide all rows with these entries, to leave only
the Japanese makers. Click OK to apply the filter. The worksheet data, graph and analysis result will
all be auto updated accordingly.
10. Click the Filter icon on the column header of column A and select Between, note that the data type of
column A is numeric by default from importing. Accept default setting of the Between dialog and click
OK. A data filter is applied to this column.
11. Again click the Filter icon on column A and this time choose Custom Filter in the context menu to
customize the filter, change the Condition as x.between(1996,2000) to set the From and To value
respectively, click the Test button and in the original worksheet, only the rows meet this testing condition
will be highlighted, this works as a preview of the data reduction.
526
Data Analysis
To view the whole worksheet at this stage, you can minimize the Custom Filter dialog,
allowing you to scroll up and down the worksheet freely. You can later restore the
dialog by clicking the "Minimize" button.
12. Click the OK button to apply the new filtering condition and the data, graphs and analysis results are
updated and the graph is also auto rescaled.
4.6.3.5.1 Summary
Generally, when graphing or analysis is done on data with a filter, changes in the filter condition of the source
worksheet trigger recalculation for the analysis results and graph.
However for Copy Columns and Pivot Table, in the Recalculate lock icon context menu, there are three
worksheet filter options. These are used to control whether the results will be affected by further filter
changes.
How to push back the Data Filter condition to the source worksheet
4.6.3.5.3 Steps
527
Tutorials for Origin
1. Import the Origin sample data automobile.dat which is located in <Origin Program Folder>
\Samples\Statistics.
2. Highlight the Make column, then right-click and select Filter: Add or Remove Filter in the context menu
or select the Filter button from the Worksheet toolbar.
3. To show only the Honda data, click on the filter icon that appears on the top left of the column's first
cell. Choose Select All to clear all the options. Select Honda. Click the OK button.
528
Data Analysis
4. To copy columns to a different sheet, hold down the CTRL key and select the Make, Power and Engine
Displacement columns. Next, right-click and select the Copy Columns to... in the context menu.
5. In the colcopy dialog, select Auto in the Recalculate drop-down list. Make sure the Destination
Columns is set to a new worksheet in the same workbook (see Tip, below). A new sheet with the copied
columns will be created.
6. Click and drag the sheet tab of the copied worksheet to blank Origin workspace. This will create a new
workbook to hold the copied data so the copied data and original data can now be compared side by side.
7. Click on the green Recalculate lock icon on the top left of the first cells' in the columns of this copied
sheet. Select Worksheet Filters: Lock in the context menu. The filter conditions will be saved into the
529
Tutorials for Origin
operation.
8. In the source worksheet, add Data Filter to Power column, and click on the filter icon to select Greater
Than.... In the Simple Number Filter dialog, set Value to 100, and click OK. The filter will show only
the Power data above 100 in the original workbook but since the filter was locked in the copied workbook
the data in it will no longer update.
9. The filter conditions on the original workbook were changed and in order to set them back to the way they
are in the copied workbook, use Push Back. In the copied sheet, click on the green lock in column(A) and
select Worksheet Filters: Push Back from the context menu. This will result in the data filter condition
in the original workbook being pushed back so that the filter condition set on Power no longer applies.
The lock filters options are only available in the new sheet created by column copy. If
you copy columns to the same worksheet, the options will not show in the Recalculate
lock icon's context menu.
530
Data Analysis
4.6.4.1 Summary
The Pivot Table provides a quick way to summarize your data, and to analyze, compare, and detect
relationships in your data. This tool can sort, count, sum, or compute minimum, maximum, or mean of data
stored in a worksheet.
How to combine small values in columns or rows, and custom extra value.
1. Before creating a pivot table, we should can import data from database. Suppose we have already set up
a database named AdventureWorks2008R2 on a server machine - myServer - running SQL Server, with
user name as "accounting", and password as "mydatabase".
2. To connect the database, we use a connection string:
3. Activate an empty worksheet and open SQL Editor by clicking the Open SQL Editor button on the
Database Access toolbar.
4. Select menu item Edit Connection String... from SQL Editor's File menu, in the open dialog, put the
connection string (see step 1 above) to the text box. And then you can click the Test button to test if
the connection is fine. If fine, click the OK button to connection to the database.
531
Tutorials for Origin
SELECT
CR.Name As CustomerCountry,
Pr.Name As ProductName,
Pr.Color As ProductColor,
PC.Name As ProductCategory,
PS.Name As ProductSubcategory,
SOH.OrderDate As OrderDate,
SOD.OrderQty As OrderAmount,
SOD.LineTotal As TotalCost
FROM Person.CountryRegion AS CR
ON SP.CountryRegionCode = CR.CountryRegionCode
532
Data Analysis
ON A.StateProvinceID = SP.StateProvinceID
ON BEA.AddressID = A.AddressID
ON P.BusinessEntityID = BEA.BusinessEntityID
ON PCC.BusinessEntityID = P.BusinessEntityID
ON SOH.CreditCardID = PCC.CreditCardID
ON SOD.SalesOrderID = SOH.SalesOrderID
ON Pr.ProductID = SOD.ProductID
ON PS.ProductSubcategoryID = Pr.ProductSubcategoryID
ON PC.ProductCategoryID = PS.ProductCategoryID
7. Select menu File: Save to Active Worksheet to save these settings to the worksheet, and then select
menu Query: Import to import the data into worksheet, and then close SQL Editor. We can see the
imported data form the image below.
533
Tutorials for Origin
8.
The imported dataset is a total cost summary of three product categories(Bikes,Accessories, Clothing) in six
different countries by year. Suppose now you want to create a pivot table to see the yearly Sum of Total Cost
of different product category. Follow the steps below to create the pivot table.
1. Activate the Sheet1, select Worksheet: Pivot Table from the main menu to open the dialog. And specify
the following settings in the dialog:
o For Pivot Table Row Source, click the triangle button to add column A.
o For Pivot Table Column Source, click the triangle button to add column E.
o Select Sum with the Summarize by drop-down list. Then select column I for Pivot Table Data
Source.
o Expanding Options branch, check Total for Rows and Total for Columns check boxes, and
select Row Label Ascending from the Sort Output Rows drop-down list.
534
Data Analysis
2. Click the OK button to create the pivot table. The table should like this:
535
Tutorials for Origin
In this section, we will show you how to present those categories with the percentage of the summarized value
(Count/Sum/Mean/Min/Max) accounts for that of grand total exceeding a threshold percent, and combine small
value categories into a default Others category.
1. Based on the above example, click on the lock icon in the Pivot1 worksheet, and select Change
Parameters to open the dialog again.
3. Click OK button. The pivot table shows the summarization of data by Sum. And only Category Bikes has
the percent of grand total exceeding the threshod percent 30 %, other smaller categories has been
536
Data Analysis
In this section, we will show you how to present those categories that are missing in the source data sheet
with ' Column Source Extra Value. This is useful when you want to ensure all needed categories will be
presented in the result pivot table that might be used for later plotting.
Suppose we want to know the Sum of Total Cost of different product categories before Year 2007. Follow the
steps below to create the pivot table.
1. To filter the years before 2007, we use the data filter. Go to Sheet 1 and select Col A. Click button in
the main menu bar. Click again the filter icon on Col A and select Less Than. Customize the pop-out filter
dialog as follow, then click OK to close the dialog.
2. Click on the lock icon in the Pivot1 worksheet, and select Recalculate. As shown in the following pivot
table, only Bikes is presented here, because other two product categories do not has any cost data record
537
Tutorials for Origin
3. Back to Pivot1 worksheet, select col(b) and then click Plot > 2D: Bar: Column to plot a column
graph(Graph1).
4. Next we want to add two missing categories back into the pivot table. Click on the lock icon in the Pivot1
worksheet, and select Change Parameters. Customize the dialog as follow, click OK to close the dialog.
The pivot table would look as follow.
538
Data Analysis
5. Back to Pivot1 worksheet again. Click again the filter icon on Col A and select Clear Filter from the pop-
up menu to remove the filter. Then select all columns to plot a column graph(Graph2). The graph would
show the missing categories.
6. Back to Pivot1 worksheet again, right click the grey area and select Add Graph to add Graph2 onto the
Pivot1 worksheet
Year filtering can also be obtained in Database. In this case, you can customize
the favorable time period by rewriting this script:
539
Tutorials for Origin
In this section we will show you how to create analysis template for the pivot table, reimport data from
database and reuse the analysis template to create pivot table for new data.
1. Activate the Book1, click File: Save Workbook as template and save it as SumTotalCost.ogw.
2. Open a new OPJ file and then click File: Open to open SumTotalCost.ogw.
3. To change the data source as AdventureWorks2008 in database,
o Activate Sheet1 and open SQL Editor by clicking the Open SQL Editor button .
o Click File: Edit Connection String then type the following string in the open dialog, click Test
then click OK to connect the database.
o Back to the SQL Editor dialog, On the right panel, rewrite the last script as
o Select menu File: Save to Active Worksheet to save these settings to the worksheet, and then
select menu Query: Import to import the data into worksheet, and then close SQL Editor. We can
see the imported data form the image below.
540
Data Analysis
4. To update the pivot table, go to Sheet'Pivot1 , click the yellow lock and select Recalculate. The pivot
table would be updated according to new data.
5. To update the embedded graph,
o double click the embedded graph and a floating chart would pop up.
o Select the graph and click Rescale button to refresh . The floating chart would be updated
too.
o click the arrow button at the upper right corner of the floating chart to put it back to the
worksheet. The worksheet would look as follow.
541
Tutorials for Origin
4.6.5.1 Summary
Categorical values are used to store categories information in a column. In Origin, you have the capacity to
manually add, remove, order categories in a column and the categorical information stored in the column will
be carried over to result sheet during analysis. You can easily save categories into a text file and share across
columns or worksheets.
1. To import the Origin sample data, select File: Import: Excel(XLS, XLSX, XLSM...) from the Origin
menu. Browse to <Origin Program Folder>\Samples\Statistics and select
HouseholdCareSamples.xls. Click the Add File(s) button. Make sure that the Show Options Dialog:
check box is selected. Click the OK button to open the impMSExcel dialog.
2. Specify the following settings in the impMSExcel dialog:
o Under File Info, expand the HouseholdCareSamples.xls branch. Unselect File Sheet(s), then
check the check boxes next to HQ Family Mart and TX Trust-Mart.
o In the Header Lines branch, select 1 in Number of Subheader Lines drop-down list and then
1 for Long Names. Check Apply Header to All Sheets box.
o Click OK to import the data into Origin.
3. On the HQ Family Mart worksheet, highlight column Category (long name) and right click to select Set
As Categorical. Double click on the Unsorted on Categories label row to bring up Categories dialog.
4. Now we want to only keep Household Clean, Kitchen Clean, Dishwashing Liquid, Laundry Powder
and Fabric Conditioner five categories and order them as listed. To do so, first check Customize
Categories (Add, Delete, Set Arbitrary Order) box, hold Ctrl key to select unwanted categorical values
542
Data Analysis
5. Drag the row headings or use the , , and buttons to reorder, as shown below:
543
Tutorials for Origin
6. Then click Save > button and select Save As to bring up Categories Save as dialog. Enter
HouseholdCare Category as Name and click OK to save the categorical values in a text file under
displayed Save Path for sharing later.
12. Right click on the page and select Fit Page To Layers... and click OK in the appeared dialog to bring the
X axis label into page. Delete the legend, use Text tool to add HQ Family Mart as graph title. Move X axis
544
Data Analysis
title and added graph title to proper positions, and the column plot looks like the following:
1. Continue from the section above, now we want to share the categories saved earlier with second
worksheet TX Trust-Mart. To do so, activate TX Trust-Mart sheet and highlight column Category (long
name) and right click to select Set As Categorical.
2. Double click on the Unsorted on Categories label row to bring up Categories dialog, check Customize
Categories (Add, Delete, Set Arbitrary Order) box and click Load > button on the right and select
545
Tutorials for Origin
546
Data Analysis
3. Follow steps 7-12 in above section and add text TX Trust-Mart instead of HQ Family Mart in step 12, we
will obtain a column plot from TX Trust Mart source sheet as following:
4.7.2.1 Summary
Routine tasks can be simplified by creating an Analysis Template. Such templates can contain multiple analysis
results and also custom report sheets. A new instance of the template can then be opened at any time and
source data can be changed to update all analysis results and custom reports.
547
Tutorials for Origin
4.7.2.3 Steps
2. Click the Import Single ASCII button on the Standard toolbar to open the ASCII dialog box.
Browse to the <Origin EXE folder>\Samples\Curve Fitting\ folder and select the file Sensor01.dat. Make
sure that Show Options Dialog is selected and click the Open button. This will open a dialog for
specifying import settings.
3. In the impASC dialog, expand the Rename Sheets and Books node and clear the Rename Sheet with
(Partial) Filename box.
4. Click the arrow button next to Dialog Theme, and select Save to <Sheet> in the fly-out menu. This will
save your import settings to the worksheet.
5. Click OK to import the file to Sheet1.
6. Double-click on the worksheet tab and rename the sheet as Data.
1. Highlight column B and use the Analysis: Fitting: Linear Fit menu item to open the Linear Fit dialog
box.
2. Set Recalculate to Auto, accept other default settings and click OK to perform a linear fit. A hierarchical
report sheet will be added to the book, with result tables and embedded graphs.
3. Answer Yes to the attention message to go to the FitLinear1 report sheet.
4. Double-click to open the graph under the Fitted Curves Plot tree node. This graph contains the data plot
and fitted curve.
5. Click the menu item View:Show:Frame to show the graph frame.
6. Double click on the data plot to open the Plot Details dialog box. In the left panel, select FitLine to open
the Page Properties dialog box. Go to the Legends/Titles tab and clear the Indicate Active Dataset
check box, then press OK to close the dialog.
7. Select Format: Axes: Y Axis... in the main menu to open the Axis dialog box. Verify that the Type
under Major Ticks node is set to By Increment and set the Value to 5. Use Shift/Ctrl key to select both
Horizontal and Vertical icons on the left panel and change the Rescale mode to Auto for both X and Y
axes. Click Apply to apply settings and choose OK to close the dialog.
8. Manually move the legend object to a suitable position so all text is visible then delete the result table
box on the graph. The final graph should look like the image below:
548
Data Analysis
9. Put this graph back into the result sheet by clicking on the restore button at the top right of the title
bar.
1. Start a new project, then select the menu item File: Recent Books. From the fly-out menu options,
select the Analysis Template MySensorData.ogw(u) that was saved earlier.
2. Make the Data worksheet active, and click the Import Single ASCII button . Browse to the file
Sensor02.dat under the <Origin EXE Folder>\Samples\Curve Fitting\ path and import the file.
Note:You can also locate the Sensor02.dat file in your local drive, drag and drop it into this Data sheet
to import.
3. Since the Recalculate mode was set to Auto, the linear analysis will be performed automatically for the
new data.
549
Tutorials for Origin
4. Go to the FitLinear1 worksheet and under the Fitted Curves Plot node, double-click to open the graph
and view the updated results.
The Analysis Template can be used in the batch processing of similar data, see this
tutorial for details.
4.7.3.1 Summary
This tutorial will demonstrate how to add a column, set up Before Formula Script and have that script run
whenever data changes in other columns. This technique can be used to create an Analysis Template for
repeated analysis of similar data.
4.7.3.3 Steps
1. Import the data from \Samples\Statistics\automobile.dat into a newly created workbook, as below. In
this example, we will extract data, according to the Make column, into different worksheets.
2. Add an empty column to the worksheet and bring up the Set Column Values dialog of the column. In the
Before Formula Script box, enter the script below.
550
Data Analysis
// Worksheet to be extracted
range sourceWks = !;
// Clear worksheets
if (sheetNum>1)
layer -d 2;
tree tr;
551
Tutorials for Origin
StringArray sa;
sa.append(tr.FreqCount1.Data1);
// Extract data
This script will first perform a discrete frequency count on the Make column to get distinct values for
Make. It will then create a new worksheet for each brand and extract data into these sheets.
552
Data Analysis
3. Make sure the recalculate mode is set to Auto and click OK. The data will be separated into different
worksheets. Then the empty column (H) with a green lock icon indicates that this procedure can be
updated automatically.
553
Tutorials for Origin
4. There are 18 makes of cars in the source data, so 18 new worksheets were created. Now we can check
whether auto-update works.
Go to the Honda tab. Notice that there are 19 rows.
5. Switch to the first sheet. Scroll down and delete the last row.
Then auto-update will be triggered. Go to the Honda tab. You will see there are only 18 rows.
554
Data Analysis
4.7.4.1 Summary
Worksheets in Origin can be customized by merging cells and coalescing various objects such as graphs,
external images, links to variables and tables/cells in other sheets, into a custom report.
This tutorial will show you how to add a custom report to an existing analysis template. You can then import
new data, recalculate results, and export or print the custom report.
Note: This tutorial suggests that you can drag-and-drop data files onto Origin. If you do so, please do not
run Origin as administrator.
How to save a custom report as part of an Analysis Template (OGW) and re-use it with new data
4.7.4.3 Steps
Note: Please complete the previous tutorial named "Creating and Using Analysis Templates" in which an
analysis template named MySensorData.OGW is created.
1. Using the File:Open menu item, set the Files of type drop-down to Workbooks (*.ogw), then navigate
to and open the Analysis Template MySensorData.OGW. This analysis template was saved with a linear
fit analysis for column B of the first worksheet, and a customized embedded graph with the data and the
linear fit line (note that templates do not contain data, so at this point, you see no data and no results).
2. Make the Data worksheet active, and click the Import Single ASCII button to directly import the
file Sensor01.dat under <Origin EXE Folder>\Samples\Curve Fitting\ path.
Note: You can also locate the Sensor01.dat file in your local drive, drag and drop it into this Data sheet
to import.
1. Right-click on the Data worksheet and select Add to add a new worksheet. Rename this worksheet as
Custom Report.
2. Activate the Custom Report sheet and choose Format:Worksheet (or hit F4) to open the Worksheet
Properties dialog. Go to the Size tab and under the Size node, set Row Number as 20 and Column
Number as 9. Then go to the Miscellaneous tab and check the Auto Add Rows check box. Click OK to
apply these settings and close the dialog.
3. In the worksheet, click and drag on the row headers for Long Name, Unit, Comments and F(x)= to
select these four rows. Then right click and select Hide from the context menu. This hides the four rows
from the worksheet.
555
Tutorials for Origin
4. Highlight the range of the cells in the first three rows for all columns and click the Merge Cells button
located in the Styles toolbar to merge the cells. Enter the text Sensor Data Analysis Report in this
merged cell.
5. In the 5th row, merge the cells in columns G and H. Repeat for the 6th row. In row 5, column F, enter the
text File Name: In row 6, column F, enter the text File Date:.
6. Right click the merged (column G and H) cells in row 5 and choose Insert Variables from the
context menu. Make sure the dialog settings look like those in the image below and insert the
FILENAME variable into this cell.
7. Right click the merged (column G and H) cells in row 6 and choose Insert Variables from the
context menu. Insert the FILEDATE variable following the settings in the image below:
556
Data Analysis
8. Right click on the cell containing the date information and choose Format Cells from the context menu.
Change the Format drop-down to Date and click OK.
9. Go to the FitLinear1 worksheet and locate the Parameters table. Click the triangle button next to it and
choose Copy Table from the fly-out menu.
10. Go to the Custom Report sheet and select the 9th row in column E. Right click and choose Paste Link.
Clear the pasted text Sensor Output in column E by pressing the Delete key.
11. In the 13th row, merge the cells in columns G and H. Do the same in the 14th row.
12. Return to the FitLinear1 sheet and in the Statistics table, select the two data cells for Pearson's r and
Adj. R-Square. Right click and choose Copy to copy only these two cells.
13. Go to the Custom Report sheet and select the merged cell in the 13th row, then right-click and choose
Paste Link. The two merged cells are filled with corresponding values. Enter the text Pearson's r and
Adj. R-Square in the cells to the left of these pasted values.
14. In the 8th row, merge the three cells in columns F, G and H. Do the same in rows 12 and 20. Enter the
text Fit Parameters, Fit Statistics and Report Date: $(@D, D1) in rows 8, 12 and 20, respectively.
15. Right click on the merged cells in row 20 and choose Set Data Style:Rich Text from the context menu.
By enabling rich text, the string $(@D,D1) will display as the actual system date.
16. Hold the CTRL key and select all cells with numeric values, then right-click and choose Format Cells in
context menu, then choose Set Decimal Places= from the Digits drop-down menu, and enter 3 as
Decimal Number, and press OK.
557
Tutorials for Origin
17. Using buttons in the Style and Format toolbars, change cell borders, font sizes, styles and colors to
customize the report as in the image below below. You may also need to manually adjust the width of
some columns to ensure that all text is displayed.
18. Go to the FitLinear1 sheet and double-click on the graph under Fitted Curves Plot to open the
embedded graph. Right click on the graph's title bar and choose Duplicate from the context menu to
duplicate the graph window (Graph1). Double click on the axis of duplicated graph to bring up Axis dialog.
Go to Scale tab under both X Axis and Y Axis and choose Auto from the Rescale drop-down list. Then
close the original embedded graph window.
19. Return to the Custom Report worksheet, right click on the gray area of this worksheet and select Add
Graph from context menu. In the Graph Browser, select Graph1 which was created by duplicating the
embedded graph. Click OK to add this graph to this worksheet as a floating chart.
20. You can manually resize and move this floating chart using its anchor points and position it anywhere in
the worksheet.
21. Go to Format:Worksheet (or press F4) to open the Worksheet Properties dialog. In the View tab,
under the Show Grid Lines node, clear the check boxes next to Column Grid and Row Grid. On the
Format tab, make sure Apply To is set to Data, and select Show Missing as Blank to show missing
values as blank instead of displaying the "--" characters. Press OK to close this dialog.
22. Select File:Print Preview to preview the custom report. It should look similar to the image below:
558
Data Analysis
Beginning with Origin 2018b all merged cells within a selected range, including non-
contiguous blocks of merged cells, can be un-merged by clicking the Merge cells
1. Start a new project and then select the menu item File: Recent Books and from the fly-out options
select the Analysis Template SensorDataReport.ogw which was saved earlier.
2. Make the Data worksheet active, and click the Import Single ASCII button to directly import the
file Sensor02.dat under <Origin EXE Folder>\Samples\Curve Fitting\ path.
Note:You can also locate the Sensor02.dat file in your local drive, drag and drop it into this Data
sheet to import.
3. The linear fit results and the custom report are automatically generated using the newly imported data.
4.8.1 Summary
559
Tutorials for Origin
In Origin 8, analysis procedures can be controlled by Themes. Themes are actually XML files which save
settings in the analysis dialog.For example, after performing the analysis, there will now be a <Last Used>
theme for this dialog which has saved the most recently used settings. You can assign a proper name for the
theme and use it in the future.
For this tutorial, the Statistics on Columns dialog will be used to demonstrate how to create and use an
analysis theme. This analysis provides descriptive statistics about the data such as mean, standard deviation,
minimum, maximum, and more. For visualization, a histogram or box chart can also be created in the Analysis
Result Sheet.
4.8.3 Steps
560
Data Analysis
7. Click the OK button in the Statistics on Columns dialog. Results are reported to a new worksheet named
DescStatsOnCols1.
You can save a customized dialog theme as default, so it will be used every time you
open the dialog of analysis operation. To do this, choose Save as <Default> to save
the current dialog theme as the default setting of this dialog. It is also possible to
delete the default theme and roll back to system default, to do this, choose Delete
from the fly-out menu.
Once you save a theme, there are many ways to use it. For example, you can highlight column E and perform
the same statistical analyses on it.
Open the Statistics on Columns dialog from the Most Recently Used items at the bottom of the
Statistics menu. Most of the menu accessible dialogs can be opened from MRU menus.
When you open the dialog from MRU, the default theme is <Last Used>. To use the MyTheme theme,
select MyTheme from the Dialog Theme shortcut menu. The settings from that theme will then be
561
Tutorials for Origin
Another way to apply the analysis theme is to use the cascaded menu item. Once you use an analysis
dialog for the first time after installation, or save a theme for a dialog, there will be one more menu level
added. You can choose the MyTheme menu.
When selecting, Open Dialog..., the dialog will open to the <Factory Default> theme. To change the
settings of your theme, you can select your theme name from the Dialog Theme shortcut menu inside
the dialog, make changes, and resave the theme. Alternatively, to open a dialog with a saved theme
without performing the analysis, hold down the shift key while selecting the theme from the menu. This
will bring up the dialog with your theme applied so you can make changes as needed.
562
Data Analysis
Batch Processing Grouped Datasets Using Analysis Template with Multi-Data Sheets
4.9.2.1 Summary
Origin can perform batch analysis of multiple files or datasets, using a pre-saved Analysis Template or current
active workbook with analysis operations. This tutorial will focus on batch analysis of multiple datasets using
current active workbook/analysis template.
Perform analysis on one sample data and create new result sheet with the results you desired
Perform batch processing multiple datasets using current active workbook containing analysis operations
with recalculation.
4.9.2.3 Steps
1. Start with a new workbook, click the button and browse to <Origin EXE folder>\Samples\Curve
Fitting\ folder and select file Sensor01.dat to import data with default import settings.
2. Highlight col(B) to select Analysis: Fitting: Linear Fit... to open the Linear Fit dialog. Set Recalculate
to Auto, and then go to the tab Fit Control, check Fix Intercept check box and set Fix Intercept at as
0.
3. Click OK button to perform the fitting.
4. Go to the sheet FitLinear1, click the downward arrow aside the Summary branch to select Create Copy
as New Sheet. A new sheet "Summary" will be created with the fitting results. Go to this new sheet,
rename it to "Result" and delete the col(A).
4.9.2.3.2 Performing the fitting on multiple datasets with Batch Processing tool
1. With the workbook active. elect File: Batch Processing from the menu or click the Batch Processing
563
Tutorials for Origin
4. Click on the Browse button in the File List section and select all sensor data Sensor##.dat from the
<Origin EXE Folder>\Samples\Curve Fitting folder.
5. Select File Name for the Dataset Identifier.
6. Make sure the Data Sheet drop-down is set to Sensor01.
7. Make sure the Result Sheet drop-down is set to Summary.
8. Click OK. All sensor data will be analyzed, and a workbook "Summary" will be generated, displaying the
summarized analysis results based on the Result sheet in the original worksheet.
564
Data Analysis
4.9.3.1 Summary
Origin can perform Batch Analysis utilizing an previously created Analysis Template by either importing
multiple files, or loading existing datasets.
This tutorial focuses on the former case of batch analysis - importing multiple files with a common (ASCII) file
structure, then repeatedly applying the analysis template for the linear curve fitting to the every imported data
file.
Make an analysis template which contains a Result Summary Sheet to collect the output of batch
processing.
Perform batch processing with multiple data files using an analysis template
4.9.3.3 Steps
1. In preparation, make an Analysis Template which is an empty framework of a workbook. This workbook
template contains a Result Summary Sheet to collect the outputs of your analysis (e.g.,, linear curve
fitting) during batch processing.
2. Perform the Batch Processing using the prepared analysis template for multiple data files.
4.9.3.3.1 Preparing an Analysis Template containing a Result Summary Sheet to Collect Outputs of Batch
Processing
Before performing the batch processing, we need to make an analysis template which contains a result
worksheet (which may contain a graph in a worksheet cell as shown in this tutorial) to collect the outputs of
batch processing inside the analysis template workbook.
Note1: Hereafter, you can find the location of <Origin EXE Folder> by choosing "Help: Open Folder:
Program Folder" menu in Origin. Similarly for <User Files Folder>, choose "Help: Open Folder: User
Files Folder" menu.
Note2: If you want to skip this preparation step to make the analysis template, you can use the ready-to-use
analysis template file, <Origin EXE Folder>\Samples\Batch Processing\MySensorData.OGWU (or
.OGW in Origin 2017 or before). Also, if you only want learn how to make the analysis template regardless the
batch processing, refer to the tutorial, "Creating and Using Analysis Templates".
1. Let us import a data file as a model. In a new workbook, choose "File: Import: Single ASCII" menu
565
Tutorials for Origin
manner. Click OK, and the data file is imported to the worksheet. Double-click the Sheet1 sheet tab and
rename to the more meaningful name, "Data".
2. Now, let us perform the linear fit as a sample run. Highlight column B, and choose the Analysis:
Fitting: Linear Fit: Open Dialog menu. The Linear Fit dialog box will be opened. In the dialog, set
Recalculate to Auto (because we automatize the batch process without manual intervention), and click
OK to perform a linear fit. In the workbook, go to the FitLinear1 analysis report sheet. (In the Reminder
box, you can answer Yes.)
3. Now, let us add a Result Summary Sheet to this workbook as a collection place of the output of
batch processing. Go to the FitLinear1 sheet, and find the Summary table in it. This table contains the
important analysis results such as the slope and the intercept, and it is a good place to start constructing
the Result Summary Sheet. To do so, click the triangle button next to the table name, and choose Create
Copy As New Sheet flyout. A new sheet named Summary is created from the table.
4. Now, let us design and customize this new Summary sheet for our purpose. We let it contain the
Pearson's r statistics, and the fitted curve graph. First, click the button TWICE to add two new
columns (columns G and H). Let us add the the Pearson's r to the column G - First, go back to the
FitLinear1 sheet, right-click on Pearson's r value cell in the Statistics table, select Copy flyout. Next, go
to the Summary sheet, right-click on the first data cell of column G, and choose Paste Link to paste the
link of the r value. For the caption of this statistics, go to the FitLinear1 sheet, in the Statistics table,
click on the caption text Pearson's r, and right-click and choose Copy. Then, switch to Summary, right-
click the cell in column G, Parameters row, and select Paste Link flyout to paste the parameter label.
5. In the similar way, let's add the fitted plot graph to the column H. First, go back to the FitLinear1
sheet, right-click the fitting result graph under the Fitted Curves Plot branch, right-click on the graph to
select Copy context menu. Next, switch to the Summary sheet, right-click on the first data cell of column
H, select Paste Link flyout to paste the graph as a link. Give the long name of column H Fitted Curve.
6. Finally, let us save this workbook as an Analysis Template for batch processing. Choose
File:Save Workbook As Analysis Template menu, navigate to your <User Files Folder>, and enter
Sensor Analysis for the analysis template name. Click Save. You can close Origin - because you have
already save the Analysis template, it is not necessary to save this project unless you just want to keep it
as a practice record.
Once you have made an Analysis Template including a Result Summary Sheet, it is quite easy to perform a
batch processing to get the summarized Output from many source data files.
1. In a new project, choose "File: Batch Processing..." menu (or, click button). "Batch Processing"
dialog appears.
2. At the Batch Processing Mode, select the Load Analysis Template so that we can use the analysis
template we already have made.
3. At the "Analysis Template", select the Sensor Analysis.OGWU (or .OGW in older versions) file in
<User Files Folder> which we have saved in the previous section. (You can click "..." button to locate
your analysis template.) Similarly, at the Data Source, select Import From Files from the drop-down as
we want to import multiple files.
566
Data Analysis
4. At the "File List", Click on the "..." button, and select ALL source files Sensor##.dat (## is the
sequence number of the file) from the <Origin EXE Folder>\Samples\Curve Fitting folder (use SHIFT
or CTRL key to select multiple files).
5. At the Dataset Identifier, select File Name so that the file name of every imported file will appear in
the Result Summery Sheet as the data source.
6. At the Data Sheet drop-down, select Data to specify the receiving worksheet of import in the Result
Summary Sheet.
Similarly, at the Result Sheet drop-down, select Summary to specify the output destination of the
Result Summary Sheet.
7. The "Delete Intermediate Workbook" check box may be either checked not to produce a large number
of intermediate workbooks/worksheets, or unchecked to preserve all intermediate outputs in addition to
the Result Summary Sheet. (Note: In Origin 2018, even if you check this check box, you don't have to
be worried about loosing the intermediate reports because "Open Book(s)" button in the Result
Summary sheet can regenerate individual full report later.)
8. Click OK. All seven data files will be processed as indicated by the progress bar. A Summary
workbook is generated, which contains summarized analysis results from the seven Result sheets in
the analysis template. Put your mouse cursor on any graph cell, the fitted result graph will pop up to
let you see the details. In Origin 2018, or later, if you want to extract full analysis reporst or their
individual graphs, highlight the desired rows, and press the "Open Book(s)" button.
567
Tutorials for Origin
4.9.4.1 Summary
This tutorial is associated with the Sample Origin Project: \\Samples\Batch Processing\Summary Report
in External Excel File.opj
How to send results to an external Excel file and save that file
4.9.4.3 Steps
2. Select File : Batch Processing... from the menu or click the Batch Processing button on the
Standard Toolbar.
3. Select the Repeatedly Import into Active Analysis Template Window radio.
4. Set Data Source as Import From Files.
5. Check the Use Import Setting in Workbook check box.
6. Click the ... browse button next to File List.
7. Select All Files (*.*) in Files of Type and browse to Origin's \Samples\Batch Processing folder.
8. Select all 10 .csv files in the folder, click Add File(s) then click OK.
568
Data Analysis
4.9.5.1 Summary
Origin can perform batch analysis of multiple files and output cell-linked analysis results to an external Word
template for reporting.
Link analysis results to bookmarked cells in Word template and adjust the sizes of graphs to be exported
Perform batch analysis of multiple files and export results to Word/PDF files
4.9.5.3 Steps
In this tutorial we will use a built-in Word template Sensor Analysis Report.dotx which is located at <Origin
EXE folder>\Samples\Batch Processing\ folder. To view the bookmark labels on the Word template, with the
file open go to File: Options to open Word Options dialog. Then select Advanced on the left panel and
scroll down to section Show document content on the right panel and check Show bookmarks checkbox
there.
569
Tutorials for Origin
570
Data Analysis
1. Start Origin. Click File: Open and browse to <Origin EXE>\Samples\Batch Processing\ folder and select
the file Sensor Analysis.ogw (NOT "Sensor Analysis.ogwu") and open it.
2. Activate worksheet Data, click the button and browse to <Origin EXE folder>\Samples\Curve Fitting\
folder and select file Sensor01.dat to import data for analysis.
3. Go to menu File: Add Word Bookmarks to Analysis Template... to open dialog. Click the browse
button to the right of the Word template box and browse to <Origin EXE folder>\Samples\Batch
Processing\ folder to select Sensor Analysis Report.dotx.
4. Click to select all bookmark entries in the Bookmarks list under Select Bookmarks and click OK to
add a Bookmarks sheet to the active analysis template.
571
Tutorials for Origin
6. Right-click the cell beside the FittedGraph cell and select Insert Graph. Click the browse button to the
right of the Graphs box to open Graph Browser dialog. Check the Show Embedded Graph box to
display a list of worksheet-embedded graphs. Click to select the FitLine graph and add it to panel on the
right. Click OK twice to insert the graph into Bookmarks worksheet. In the GraphWidth column to the
right, enter 250 (units = point size) to specify the size of the graph that will be exported to Word.
7.
572
Data Analysis
Analysis Template... to save the analysis template as Sensor Analysis Template.ogw or .ogwu .
You can follow the steps in the previous tutorial "Creating a Custom Report Sheet" to
learn how to copy and paste results as link to desired cell.
4.9.5.3.3 Sending One Time Results to Word Template to Create Word Report
Sometimes we may just want to analyze one data file and quickly create one Word report. Continue from the
example above, suppose we have all results linked to Word bookmarks as shown in Bookmarks worksheet, to
create an one time Word report for active sheet you can simply click Export to Word button on the top
left corner to create it.
You can further specify where to output the Word report in appeared Export Path dialog.
5. Click the browse button to the right of the Word template box and browse to <Origin EXE
folder>\Samples\Batch Processing\ folder to select Sensor Analysis Report.dotx.
6. Optionally you can click browse button on the right of Export Path to specify another path for export.
573
Tutorials for Origin
7. Click on the browse button to the right of File List, browse to the <Origin EXE Folder>\Samples\Curve
Fitting folder and select all sensor files Sensor0#.dat.
8. Click Add File(s), then click OK.
9. Select File Name as Dataset Identifier.
10. Make sure the Data Sheet drop-down is set as Data.
11. Make sure the Result Sheet drop-down is set as Result.
12. Make sure that Delete Intermediate Workbook is cleared.
13. Click OK to close the dialog and process the "Sensor" data files.
14.
If you forget where to look for your exported PDF files, the location is output
to Messages Log.
574
Data Analysis
4.9.6 Batch Processing Grouped Datasets Using Analysis Template with Multi-
Data Sheets
4.9.6.1 Summary
Origin can perform batch analysis on grouped datasets using an analysis template with multiple data sheets.
575
Tutorials for Origin
The reference multi-data sheets analysis template Multi-Data Sheets Analysis.ogw that we are going to
make is located in <Origin EXE Folder>\Samples\Batch Processing folder. This analysis template will process
10 CSV files located in <Origin EXE Folder>\Samples\Batch Processing folder in group of 5. Every 5 data files
will be imported into the sequential data sheets in the analysis template and a non-linear fit will be conducted
to obtain the peak area and its standard error of each curve. Eventually we will perform linear fit to peak area
versus temperature data extracted from file name and output the results.
4.9.6.4 Steps
1. Create a new workbook. Go to menu File: Import: Comma Delimited (CSV)... to open CSV dialog.
2. Browse to <Origin EXE Folder>\Samples\Batch Processing folder and select the first five data files, make
sure Files of type: is selected as *.csv, then click Add Files(s) and OK button to open Comma
Delimited(CSV): impCSV dialog.
3. Expand Import Options: Header Lines node, select Number of Subheader Lines as 2, Long Name
as 1 and Units as 2. Click OK to finish import.
4. Highlight column 2 in sheet T275k, hold Ctrl + Y or go to menu Analysis: Fitting: Nonlinear Curve Fit
to open the NLFit dialog.
5. Select Gauss as Function in Origin Basic Functions category.
6. Click Fit button to perform the fitting. Click OK in the prompt to close it.
7. Repeat steps 4, 5, 6 for data T285k, T295K, T305K, T315K to obtain peak areas for all five peaks.
8. Right click sheet tab FitNLCurve5 and select Add to add a worksheet. Double click on the name and input
TempData as sheet name.
9. Hold Ctrl+D to open Add New Columns dialog and input 2 in the edit box to add 2 extra columns. Click
OK button to close dialog.
10. Set the Long Name of the 4 columns as Data File, Temperature, Area Value, Area Error, respectively.
11. Right click the first data cell in column Data File and select Insert Variable to open dialog. Right click the
node of workbook T315K on the right panel and check Show Sheet Level item to show sheets under it.
Then click T275K sheet on the right panel and click Label tab on the left panel. Click property Name to
highlight that row and click Insert button to insert sheet name into this cell.
12. Repeat this step for other four sheets to add the sheet name to column Data File.
576
Data Analysis
13. Next we want to extract the temperature number from sheet name in first column, to do so highlight
column Temperature and right click to select Set Column Values.... Input formula below in the edit box
to extract the middle 3 numbers from file name and click OK to close dialog and apply.
Value(mid(col(A),2,3)$)
14. Go to sheet FitNL1 and highlight the two value cells under area A section in Summary' node. Right click to
select Copy to copy the data. Then go to TempData sheet and paste link the data in the first row in
column Area Value and Area Error. Repeat this step for other four data files.
15. Set the designation of column Temperature as X, column Area Error as Y Error.
16. Highlight column Area Value and Area Error and go to menu Analysis: Fitting: Linear Fit to open dialog,
select Recalculate mode as Auto, click OK to perform linear fitting and close the dialog. Click OK in
appeared prompt to close it.
17. Right click sheet tab FitLinearCurve1 and select Add to add a new sheet and name it as Results.
18. Hold Ctrl + D to open Add New Columns dialog and input 3 in edit box to add 3 new columns.
19. Set the Long Name of the 5 columns as Intercept Value, Intercept Error, Slope Value, Slope Error and
Adj. R-Square, respectively.
20. Go to sheet FitLinear1, copy the 5 value cells under Summary node and go back to Results sheet and
click the first cell in first data row to paste as link.
21. Go to menu File: Save Workbook As Analysis Template... to save it as an analysis template and name
it as Multi-Data Sheets Analysis.
In <Origin EXE Folder>\Samples\Batch Processing folder, we have 10 CSV data files. Suppose now we want to
group the files as two groups and re-order them as: group 1 as T365K, T345K, T325K, T305K, T285K; group 2
as T355K, T335K, T315K, T295K, T275K. After we will process those two grouped files using the analysis
template we created in section above.
1. Go to menu File: Batch Processing... to open dialog, click the more options button next to Analysis
Template edit box to browse to analysis template Multi-Data Sheets Analysis.ogw.
2. Click the more options button next to File List edit box to bring up Open dialog. Firstly drag and drop
CSV files one by one to re-order them as shown below and click Add File(s) button to add the files to list.
577
Tutorials for Origin
578
Data Analysis
3. Select File Name as Dataset Identifier, Results sheet as Result Sheet and uncheck Delete
Intermediate Workbook.
4. Click OK button to start processing. And click OK button to save the Batch Processing dialog settings into
the analysis template used(only available since Origin 2018b). The results will be outputted to Summary
workbook as shown below:
579
5 Statistics
5.1 Statistics
Descriptive Statistics
Cross Tabulation
2D Binning
Distribution Fit
5.1.3 ANOVA
Three-Way ANOVA
Kaplan-Meier Estimator
Weibull Fit
Cluster Analysis
581
Tutorials for Origin
Discriminant Analysis
Descriptive Statistics
Cross Tabulation
2D Binning
Distribution Fit
5.2.2.1 Summary
Origin provides comprehensive Descriptive Statistics support including basic statistics (mean, median,
variance, etc.), frequency counts, and correlation coefficients of your data sets. In addition to strong plotting
features, Origin's statistical tools help you summarize and analyze your data.
Use the Statistics on Column dialog to calculate descriptive statistics for grouped data.
We will use the Discrete Frequency tool to quickly obtain frequency information for groups of data.
1. Open a new workbook. From the Menu Bar select File: Import: SingleASCII:
Statistics|automobile.dat.
582
Statistics
2. Highlight the first two columns in the automobile worksheet. From the Menu Bar, select Statistics:
Descriptive Statistics: Discrete Frequency. Change the Recalculate mode to Auto. To make
operation in the source data worksheet Controlling the Categorical Values section working, change the
Sort Data By to Categorical Order. Then click OK.
3. The resultant worksheet DiscretFreq1 displays data and its counts for automobile Year and Make,
respectively.
In spite of the fact that there are locks on the columns, the worksheet can be
rearranged by highlighting the desired column, going to the Menu Bar, selecting
Worksheet:Sort Worksheet, and selecting Ascending, Descending, or Custom
from there.
583
Tutorials for Origin
Basic statistical treatments can be performed on the data in individual columns using the Statistics on
Columns tool.
1. Return to the automobile worksheet. From the Menu Bar, select Statistics: Descriptive Statistics:
Statistics on Columns: Open Dialog....
2. In the Statistics on Columns dialog box, in the Input tab, expand Range 1 and click the interactive
button to the right of Data Range. Return to the worksheet, select column C and drag to column G.
Click the interactive button again to restore the dialog box. In the dialog box, after adjusting Input Data
under Range 1, click the arrow button at the top-right corner of the Group control box to select B(Y):
Make as grouping data. Change the Recalculate mode to Auto.
3. In the Output tab, under the Graph branch, check the Arrange Plots of Same Type in One Graph
box. Also, in the Plots tab, check the Box Charts check box.
584
Statistics
585
Tutorials for Origin
In order to modify any embedded box plot in report sheet, double-click to open it, then
customize the graph and click the Return button in the top right corner to restore the
modified graph back to the report sheet.
It is possible to perform further data analysis and to plot the statistical results.
For example, to obtain average attribute values (i.e. horsepower, 0-60 mph time, weight, mileage) by Vehicle
Make from 1992 to 2004, perform the following:
1. Return to the automobile - automobile.dat workbook, and open the DescStatsQuantities1 worksheet.
Highlight the D(Y2) and the E(yEr±) columns, go to the Menu Bar and select Worksheet: Unstack
Columns: Open Dialog....
2. In the wunstackcol dialog box, change the Recalculate mode to Auto, select Group Columns and click
menu button and select A2:(X) Make. Set Matching Longest Group as Extract Rule for Other
Columns Values, expand Output Settings, and from Put Grouping Info. to, select Long Name. Click
586
Statistics
OK.
4. To see the results, open worksheet UnstackCols1, highlight the worksheet, and from the Menu Bar,
select Plot>2D: Multi-Panel: Stack.
5. In the Plotting:plotstack dialog box, set Plot Type to Scatter. Click OK.
6. Now we are going to rotate the tick labels at top X axis for clarification. Double click on the top X axis tick
labels to open the Axis dialog, and set the following in Top icon. Click OK.
587
Tutorials for Origin
588
Statistics
7. The report sheet and the graph will appear as shown below:
Use a correlation coefficient to explore the relationship between columns of the automobile data. Next,
construct scatter plots with confidence ellipses to obtain graphical representations of the correlations.
1. In the automobile - automobile.dat workbook, open the automobile worksheet, and highlight the last
five columns.
2. From the Menu Bar, select Statistics: Descriptive Statistics: Correlation Coefficient: Open Dialog....
In the corrcoef dialog box, expand Correlation Types and check the Pearson box.
3. Expand Plots and check the Add Confidence Ellipse box. The Scatter Plot check box will be
automatically selected. Click OK.
589
Tutorials for Origin
4. The ScatterMatrix1 and CorrCeof1 worksheets should appear as below; demonstrating the high positive
correlation between Engine Displacement and Power, and the high negative correlation between Gas
Mileage and Engine Displacement.
1. In the following steps, we want to customized the order of values shown in the graph but not change
the source data. Right click Column B in workbook, select Set As Categorical in the context menu,
double click the Categories cell of the column, "Unsorted", to open the Categories dialog.
590
Statistics
3. You can go to the report sheet created in section above. Because Auto mode is used for recalculation,
the report sheet of Discrete Frequencies and Statistics on Columns, including the box charts, are
updated automatically with the specified order of the Categorical data.
591
Tutorials for Origin
4. The results of Unstacked Columns and the stacked graph are updated automatically as well.
592
Statistics
Note: If the operation hasn't been auto-updated, you can also manually trigger the operations by clicking
the Recalculate button in the Standard toolbar. The button will turn green after recalculation is
done
593
Tutorials for Origin
5.2.3.1 Summary
Cross tabulation is particularly useful for analyzing categorical data. In these analyses, a contingency table is
used to display the frequency distribution of two or more variables. Analyses based on the table can determine
whether there is a significant relationship between variables, and assess the strength of the relationship
between the variables.
Our data are from the Montana Economic Outlook Poll conducted in May 1992, with accompanying
demographics for 209 out of 418 poll respondents. We have data on seven variables: Age(under 35, 35-54, 55
and over),Sex(male, female),Financial Status(worse, same, or better than a year ago), etc. With the data,
we want to learn:
1. The frequency distribution of financial status in three different age groups, and whether male and female
differ in the distribution.
2. Whether there is significant relationship between "Financial status" and "Age" for male and female groups.
3. The strength of the relationship.
the Move To Top , Move Up , Move Down and Move To Bottom buttons to
reorder categories as "under 35", "35-54" and "55 and over":
594
Statistics
o Repeat the same steps for column C so that the categorical mapping is <Female, Male>
o Repeat the same steps for column G so that the categorical mapping is <Better, Same,
Worse>
To exclude missing values from analysis, we should set the columns as categorical.
Otherwise the missing values will be kept as numeric values.
1. Open the Cross Tabulation dialog by choosing the menu item Statistics: Descriptive Statistics: Cross
Tabulation.
2. Click on the Input tab. The data is in raw data mode, so select column B, G and C for Row, Column
and Layer, respectively.
595
Tutorials for Origin
3. Click on the Statistics tab, uncheck the Expected Counts, Residuals, Standardized Residuals
and Adjusted Residuals and accept all the other default settings.
4. On the Tests tab, select the Chi-Square Test check box. Expand the Measures of Association
branch, and then select the Contingency Coefficients, Phi, and Cramer's V boxes (for measuring
nominal association).
5. Click on the Output tab and select the Mosaic Plot check box. Accept the other default settings and
click OK.
596
Statistics
Go to sheet Crosstab1
We can get frequency distribution information from the Mosaic Plot and the Contingency Table. The area of
each rectangle in the Mosaic Plotis proportional to the percentage of the Y variable for each level of the X
variable, so we can visually compare the frequency distribution of "Financial status" and "Age" for female, male
and total. From the Contingency Table we can get more specific information. Combining the Mosaic Plot
with Contingency Table, we learn:
597
Tutorials for Origin
2. Compared to women, men's feeling for financial status shows another interesting pattern:
o Men show no significant difference in financial status between age groups.
o Men between 35 - 54 are a little more likely to be confident of their financial status.
598
Statistics
599
Tutorials for Origin
The Chi-Square Tests Table show test results for the independence of row and column variables. If the
Prob>ChiSq is less than 0.05, this means the row and column variables, in this case age and financial status,
are significantly related. Note the conclusions in the footnotes beneath the table. We conclude that:
In contrast, there is no evidence to show an association between men's age and their
financial status.
600
Statistics
The Measures of Association table helps in assessing the strength of the relationship between "Financial
status" and "Age". As this is a 3*3 table(three levels for Age and three levels for Financial status), we can
choose a Contingency Coefficient to compare across layers. (See the introduction page for the difference of
the three statistics). From the table we can see
Women's financial status shows a stronger association with age than is the case with men.
(0.444 v.s. 0.155)
5.2.4 2D Binning
5.2.4.1 Summary
The 2D Frequency Count/Binning operation counts the frequencies for data with two variables.A 3D bar graph
and/or an image plot of the results can be generated, giving a graphic representation of data distribution.
601
Tutorials for Origin
5.2.4.3 Steps
1. Open the Tutorial Data.opj and browse to the folder 2D Frequency Count (Binning), and activate the
3D Histogram.dat book.
2. Highlight column A and column B, select menu Statistics: Descriptive Statistics: 2D Frequency
Counts/Binning to bring up the TwoDBinning dialog.
3. Specify the following settings in the dialog box:
o Uncheck the Auto checkbox, set the Bin Size for X to 40.
o Set the Bin Size for Y to 15.
602
Statistics
o Check on Output Matrix checkbox in the end of the dialog and check on 3D Bars for Matrix
Plot.
603
Tutorials for Origin
4. Click the OK button, then you will get the following outputs:
o Worksheet
o Matrix
o 3D Histogram
604
Statistics
3.
1. Double click the 3D Histogram to go to the Plot Details dialog, go to the Colormap tab, click
the Fill button to open the Fill tab, specifies the Fill tab follows the graph below
605
Tutorials for Origin
2.
Click OK to close the Fill tab, and click OK in Plot Details to close the dialog.
3. Double click the Axis to open the Axis dialog and go to Scale tab, specifies the Scale for XYZ
axis follows the graphs below:
4.
Change the scale for X axis in X icon form 820 to 1220 with Major Ticks value 40.
606
Statistics
Change the scale for Y axis in Y icon form 127.5 to 277.5 with Major Ticks value 15.
Change the scale for Z axis in Z icon form 0 to 100 with Major Ticks value 20.
5. Change title for X, Y, Z axis in Title tab into Tensile Strength, Brinell Hardness and Number of
Tests, respectively. Click OK to apply the setting and close the dialog.
5.2.5.1 Summary
Knowing the distribution model of the data helps you to continue with the right analysis. or make estimation of
your data. The Distribution Fit tool helps users to examine the distribution of their data, and estimate
parameters for the distribution.
How to carry out distribution fit for practical data with Origin
A house builder is trying to decide how many new houses he should build in the next year based on past sales
of houses in the surrounding area. He would like to know the following:
607
Tutorials for Origin
If he is going to build 80 new houses, what is the probability that all of them will be sold?
The builder believes that he can make a profit if there is at least a 60% probability that he
will sell all of his houses. How many houses should he build?
Perform a distribution fit to sample data (houses sold in the surrounding area)
Calculate the probability using the cumulative distribution function of the selected
distribution
1. Start with a new project or a new workbook. Import the data file: \Samples\Statistics\HouseSold.dat
2. Highlight Column B, select Plot > 2D : Histogram: Histogram from Origin menu
608
Statistics
1. Return to the HouseSold worksheet and highlight the column B. From the Menu Bar, select the
Statistics: Descriptive Statistics: Distribution Fit menu
2. In the dialog that opens, in the Distributions tab, clear Normal and select the following three
distributions based on the conclusions in the Choosing Distributions section
o LogNormal
o Weibull
o Gamma
609
Tutorials for Origin
4. In the Goodness of Fit tab, check all three methods. Click OK to apply the settings and close dialog.
We can compare and select a fitting model based on the following results of distribution fit:
610
Statistics
The closer all the scatter points are to the reference line, the better the distribution is for the dataset.
From the Probability Plot, both lognormal and gamma distribution can be considered as good models
for the data.
Look at the P-values in table, if the p-value is less than 0.05, it means we reject the distribution at the
0.05 level. P-value of lognormal and gamma are larger than 0.05, then from the Goodness of Fit
Tests, we can see that both lognormal and gamma are good models for the data.
611
Tutorials for Origin
From the Probability (P-P) Plot and Goodness of Fit Tests table, we can draw a conclusion that lognormal
and gamma are both good choices. Here we choose the lognormal as an example for further analysis.
Once the best distribution model is found, we can use the CDF and INV functions to calculate these
probabilities:
If he is going to build 80 new houses, what is the probability that all of them will be sold?
How many houses should be built if he hopes to have a 60% chance of selling all of the houses?
1. To answer the first question, open the Command Window or the Script Window from the
Windows menu, and type commands as below
where 3.94262 is mu and 0.35614 is sigma, obtained from the Parameter Estimates table in the
Report Sheet.
We can conclude that if the house builder builds 80 new houses, there is an 89% probability that he will
NOT sell all of those houses.
1. To answer the second question, run the script below in the Command Window or the Script
Window
612
Statistics
We can conclude that the house builder is more likely to make a profit if he builds 47 new houses.
Notes:There are also other descriptive statistics and graphs in results of Distribution Fit which help
you to take a quick look of your data
Quantiles table
Histogram
Box Chart
5.2.6.1 Summary
The Partial Correlation Coefficient is a tool for measuring the the linear relationship between two random
variables, after excluding the effects of one or more control variables.
We have some public data from the World Bank that includes 11 indicators (health expenditure, GDP,
population, etc.) by country, for years 2000 to 2010. We want to study the relationship between internet use,
mobile phone use and health expenditures in the United States.
613
Tutorials for Origin
1. Open the Tutorial Data.opj and browse to the folder Partial Correlation Coefficient, and activate the
Partial Correlation Coefficient book.
2. Activate Sheet1 with source data. We have already applied a data filter to get data for the United States
between 2000 and 2010.
3. First we will use the Correlation Coefficient tool to visually detect the relationship between Mobile
phone subscribers, Total internet users, Health expenditures per capita and the GDP per capita.
1. Press the Ctrl key and highlight Col(E), Col(U1), Col(H) and Col(S).
2. From the menu, select Statistics: Descriptive Statistics: Correlation Coefficient.
3. In the opened dialog, select the Scatter plots and Add Confidence Ellipse check boxes
under the Plots branch. Clear the Show Significance in Result Table check box and select
the Flag Significant Correlations check box.
4. From the Pearson's correlation coefficient and the scatter matrix, we can see:
3.
It appears that there is a strong relationship between Mobile phone subscribers, Total internet
users, Health expenditures per capita and GDP per capita.
614
Statistics
Though it appears that Mobile phone subscribers, Total internet user and Health expenditure per
capita are strongly related, we know that GDP per capita also affects these three indicators. We want to
measure the real relationship of the three indicators after excluding the effect of GDP per capita.
1. Activate the sheet with source data. Press the Ctrl key and highlight Col(E), Col(U1) and Col(H).
2. Choose menu Statistics: Descriptive Statistics: Partial Correlation Coefficient.
3. In the opened dialog, the three highlighted columns are automatically selected as Variables.
4. We want to remove the effect of GDP per capita, so we choose Col(S) as Controlling Variables.
Select the Flag Significant Correlations check box.
5. Go to sheet PCorr1. It contains the partial correlation coefficients after excluding the effect of GDP per
capita. We can see:
o Only Mobile phone subscribers and Health expenditures per capita are significantly related
(The Partial Corr value is marked as red). But the real relationship is not as strong as the
Pearson'r seemed to show previously. (Partial Corr = 0.87307 v.s. Pearson's Corr = 0.99157).
615
Tutorials for Origin
o The Partial correlation coefficient for Mobile phone subscribers and Total internet users
decreased to be 0.26178. They are not significant related.
o There is no evidence to show Total internet users and Health expenditures per capita are
related (Partial Corr = 0.07615), while previously, we obtained a Pearson's r = 0.96685.
5.2.6.6 Conclusion
Why such different results? Looking at the Pearson'r value of GDP per capita between the other three
indicators, we can see GDP per capita influenced the three indicators. Even though there is no relationship
between Total internet users and Health expenditures per capita, Total internet users and Mobile
phone subscribers, the "false relationship" is still shown by the Pearson's r because of the effect of GDP per
capita. Partial Correlation Coefficients are useful for examining the true relationship between two factors by
eliminating the effects of correlated control variables. The statistic is useful for experiments where various
interrelated phenomena are to be studied.
5.3.1 Summary
Hypothesis tests are frequently used to measure the quality of sample parameters or to test whether
estimations for two samples on a given parameter are equal .
With parametric methods,assumptions are made about the underlying distribution from where the sample
populations are selected. Usually, it requires that the data are independently sampled from a normal
distribution.
How to carry out hypothesis tests for practical data with Origin
5.3.3 Steps
616
Statistics
One Sample Compare the mean with a given value One-Sample t-Test
Compare the variance with a given value One-Sample Test for Variance
Two Samples Test whether the means are equal Two-Sample t-Test
Test whether the variance are equal Two Sample Test for Variances
Paired Samples Test whether the means are equal Pair-Sample t-Test
Suppose a manufacturer produces high-quality screw nuts that must equal 21 millimeters in diameter. The
quality control department randomly drew 120 nuts from the finished products, measured the diameters for
each and stored the results in Diameters.dat file.They want to determine whether the mean diameter of the
nuts is equal to 21 or not. Historically, the distribution of the measured diameters is known to be
approximately normal, but the standard deviation of the population is unknown. Hence they may use the One-
Sample t-Test in Origin following the steps below:
5. Click the t-Test for Mean tab and set Test Mean to 21; Make sure that Alternate Hypothesis is
set to Mean <> 21 (two-sided test), check Confidence Interval(s) and set Confidence Level(s)
in % to 95.
617
Tutorials for Origin
6. Note that by default the test procedure provides descriptive statistics of the variable and the hypothesis
test results. Additionally, it is possible to produce a histogram of the data and a confidence interval for the
mean.
7. Click the OK button to finish the analysis and generate results.
618
Statistics
The Descriptive Statistics table shows the sample size, mean, standard deviation, and standard error for the
variable. The sample mean, 21.00459, is comparatively little bigger than the hypothesis mean 21, and the
standard error of the mean(SEM) is 0.00156.
From the t-Test table, the t statistic (2.9437) and the associated p-value (0.00404) provide evidence that the
average diameter of screw nuts is significantly different with 21 at the level.
The confidence interval indicates that it is 95% confident that the true mean of the variable lies within the
interval [21.0015, 21.00769].
To perform a One-Sample t-Test using summarized data, we need to change the Input Data From in Input
tab into Summarized data.
Assume we have measured 70 nuts this time, so the sample size will be 70. After a further calculation, we
have got 20.95 for the mean, and 0.218 for the standard deviation. So we enter the mean, standard deviation
619
Tutorials for Origin
Then, we set 21 as the Test Mean in t-Test for Mean tab, click OK to execute.
We get the summary table shown below, the results indicate that the population mean is NOT significantly
different from the test mean in this study.
Suppose you want to compare abrasion resistance between two kinds of tires. You randomly draw from each
type of tires respectively and group them into 8 pairs. Make sure each pair consists of two types of tires. Next,
equip the paired tires on 8 planes to run the abrasion test and measure the abrasion data to do paired-sample
t-test.
4. Click the t-Test for Mean tab and enter 0 to be Test Mean.
620
Statistics
5. Accept other settings as default and click the OK button to generate results.
From the t-Test table, the t statistic (2.83119) and the associated p-value (0.02536) indicate that the
difference between the two means is significant, that is to say, the two types of tires have different abrasion
resistance.
621
Tutorials for Origin
To perform a Pair-Sample t-Test using summarized data, we need to change the Input Data From in Input tab
into Summarized data.
Assume 16 samples has been tested this time, so the sample size will be 16. After a further calculation, we
have got 305 for the mean paired difference, and 310 for the standard deviation for the difference between
paired data points (please refer to Algorithms: Pair Sample T-Test). So we enter the mean difference, standard
deviation and sample size into the Input Box below:
Since our data yielded a p-value of 0.0013, which is less than our 0.05 a-level, we can reject the null
hypothesis.
This study indicates the difference between the two means is significant, thus, the two types of tires have
different abrasion resistance.
A physician is evaluating the effect of two kinds of soporifics. To test the effectiveness of these two medicines,
20 insomniacs patients are randomly selected. Half took medicine A and the other half took medicine B, The
extended sleeping time were recorded after each patient took the medicine. The result is saved as the
time_raw.dat file.
To determine whether the two medicine have different effect on patients, we could carry out a two-sample
independent t-test with the following steps:
622
Statistics
3. On the Input tab, select Raw for the Input Data Form; set medicineA as 1st Data Range and
medicineB as the 2nd Data Range.
4. Accept other settings as default and click the OK button to generate results.
The t-Test procedure automatically provides two tests of the mean difference. One is based on the assumption
that the variances of two samples are equal and the other is not. In this example, both tests indicate that
there is no significant evidence for a difference in cure effects between medicine A and medicine B. (p-values
are 0.0738 and 0.074, both greater than the significance level 0.05.)
623
Tutorials for Origin
To perform a Two-Sample t-Test using summarized data, we need to change the Input Data From in Input
tab into Summarized data.
Assume 50 patients has been tested this time, so the sample size will be 50. After a further calculation, we
have got 2.33 for the 1st mean, and 1.858 for the 1st standard deviation, and 1.28 for the 2nd mean, and
1.671 for the 2nd standard deviation. So we enter the mean, standard deviation and sample size into the
Input Box below.
We can also check on the Confidence Intervals (Levels in 95%) in t-Test for mean tab, to calculate the
difference between test groups. Click OK to execute.
624
Statistics
Since our data yielded a p-value of 0.0037, which is less than our 0.05 a-level, we can reject the null
hypothesis. this study indicates that the mean extended sleeping of two patients groups are not the same. In
fact, we can conclude that 1st soporific has a stronger effect on patients.
The Confidence Intervals show that we can be 95% confident that the mean time difference between two
groups is 0.3487~1.7513
Note that both equal variance and unequal variance assumptions are supported.To
determine whether the two samples have equal variances, we may select from top
menu Statistics:Hypothesis Testing:Two-Sample Test for Variance to use the
two-sample test for variance for testing
625
Tutorials for Origin
3. Select "Raw" for the Input Data Form; set column A and column B as the first and second data
range respectively.
4. Accept other settings as default and click the OK button to generate results.
According to result , P_vaule=0.77181 >0.05,therefore ,it fail to reject null hypothesis, so two population
variances are not signification difference.
626
Statistics
5.4 ANOVA
5.4.1 ANOVA
Three-Way ANOVA
5.4.2.1 Summary
Statistics has two modes of data input; indexed and raw. When a statistical analysis is performed, there is
usually no need to use an entire data set; Origin provides several methods of data selection. For example, the
interactive Regional Data Selector button can be used in the graphical selection of data, or the Column
Browser dialog can be employed to make the selection.
In this tutorial, you will learn how to use the two methods of data input so that the Analysis of Variance
(ANOVA) statistical test can be performed.
ANOVA is a parametric method for means comparison of several groups, and it is also an extension of two
independent sample t-tests. ANOVA is more powerful than multiple t-tests since it controls the chance to
commit type I error better when the number of groups is relatively large. For example, when comparing the
means among 5 groups using a t-test, ten multiples of the t-test, each with a significance level of 0.05, are
performed, resulting in an overall chance to commit type I error of 1-(1-0.05)^10=0.401. Under the same
circumstances, the chance to commit type I error in ANOVA is 0.05.
ANOVA requires normality and equal variance. If these requirements are not met, non-parametric analysis
should be used.
Do normality tests
5.4.2.3 Steps
Origin can perform ANOVA from an indexed data mode, or from a raw data mode.
When an indexed data mode is used, the data needs to be organized in a factor column and a data column.
627
Tutorials for Origin
When a raw data mode is used, the data needs to be organized with different levels in different columns.
Nitrogen content, in milligrams, has been recorded for 4 kinds of plants. We are interested to know whether
different plants have significantly different nitrogen content. As a result, we will use the index data mode in
One-Way ANOVA analysis.
1. Start with a new workbook. From the Menu Bar, click File:Import:Single ASCII..., browse to the
Samples\Statistics folder and double click on nitrogen.txt. In the Import and Export:impASC dialog
box, click the OK button.
2. Next, we perform a normality test on each group of data to determine whether it follows a normal
distribution. Highlight the first column of the workbook and from the Menu Bar, select Worksheet: Sort
Worksheet: Ascending.
3. From the Menu Bar, select Statistics: Descriptive Statistics: Normality Test: Open Dialog. In the
Normality Test dialog, in the Input tab, expand Input Data and Range 1. Press the triangle button at
the right of Data Range and select B(Y): nitrogen, then press the triangle button at the right of Group
and select A(X): plant. Click OK.
628
Statistics
4.
5. With the nitrogen worksheet active, go to the Menu Bar and open Statistics: ANOVA: One-Way
ANOVA.... In the ANOVAOneWay dialog box, in the Input tab, set Input Data to Indexed. Pressing
the triangle button at the right of Factor, select A(X): plant and pressing the triangle button at the right
of Data, select B(Y): nitrogen.
6.
7. In theMeans Comparison tab, check the Tukey check box; In the Tests for Equal Variance tab, check
the Levene check box; In Power Analysis tab, select Actual Power check box; In the Plots tab, check
the Means Plot[SE as Error] and the Means Comparison Plot check boxes. Click OK.
629
Tutorials for Origin
Result Interpretations
On the ANOVA1Way1 report sheet, you will see a Homogeneity of Variance Test node. If results are
not visible, click to expand the node. Because the p-value is greater than 0.05, the four groups are
considered to have equal variance.
The ANOVA table (Overall ANOVA) reports a p-value that is smaller than 0.05, hence at least two of the
four groups have significantly different means.
Expanding the results of "Means Comparisons" reveals further information regarding relationships between
groups.
630
Statistics
Here we see that the mean of PLANT4 differs significantly from the other three groups. Looking at the
Means Plot and Means Comparison Plot, we can see that PLANT4 has the smallest mean and is
significantly different from the other three groups.
631
Tutorials for Origin
In the "Powers" table, Actual Power=0.99976, that is, the chance of a Type II error occurring is almost
equal to zero.
1. Start with a new workbook. From the Menu Bar, click File:Import:Single ASCII..., and double click on
nitrogen_raw.txt. In the Import and Export:impASC dialog box, click OK .
2. Highlight all columns, and from the Menu Bar, click Statistics : ANOVA : One-Way ANOVA. In the
ANOVAOneWay dialog, in the Input tab, set Input Data to Raw, and click OK.
3. Repeat the examination of analysis results and you will see that we reach the same conclusions as we did
when using Indexed data mode.
632
Statistics
If the Level Name is set to Auto, it will follow the column long name of the selected
data.
5.4.3.1 Summary
One-way repeated measures ANOVA is similar to one-way ANOVA, but deals with a dependent variable
subjected to repeated measurements. In this situation, the independence assumption of general one-way
ANOVA is not tenable, since there is probably a correlation between levels of the repeated factor.
Similar to one-way ANOVA, one-way repeated measures ANOVA can be employed to test whether the means
are equal or not. These means include the mean of different measurements and the mean of different
subjects. The results will be shown in the table named Test of Within-Subjects Effect and Test of Between-
Subjects Effect respectively. Note that the repeated measures ANOVA in Origin requires balanced sample data,
that is, equal sample size at each level.
633
Tutorials for Origin
5.4.3.3 Steps
Origin can perform One-Way Repeated Measures ANOVA in both indexed and raw data mode. For One-
Way Repeated Measures ANOVA, if the indexed mode is used, data should be organized into three
columns: Factor, data, and Subject. When the Raw data mode is used, the different levels should be in
different columns.
The data contains measurements for 3 different doses on 20 subjects, and we are interested in whether
different doses on subjects have different effects. To test this, we will perform a One-Way Repeated Measures
ANOVA using the indexed data mode.
1. Click the Import Single ASCII button to import the file One Way_RM_ANOVA_indexed.dat in the
\Samples\Statistics\ANOVA folder.
2. Select Statistics: ANOVA: One-Way Repeated Measures ANOVA to open the dialog. In the Input
tab of this dialog, select Indexed from the Input Data drop-down list and set column B(dose),
C(Data), and A(Subject) as the Factor, Data, and Subject respectively.
634
Statistics
3. Go to Means Comparison tab, select the check box after Bonferroni to enable the Bonferroni test.
635
Tutorials for Origin
4. Select the Means Plot(SE as Error) and Means comparison Plot check boxes in the Plots tab.
636
Statistics
You can refer to this help file for details of interpreting results of repeated measures ANOVA.
Origin prints out MANOVA automatically alongside repeated measures to detect repeated-measures effects.
Note that the four different methods (Pillai's trace, Wilks' lambda, Hotelling's trace, and Roy's largest root)
generate identical F statistics and probabilities, P=0.06455, so the means under three levels condition are not
statistically different. Compare with the following report in repeated measures ANOVA, we can see that the
conclusion is conservative.
This table shows the results of the Mauchly's Test of Sphericity. From the test results we can see that
Sphericity holds. We are interested in the value of Prob > ChiSq, which is the significance level of the
Mauchly's Test, we can see from this example that the significance level (0.44609) is greater than 0.05.
Therefore, the assumption of Sphericity has not been violated.
From this table we are able to get the F value for the factor in addition to its associated significance level and
effect size. As our data follow the assumption of Sphericity, we can conclude that when using an ANOVA with
repeated measures with Sphericity Assumed, the means under three levels condition are statistically
different (P = 0.03908 < 0.05). In other words, dose is a significant factor.
The results presented in the previous table showed that there is an overall significant difference among the
means but we do not know where those differences came from. This table shows the results of the Bonferroni
637
Tutorials for Origin
test, which allows us to learn which specific means are different. In this case, the means of dose=10 and
dose=20 have a significant difference (P = 0.03402 < 0.05 and Sig Flag = 1).
From the two plots below, we can also easily come to the same conclusion.
5.4.4.1 Summary
638
Statistics
In some cases, we want to examine the relationship between two factors (categorical variables) and a
continuous outcome variable. The effects on the outcome of the change in one factor may depend on the level
of the other factor, so we need to consider the interactions between two factors. Two way ANOVA is an
appropriate method to analyze the main effects of and interactions between two factors.
5.4.4.3 Steps
Researchers are interested in the effects of sex and dietary group on systolic blood pressure (SBP) The
"dietary group" factor includes three groups: strict vegetarians (SV) who eat no animal products of any kind;
lacto vegetarians (LV) who eat dairy products but no other animal products; and "normal" (NOR) subjects who
eat a standard American diet. Sex and dietary group may be independent or they may interact with each
other. One approach to solve this problem is to construct a two-way ANOVA model predicting mean SBP level.
3. Also in the Input tab, select column A,B and C for Factor A,Factor B and Data, respectively. Check
the Interactions box.
639
Tutorials for Origin
5. In the Means Comparison tab, set Significance Level to 0.05, and check the box beside Tukey to
select this test as the means comparison method.
From the "Overall ANOVA" table in the Two-Way ANOVA result sheet, we can see that Dietary and Sex are
both significant factors, but the interaction between them is not significant. So we can say that the main
effects of both Dietary groups and Sex are significant, yet the effect on the outcome of the change in Dietary
doesn't depend on the level of Sex.
To further detect interaction, we can make an "Interaction Plot" using the following steps.
1. Right-click on the title of the "Interaction" table and select Create Copy as a new sheet from the
context menu.
640
Statistics
2. Go to the new sheet and right-click on column B and select Set As Categorical from the fly-out menu.
3. Select the first three cells in column D and then press the Ctrl key and select the other cells in
column D.
\l(1) Male
\l(2) Female
641
Tutorials for Origin
The data plots in the chart above suggest only a weak interaction between Sex and Dietary, so we should
recalculate the effects of the two factors without interaction.
5.4.4.3.1.4 Recalculate
1. Click on the green lock in the ANOVA2Way1 result sheet, and select Change Parameters to open
the dialog again.
2. In the Input tab in the open dialog, clear the interactions box and click the OK button.
642
Statistics
We can see that the Dietary and Sex are significant factors from the "Overall ANOVA" table. The mean of Nor
is significantly greater than that of LV and SV for factor Dietary. The mean of Male is significantly greater than
that of Female, from the "Dietary" table.
643
Tutorials for Origin
4. Also in the Input tab, set Number of levels of Factor B as 3, and type Dietary Group ,SV ,LV and
Nor for Name,Level1 Name, Level2 Name and Level3 Name in Factor A branch, respectively.
5. In the Means Comparison tab, set Significance Level to 0.05, and check the box beside Tukey to use
it as the means comparison method.
6. Click the OK button to perform Two-Way ANOVA.
5.4.5.1 Summary
For Two-Way Repeated Measures ANOVA, "Two-way" means that there are two factors in the experiment, for
example, different treatments and different conditions. "Repeated-measures" means that the same subject
received more than one treatment and/or more than one condition. Similar to two-way ANOVA, two-way
repeated measures ANOVA can be employed to test for significant differences between the factor level means
within a factor and for interactions between factors. Using a standard ANOVA in this case is not appropriate
because it fails to model the correlation between the repeated measures, and the data violates the ANOVA
644
Statistics
assumption of independence. Two-Way Repeated Measures ANOVA designs can be two repeated measures
factors, or one repeated measures factor and one non-repeated factor. If any repeated factor is present, then
the repeated measures ANOVA should be used.
In the following example, the two factors are the repeated measures factors.
5.4.5.3 Steps
Origin can perform Two Way Repeated Measures ANOVA in both indexed and raw data modes. For Two-
Way repeated measures ANOVA, if the indexed mode is used, data should be organized into four columns:
Factor A, Factor B, Data, and Subject. When the Raw data mode is used, the different factors and levels should
be in different columns.
In this example, we are interested in whether different drugs and doses have different effects on subject. We
will perform the Two-Way Repeated Measures ANOVA to determined whether the drug type and dosage
have significant effect on a subject. If there is significant difference, we will perform pairwise comparison to
determine of which level the effects are different.
1. Click the Import Single ASCII button to import the file Two-Way_RM_ANOVA_raw.dat in the
Samples\Statistics\ANOVA folder.
2. Select Statistics: ANOVA: Two-Way Repeated Measures ANOVA to open the dialog.
3. In Input tab, select Raw from the Input Data drop-down list.
4. In this example, there are two factors. Set 3 and 2 for Number of Levels in Factor A and Factor B drop-
down list to specify levels of the factor. Set Name to drug and dose respectively.
Notes: Factor A and Factor B are set as repeated measures factor by default (The Repeated check box
under Factor is checked ). If one factor is a non-repeated measures factor, just uncheck the Repeated
check box.
5. Now under the Data branch, there are three subgroups. In the drug Level1 subgroup, select column
d1d1 as the dose Level1 input data range.
6. Similarly, select d1d2, d2d1, d2d2, d3d1, and d3d2 for the next 5 input data range.
645
Tutorials for Origin
646
Statistics
8. In the Descriptive Statistics tab, select all check boxes to compute the mean, standard error, and 95%
confidence interval of all the levels of the factors as well as interactions.
9. In the Means Comparison tab, select the Bonferroni check box to enable the Bonferroni test.
You can refer to this help file for details of interpreting results of repeated measures ANOVA.
647
Tutorials for Origin
Origin uses a multivariate analysis to detect repeated-measures effects. In this example, four different
methods (Pillai's trace, Wilks' lambda, Hotelling's trace, and Roy's largest root) generate identical F statistics
and probabilities. For drugs, P_value=0.1564, so we can conclude that the effect of drugs did not reach
conventional levels of statistical significance. Similarly, we can also conclude that dose and drugs* dose are
significant.
This table shows the results of Mauchly's Test of Sphericity and evaluation of epsilon. From the column
Prob>ChiSq, we can learn that the significance level of drugs is greater than 0.05 (P_value=0.11096), and
the value of drugs*dose is smaller than 0.05. For drugs*dose, the assumption of sphericity has been
violated. Note that Greenhouse-Geisser Epilon=0.65362, which is smaller than 0.75, so we will proceed
with the test by using Greenhouse-Geisser correction.
From this table we are able to find out the F value for the factor, its associated significance level and the effect
size. For drug, the P_value is 0.6461 in the prob>F column, so drugs have no significant effect on subjects,
while dose have(P_value=0.01504). For interaction drugs*dose, we can still proceed with the test by using
the Greenhouse-Geisser correction and conclude that interaction drugs*dose have significant effect
(P_value = 0.02564).
648
Statistics
In general, Bonferroni tests are recommended to determine which specific means differed and determine
whether or not the Sphericity assumption is violated. The Bonferroni correction relies on a general probability
inequality and therefore isn't dependent on specific ANOVA assumptions. This table presents the results of the
Bonferroni test, we can conclude that the means are not significant different (P>0.05 and Sig Flag=0). Of
course, we do not need to perform pairwise comparison because drugs have no significant effect.
In this table, we can conclude that means of different dose are not significantly different (P_value = 0.06714
and Sig Flag = 0).
In this table, we can conclude that dose1 is significantly larger than dose2 within drug1, and drug1 is
significantly larger than drug2 and drug3 within dose1.
649
Tutorials for Origin
5.4.6.1 Summary
The two-way mixed-design ANOVA is also known as two way split-plot design (SPANOVA). It is ANOVA with
one repeated-measures factor and one between-groups factor.
A researcher wants to know whether a treatment can help people lose weight. 48 participants(24 male) take
part in the study. The researcher record their weights every three months during the treatment program.
Notes: Data can also be arranged in index mode for two-way mixed-design ANOVA. Refer to the sample
data, \Samples\Statistics\ANOVA\two-way rm ANOVA1_indexed.dat, for index mode of data of this tutorial.
1. Open a new project or a new workbook. Import the data file \Samples\Statistics\ANOVA\two-way rm
ANOVA1_raw.dat
2. Select Statistics: ANOVA: Two-Way Repeated Measures ANOVA... from Origin menu
3. In the opened dialog, choose the Input tab,
o Set Input Data as Raw
650
Statistics
o Expand Factor A branch, change the Name as Weight and set Number of Levels = 3. Expand
Factor B branch, change the Name as Gender and unselect Repeat check box
o In the Data branch, set column C, D and E to be Weight Level1, Weight Level2 and Weight
Level3, respectively, and set column B as Gender
o Select Interactions check box
651
Tutorials for Origin
You can refer to this interpreting results help page for details of interpreting results of repeated measures
ANOVA. .
1. From the Mauchly's Test of Sphericity table, we can see Prob>ChiSq(0.01258) < 0.05. So the
repeated measure variable, Weight, violates the Sphericity assumption. We should consider the
Greenhouse-Geisser correction ect. While the Epsilon is larger than 0.75, we will look at the Huynh
and Feldt correction in step 2 below
652
Statistics
3. We can further study how the weights change over time during the treatment. Expand the Weight
branch. From the tables we can see
o From the Descriptive Statistics table we can see that the weights are decreasing
o In the Pairwise Comparison table, the 1 in the Sig Flag column indicates the pair of group is
significant different. We can draw conclusion that the weights are significantly decreasing
4. From the Tests for Between-Subjects Effects table, we can see Gender is a significant effect, that
is, Female and Male can be significant different.
653
Tutorials for Origin
Notes: As there is no serious violation of sphericity assumption, we can ignore the Multivariate Tests
table. See more details from the interpreting results help page.
5.4.7.1 Summary
Three-way ANOVA tests for main effects, and interaction effects between all combinations of three factors, on
a dependent variable.
1. How to carry out three-way ANOVA for practical data with Origin
2. How to interpret the generated results
We have some public data from the World Bank. It includes three factors: Region(Asia/Europe/Africa, etc.),
Developing Index (Developing/Developed Country) and Year (2000/2005/2010). We want to understand how
these three factors affect the number of internet users and whether there are any significant differences
between the groups.
1. Choose menu Help: Learning Center to open Learning Center dialog. Select Analysis Sample in the left
side and then choose Statistics - ANOVA from the Samples in drop-down list in the right side.
2. Double-click on third item in the list box to open the folder Three Way ANOVA.
3. Click on worksheet Sheet1 containing the source data.
4. Click Statistics: ANOVA: Three-Way ANOVA
5. In the Input tab of the opened dialog, set Input Data as Indexed. Then expand the Input Data
branch, select column C,D, B and E for Factor A,Factor B, Factor C and Data, respectively
654
Statistics
6. In the Model tab, make sure all boxes are selected. This determines that a full factorial model will be
used for the three-way ANOVA.
8. Go to sheet ANOVA3Way1. The Overall ANOVA table includes ANOVA test results for the main
effects and the interactions. If the P Value is less than 0.05, this means the levels in the
corresponding factor are significantly different. Note the conclusions in the footnotes beneath the
table.
655
Tutorials for Origin
From the Overall ANOVA table above we can see the two-way interaction of factors Developing
Index*Year is not significant (p-value = 0.23954). The three-way interaction of factors
Region*Developing Index*Year, is not significant. (p-value = 0.88834).
In the following, we are going to further examine factors showing a significant interaction.
1. Click the green lock in the sheet ANOVA3Way1 and choose Change Parameters from the context
menu
2. In the Model tab, clear the Effect A*B and Effect A*B*C check boxes, where interactions between
factors could not detected.
656
Statistics
3. In the Means Comparison tab, select the Bonferroni check box. Bonferroni is the most commonly used
post-hoc test. It controls the overall Type I error.
4. In the Mean Plot tab, select all available check boxes. (Effect A*B and Effect A*B*C are disabled
because they are not included in the model.)
The results in the sheet ANOVA3Way1 are updated using the new calculation parameters.
657
Tutorials for Origin
From the table we can see all remaining effects are significantly different. We can use the Means
Comparisons results and Means Plots to further detect differences between each group.
5.4.7.6.2 Means Comparison and Means Plot of the Three Main Effects
Expanding the branch ANOVA: Means Comparison: Bonferroni Test, you can see the means comparison
table for each effect. It is useful, along with the Means Plot at the bottom of the result sheet, for pairwise
comparisons between members of a group.
From the result above we can see the number of internet users of developing countries is much fewer than the
developed countries.
658
Statistics
From the result above we can see the number of internet users greatly increased between 2000 and 2010.
659
Tutorials for Origin
Internet users in the Middle East are significantly fewer than Europe and the Americas.
We can compare the sample level between different groups with Mean Comparison results of the
interactions. In the following we will show how to use a data filter to quickly view the results we are interested
in.
1. In the sheet ANOVA3Way1, expand the branch ANOVA: Means Comparison: Bonferroni Test.
660
Statistics
2. Click the triangle button next to Interactions and choose Create Copy as New Sheet from the context
menu.
3. Go to the generated sheet Interactions. Now we are going to compare developing and developed
countries in different regions by applying a data filter in the results.
1. Highlight column C, click the Add/Remove Data Filter button to add a data filter to the
column.
2. Click the Filter icon on the column header, choose Custom Filter.
3. Select the Advanced check box in the bottom-right corner of the open dialog. Add following
script in the Condition box.
col(c)$==col(f)$
661
Tutorials for Origin
3.
o The internet users in the developed and developing countries are not significantly different in
Africa and Middle East.
o The internet users in the developed countries are significant higher than the developing countries
on the following four continents.
5.5.2.1 Summary
Nonparametric tests are used when you don't know whether your data are normally distributed, or when you
have confirmed that your data are not normally distributed.
662
Statistics
Nonparametric tests do not require the assumption of normality. They are commonly used in the following
situations:
Categorical/Binary/Ordinal data.
Nonparametric Parametric
Mann-Whitney test
Independent
Kolmogorov-Smirnov test Two Sample T-Test
Samples
Two
Samples
Wilcoxon signed rank Test
Kruskal-Wallis ANOVA
Independent
Mood's Median Test One Way ANOVA
Samples
Multiple
Samples
5.5.2.4 Examples
663
Tutorials for Origin
The One-Sample Wilcoxon Signed Rank test is designed to examine the population median relative to a
specified value. You may choose a one- or two-tailed test. The Wilcoxon signed rank test hypotheses are H0:
median = hypothesized median versus H1: median ≠ hypothesized median.
In this example, a quality engineer in a production shop is interested in whether median (or average) of the
weight of product is equal to 166. So select 10 product at random and measured their weight . The data
measured as following:
151.5 152.4 153.2 156.3 179.1 180.2 160.5 180.8 149.2 188.0
The engineer perform Normality Test to determine if the distribution of the data is normal distribution
1. Open a new worksheet and input the above data in col(A). Select Statistics: Descriptive Statistics:
Normality Test... to open the Normality Test dialog.
According to result,P-value=0.03814,the distribution of the data is not normal distribution at the 0.05 level.
So, perform One-Sample Wilcoxon Signed Rank test:
1. Select Statistics: Nonparametric Tests: One-sample Wilcoxon Signed Rank Test... to open the
dialog.
2. Set column A as Data Range.
664
Statistics
According to the result, it fails to reject null hypothesis at the 0.05 level and concludes that the median is
equal to 166.
Origin provides two tests for non-parametric statistics of two sample independent system: the Mann-Whitney
Test and Two Sample Kolmogorov-Smirnov Test.
This following example shows the practical use of Mann-Whitney Test. The abrasions(in mg) are measured
for two types of tires(A and B), 8 experiments were carried out for each tire type. The data is indexed and
stored in abrasion_indexed.dat file.
665
Tutorials for Origin
6. Click the OK button to generate results, which should be in the MannWhitney1 sheet
o U: The U statistic can be simply calculated from the rank of two groups. It is the number of times
a score in the 2nd group is larger than a score in the 1st group.
666
Statistics
o Z: The approximate Normal test statistic. It provides an excellent approximation as the sample
size grows.
o Exact Prob: The exact p-value, only available when Exact P Value is selected in the dialog.
However, it could be very CPU-time consuming for large sample size.
o Asymp.Prob: The asymptotic p-value calculated from the approximate Normal test statistic, Z
Correlation coefficient is used as a measure of relationship between two variables.It is possible to calculate the
correlation coefficient for non-parametric statistics.
Origin provides two non-parametric methods to measure the correlations between variables:
Kendall: Used with ordinal variables for assessing agreement among raters
The following example shows how to calculate correlation coefficient for non-parametric situations.
667
Tutorials for Origin
668
Statistics
From the value of Spearman Corr., it can be concluded that the abrasion between tire A and tire B are
strongly related.
We will compare the two medians of tire A and tire B in above example.
3. Selcet Column A as 1st Range Data and column B as 2nd range Data;
669
Tutorials for Origin
We can conclude that two medians are significantly different. Obviously, median of group A is larger than that
of group B.
In this example, the gas mileage of four car makers are measured. Several experiments are carried out for
each car makers. The results are listed in the sample data table.
30.6 30.2
28.1
To evaluate whether the gas mileage of the four car makers are equal, and which one is the most efficient,
Kruskal-Wallis ANOVA is chosen as the nonparametric test method.
1. Create a new workbook in Origin, copy the sample data and paste into it;
2. Select Statistics:Nonparametric Tests:Kruskal-Wallis ANOVA to open the kwanova dialog;
670
Statistics
4. Click the triangle button next to Input, and select All Columns in the context menu;
5. Click the OK button to generate results, the results are stored in a new worksheet KWANOVA1.
From the p-value we can conclude that gas mileage of the four car makers are significant different.
Ophthalmologists are investigating whether laser He-Ne therapy works for children. They have data from 2
groups, 6-10 Years Old and 11-16 Years Old. Each data set contains study of 5 persons' naked-eye eyesight
difference after 3 period of therapy. The results are stored in the eyesight.dat.
Due to the small sample size, non-parametric statistics would be needed in analysis, following the steps below:
3. Select Column A as Data Range, Column C as Factor Range, and Column D as Subject Range;
671
Tutorials for Origin
The p-value of is 0.0067379, which is less than 0.05. The populations are significantly different,
indicating that the therapy are effective for the age group 6-10.
In a similar way, choose column B as Data Range and the rest setting of Input are the same with Step 3
previously.
672
Statistics
Check the result, we can see that p-value of is 0.02599, less than 0.05 or 0.10. So we can also conclude
that eyesight of 11-16 years old kids is better after 3 period of therapy.
And we can see that > ,that means, laser He-Ne therapy works better on 6-10 years old kids. The
earlier children are to be involved in therapy, the more their eyesight can be improved.
Kaplan-Meier Estimator
COX Model Estimator
Weibull Fit
673
Tutorials for Origin
5.6.2.1 Summary
Survival analysis is the study of the time until a certain event, such as a death or failure in treatment. It also
called event history analysis in social science, or reliability analysis in engineering.
Survival function, S(t), can describes the survival rate at time t.And S(t)=1-F(f),where F(t) is the cumulative
distribution function of the failure times. While The hazard function h(t)(also known as the failure rate, hazard
rate, or force of mortality)is the ratio of the probability density function P(t) of F(t) to the survival function
S(t).
The Kaplan-Meier also called product-limit estimator provides an estimate of S(t) and h(t)from a sample of
failure times which may be progressively right-censored.
5.6.2.3 Steps
Scientist is looking for a better medicine for cancer resistance. After exposing some rats to a carcinogen DMBA,
they apply different medicine to different groups of rats and record their survival status for first 60 hours. In
the 1st group, 15 rats survived after being exposed, on which Medicine 1 is applied. Note that on the 30th
hours, 1 rat is dead but not for carcinoma. In the 2nd group, 15 rats survived with drug 2 applied. Note that
on the 14th hour, the 15th hour and the 25th hour, 1 rat die but not because of carcinoma. And the records of
two groups rats are sorted in the file /Samples/Statistics/SurvivedRats.dat. Note that in Status, 0 = dead
but not because of carcinoma, 1 = dead because of carcinoma, 2 = alive.
1. Click the Import Single ASCII button to import the file /Samples/ Statistics/ SurvivedRats.dat
2. Analyze the dataset using the Kaplan-Meier Estimate tool. Use the menu item Statistics: Survival
Analysis: Kaplan-Meier Estimator to open the dialog.
3. Set column A, B and C as Time Range, Censor Range and Grouping Range respectively in the Input
tab.
674
Statistics
5. In the Survival Table tab, select the Event and censor values Summary , Survival Estimates,
Quartile Estimates and Mean Estimates check boxes.
6. Select Survival ,One Minus survival and Hazard check box in the Survival Plots tab.
675
Tutorials for Origin
7. Select the Log-Rank, Breslow and Tarone-Ware check box in the Equality Test tab.
1. From the "summary of event and censored values" table, we can see that Censored=3 and Percent
Censored =0.2 for drug 1 group and Censored=9 and Percent Censored=0.6 for drug 2 group.
2. "Kaplan-Meier Survival Estimates " tables display a descriptive procedure for examining the
distribution of time-to-event variables. We also can compare the distribution by levels of a factor
676
Statistics
variable. Quartile Estimates and Means Estimates table Provides the estimates and confidence
interval of quartile and mean.
677
Tutorials for Origin
678
Statistics
3. The survival curves give a visual representation of the life tables. A plot of the Kaplan-Meier estimate
of the survival function is a series of horizontal steps of declining magnitude. In the plot, the survival
curve declines more rapidly, the survival rate is smaller.This Survival function plot shows proportion
of individuals surviving at each hour for drug 1 group and drug2 group and the survival curve of
drug1 always declines more rapidly, so we can conclude that drug 2 is one better medicine for cancer
resistance.
4. Form one minus survival function, we can get the same conclusion as Survival function plot.
679
Tutorials for Origin
5. Hazard rate is the instantaneous probability of the given event occurring at any point in time.It can be
plotted against time on the X axis, forming a graph of the hazard rate over time. And hazard function
is the equation that describe this plotted line.From the graph, we can get the hazard rate of drug1
group is greater than drug 2 group. So we can conclude that drug 2 is one better medicine for cancer
resistance.
680
Statistics
6. For overall tests of the equality of survival times across groups, Origin provides three methods:
Log rank: Tests equality of survival functions by weighting all time points the same.
Breslow: Tests equality of survival functions by weighting all time points by the number of
cases at risk at each time point.
Tarone-Ware: Tests equality of survival functions by weighting all time points by the square
root of the number of cases at risk at each time point.
Since the significance values of the tests are all smaller than 0.05, there is statistically significant
difference between two treatments(drug1 and drug2) in survival time.
5.6.3.1 Summary
The Cox Model Estimation ,also called the proportional hazard model is a classical semi-parameter method in
survival analysis. A Cox model provides an estimate of the effect on survival for variables and the hazard of
681
Tutorials for Origin
death for an individual. Using Cox regression analysis, we will obtain an equation for the hazard as a function
of several variables. A positive regression coefficient for an explanatory variable means that the hazard is
higher with higher values of that variable. while for negative regression coefficient for an explanatory variable,
the hazard is lower with higher values of that variable.
The proportional hazards assumption: Observations should be independent, and the hazard ratio should be
constant across time; that is, the proportionality of hazards from one case to another should not vary over
time.
1. Click the Import Single ASCII button to import phm_Cox.dat located in the \Samples \Statistics
subfolder.
2. Select Statistics: Survival Analysis: Cox Model Estimator to open the dialog.
3. Put the A(X):month column into Time Range. Similarly, put the B(Y):status column into Censor
Range.
4. Click the interactive data selection button and choose the Charlson and tKt_v column into the Covariate
Range edit box.
5. Select 0 as the censoring value form censoring value(s) drop-down list.
6. check Survival and Hazard box in Survival Plots group.
7. Click the OK button to perform the Cox Model Estimator analysis.
682
Statistics
1. From the "Summary of event and censored values" table, we can see that censored =112 and
percent Censored =0.8.
2. The following table displays the result of test whether the model is significant or not. Note that the
null hypothesis is . In this example, Pr > ChiSq =4E(-4) <0.05, therefore we reject
683
Tutorials for Origin
3. In the "Analysis of parameter Estimates" table, the coefficient estimate of variable charlson is 0.2876
and Pr > ChiSq =5E-4<0.05 , so and charlson is a significant variable. The Hazard
ratio can be interpreted as the predicted change in the hazard for a unit increase in the predictor. For
variable charlson , Hazard ratio=1.333, meaning that the hazard becomes 1.333 times when
charlson increments one unit. Similarly, tKt_v is a significant variable .The coefficient estimates of
4. The Survival function plot shows the proportion of individuals surviving at each hour and is a visual
display of the model-predicted. The horizontal axis shows the time to event. The vertical axis shows
the probability of survival.
5. The Hazard function plot displays the instantaneous probability of the given event occurring at any
point in time.
684
Statistics
5.6.4.1 Summary
Weibull fit is a kind of parameter method to analyze the relationship between the survival function and failure
time. After analysis, we can get parameter estimates, which can determine survival function and hazard
function of Weibull distribution .
Weibull distribution:
where , for
Survival function:
Hazard function:
where c is the shape parameter, is the scale parameter, and is the location parameter. In Origin, Weibull
fit only discusses c and , and assumes = 0.
If c > 1 the hazard increases , if c = 1 the hazard is constant(exponential model), if c < 1 the hazard
decreases.
685
Tutorials for Origin
1. Click the Import Single ASCII button to import weibull fit.dat located in the \Samples \Statistics
subfolder.
2. Select Statistics: Survival Analysis: weibull fit to open the dialog.
3. Put the A(X) column into Time Range. Similarly, put the B(Y) column into Censor Range.
4. Select 0 as the censoring value form censoring value(s) drop-down list.
5. Expand Plots branch and check Survival Plot and Hazard Plot.
686
Statistics
From the "Summary of Event and Censored Values" table , we can see that censored =19 and percent
Censored =0.2111.
From the "Analysis of parameter estimates", we can get all parameter estimates for Weibull distribution.
Intercept= =4.1959, ( is the intercept of the small extreme distribution, = ln(Weibull Scale))
Weibull Scale= =66.4153,
Weibull Shape=c=2.0204,
Scale =0.495 (scale = 1/c).
687
Tutorials for Origin
688
Statistics
Discriminant Analysis
5.7.2.1 Summary
Principal Component Analysis is useful for reducing and interpreting large multivariate data sets with
underlying linear structures, and for discovering previously unsuspected relationships.
We will start with data measuring protein consumption in twenty-five European countries for nine food groups.
Using Principal Component Analysis, we will examine the relationship between protein sources and these
European countries.
To determine the number of principal components to be retained, we should first run Principal Component
Analysis and then proceed based on its result:
1. Open a new project or a new workbook. Import the data file \samples\Statistics\Protein
Consumption in Europe.dat
2. Select the entire worksheet and then select Statistics: Multivariate Analysis: Principal Component
Analysis.
3. Accept the default settings in the open dialog box and click OK.
4. Select sheet PCA Report.
5. In the Eigenvalues of the Correlation Matrix table, we can see that the first four principal
components explain 86% of the variance and the remaining components each contribute 5% or less.
We will keep four main components.
689
Tutorials for Origin
6. A scree plot can be a useful visual aid for determining the appropriate number of principal
components. The number of components depends on the "elbow" point at which the remaining
eigenvalues are relatively small and all about the same size. This point is not very evident in the scree
plot, but we can still say the fourth point is our "elbow" point.
690
Statistics
7. Click the lock icon in the results tree and select Change Parameters in the context menu. In the
Settings tab, set Number of Components to Extract to 4. Do not close the dialog; in the next
steps, we will retrieve component diagrams.
In the Plots tab of the dialog, users can choose whether they want to create a scree plot or a component
diagram.
Scree Plot
The scree plot is a useful visual aid for determining an appropriate number of principal components.
Component Plot
Component plots show the component score of each observation or component loading of each
variable for a pair of principal components. In the Select Principal Components to Plot group, users
can specify which pair of components to plot. The component plots include:
o Loading Plot
The loading plot is a plot of the relationship between the original variables and the subspace
dimension. It is used to interpret relationships between variables.
o Score Plot
The score plot is a projection of data onto subspace. It is used to interpret relationships between
observations.
o BiPlot
691
Tutorials for Origin
The biplot shows both the loadings and the scores for two selected components in parallel.
1. In the dialog that was opened in the preceding steps, select the Plots tab. Make sure Scree Plot,
Loading Plot, and Biplot are selected.
2. The first two components are usually responsible for the bulk of the variance. This is why we are
going to plot the component plot in the space of the first two principal components. In the Select
Principal Components to Plot group, set Principal Component for X Axis to 1, and set Principal
Component for Y Axis to 2. Click OK.
1. In the Correlation Matrix, we can see that the variables are highly correlated. Many values are
greater than 0.3. Principal Component Analysis is an appropriate tool for removing the collinearity.
2. The main component variables are defined as linear combinations of the original variables. The
Extracted Eigenvectors table provides coefficients for equations.
692
Statistics
3. The Loading Plot reveals the relationships between variables in the space of the first two
components. In the loading plot, we can see that Red Meat, Eggs, Milk, and White Meat have similar
heavy loadings for principal component 1. Fish, fruit, and vegetables, however, have similar heavy
loadings for principal component 2.
693
Tutorials for Origin
4. The biplot shows both the loadings and the score for two selected components in parallel. It can reveal
the projection of an observation on the subspace with the score points. It can also find the ratio of
observations and variables in the subspace of the first two components. (Note: Double-click the graph to
open and customize.)
5. Use the Data Reader tool to open the Data Info window and examine the plot in greater detail.
We can see that Spain and Portugal's protein sources differ from those of other European countries.
Spain and Portugal rely on fruits and vegetables, while eastern European countries such as Albania,
Bulgaria, Yugoslavia, and Romania prefer cereals and nuts.
694
Statistics
To display country information in the Data Info window, as in the image above:
2. In the Rows tab, move Country from the left panel to the right. Click OK.
695
Tutorials for Origin
1. Click the lock icon in the results tree and select Change Parameters in the context
menu. In the Settings tab, set Number of Components to Extract as needed. For
example, if you want to do a PC1-PC2-PC4 loading plot, Number of Components to
Extract should be set as 4. Click OK to close the dialog.
2. The Extracted Eigenvectors table now has 4 columns. To duplicate the sheet PCA
Plot Data1, select the sheet PCA Plot Data1 tab and right click to select Duplicate.
Then rename the new sheet as sheet PCA Plot Data2.
3. Right click on the Workbook title bar and select Properties... from the context menu
to open the dialog. In the Window Properties dialig, uncheck Spreadsheet Cell
Notation box. Click OK to close the dialog.
4. Suppose you want to plot a PC1-PC2-PC4 loading plot. Activate the sheet PCA Plot
Data2, highlight Col (E) and right click to insert a column ahead of Col (E). Insert a
column ahead of Col (G). Highlight two new columns and right click to select Set as:
Z.
5. Rename the long name of Col (H1) and Col (I1) as Principal Component 4. Set the
all the Eigenvalue of Col (H1)as 0.
6. Go to sheet PCA1, copy the Coefficents of PC4 in the Extracted Eigenvectors table
and paste it into Col (I1) of sheet PCA Plot Data2.
7. Highlight Col (C) to Col (I1) and select Plot>3D: Vector: 3D Vector XYZ XYZ.
8. You can also customize the Plot by changing vector color and adding label. Double
click to enter Plot Detail dialog and then go to Original level. Select 3D Vector
tab, change Color as Blue and Width as 4; Go to Label tab and customize Label
From: Col(G), Position: Right, Size: 20 and Attach to: Arrow Head. Click OK
to close the dialog. The 3D loading plot will be created as follow.
696
Statistics
5.7.3.1 Summary
We will perform cluster analysis for the mean temperatures of US cities over a 3-year-period.
The starting point is a hierarchical cluster analysis with randomly selected data in order to find the best
method for clustering. K-means analysis, a quick cluster method, is then performed on the entire original
dataset.
1. Start with a new project or a new workbook. Import the data file \Samples\Graphing\US Mean
Temperature.dat.
2. Highlight Column D through Column O.
3. Select Statistics: Multivariate Analysis: Hierarchical Cluster Analysis.
4. Select Input tab, click the triangle button next to Variables, and then click Select Columns...
in the context menu.
697
Tutorials for Origin
5. In the lower panel of the Column Browser dialog, click the ... button. Set the data range from 1 to
100. Click OK.
698
Statistics
6. In the dialog, go to Settings tab, make sure Cluster is set to Observations, and Number of
Clusters is 1. Select Furthest Neighbor for Cluster Method and then click OK.
699
Tutorials for Origin
7. Go to the Cluster 1 sheet. Based on the resulting dendrogram, we choose to cluster data into 5
groups.
700
Statistics
8. Click the lock icon in the dendrogram or the result tree, and then click Change Parameters in the
context menu.
9. Set Number of Clusters to 5 in the Settings tab and then select the Cluster Center check box in
the Quantities tab. Click OK.
701
Tutorials for Origin
10. In the resulting dendrogram, we can clearly see how observations are clustered. (Note, you can
double-click to open and customize the dendrogram.)
702
Statistics
11. Due to the large number of observations, tick labels overlap in this dendrogram. Use the Scale In
703
Tutorials for Origin
1. Right-click on Cluster Center and select Create Copy as New Sheet in the context menu. We are
going to use the newly created Cluster Center as the Initial Cluster Centers in our k-means
cluster analysis.
2. Go back to the worksheet with the source data (US Mean Temperature), and highlight col(D) through
col(O). Select Statistics: Multivariate Analysis: K-Means Cluster Analysis.
3. Select the Specify Initial Cluster Centers check box in the Options tab. Click the interactive button
5. In the Plot tab, select Group Graph. Click the interactive button next to X Range. The dialog will
"roll up". Go back to the source worksheet US Mean Temperature, and highlight Col(B):Longtitude.
Click the button in the rolled up dialog to restore.
6. Click the triangle button next to Y Range, and then select C(Y), Latitude. Click OK.
704
Statistics
7. Activate the worksheet K-Means Plot Data1. Observe that data has been clustered into 5 groups
corresponding to the latitudes of the cities.
5.7.4.1 Summary
705
Tutorials for Origin
The Iris flower data set, or Fisher's Iris dataset, is a multivariate dataset introduced by Sir Ronald Aylmer
Fisher in 1936. This dataset is often used for illustrative purposes in many classification systems. The dataset
consists of fifty samples from each of three species of Irises (iris setosa, iris virginica, and iris versicolor). Four
characteristics, the length and width of sepal and petal, are measured in centimeters for each sample. We can
use discriminant analysis to identify the species based on these four characteristics.
We will use a random sample of 120 rows of data to create a discriminant analysis model, and then use the
remaining 30 rows to verify the accuracy of the model.
1. Open a new project or a new workbook. Import the data file \Samples\Statistics\Fisher's Iris
Data.dat
2. Highlight columns A through D. and then select Statistics: Multivariate Analysis: Discriminant
Analysis to open the Discriminant Analysis dialog, Input Data tab. Columns A ~ D are automatically
added as Training Data.
3. Click the triangle button next to Group for Training Data and select E(Y):Species in the
context menu
4. Click the Quantities tab and select the Discriminant Function Coefficients check box. Expand the
Canonical Discriminant Analysis branch and select the Canonical Coefficients check box. Accept
all other default settings and click OK
706
Statistics
The Canonical Discriminant Analysis branch is used to create the discriminant functions for the model.
1. Using the Unstandardized Canonical Coefficient table we can construct the canonical discriminant
functions.
707
Tutorials for Origin
2. The Eigenvalues table reveals the importance of the above canonical discriminant functions. The first
function can explain 99.12% of the variance, and the second can explain the remaining 0.88%.
3. The Wilk's Lambda Test table shows that the discriminant functions significantly explain the
membership of the group. We can see that both values in the Sig column are smaller than 0.05. Both
values should therefore be included in the discriminant analysis.
5.7.4.3.2 Classification
1. The Classification Summary for Training Data table can be used to evaluate the discriminant
model. From the table we can see that the classification in the groups setosa is 100% correct. For
versicolor, only two observations are mistakenly classified as virginica, and for virginica, only one is
mistakenly classified. The error rate is only 2.00%. This model is good.
708
Statistics
2. You can further switch to the Training Result1 sheet to see which observation is mistakenly
classified. In the sheet we can see the post probabilities calculated from the discriminant model and
which group the observation is assigned to.
o For the 84-th observation, we can see the post probabilities(virginica) 0.85661 is the maximum
value. i.e. the 84-th observation will be assigned to the group virginica (at 85.7% probability).
o But in source data, the 84-th observation is in group versicolor. So this observation is
mistakenly classified by the model.
Model validation can be used to ensure the stability of the discriminant analysis classifiers
Cross-validation:
In cross-validation, each training data is treated as the test data, exclude it from training data to judge
which group it should be classified as, and then verify whether the classification is correct or not.
Subset Validation:
Usually we will randomly divide the set of observations into subsets, the first of which is used for the
estimation of discriminant model (training set) and the second is for testing the reliability of the results
(test set).
709
Tutorials for Origin
We are going to sort the data in random order, and then use the first 120 rows of data as training data and the
last 30 as test data.
Notes: Origin will generate different random data each time, and different data will result in different
results.
In order to get the same results as shown in this tutorial, you could open the Tutorial Data.opj under
the Samples folder, browse in the Project Explorer and navigate to the Discriminant Analysis
(Pro Only) subfolder, then use the data from column (F) in the Fisher's Iris Data worksheet, which
is a previously generated dataset of random numbers.
3. To set the first 120 rows of columns A through D as Training Data, click the triangle button
next to Training Data, and then select Select Columns in the context menu.
710
Statistics
4. In the Column Browser dialog, click the ... button in the lower panel. Set data range from 1 to 120.
Click OK.
711
Tutorials for Origin
5. To set first 120 rows of Col(E) as Group for Training Data, click the triangle button next to Group
for Training Data and select E(Y): Species in the context menu. Then click the Group for Training Data
triangle button again, select Select Columns in the context menu, and set range from 1 to 120
with column browser. Click OK.
6. Select Predict Membership of Test Data check box. Click the Test Data interactive button .
The dialog will "roll up". Select columns A through D in the worksheet. Click the button in the rolled
up dialog to restore the dialog. Then click the triangle button to open Column Browser by
selecting Select Columns in the context menu. Click ... button in lower panel, and set range from
121 through 150.
7. Click the Settings tab and select the Cross Validation check box. Click OK.
712
Statistics
5.7.4.4.3 Cross-validation
Go to sheet Discriminant Analysis Report1. The Cross-validation Summary for Training Data
table provides prediction error rate by classifying each case while leaving it out from the model
calculations. However, this method is still more "optimistic" than subset validation.
713
Tutorials for Origin
1. The Classification Summary for Test Data provide information that how the test data are
classified.
2. On the worksheet Fisher's Iris Data, copy the last 30 rows (121 through 150) of Col(E): Species.
3. On the worksheet Test Result, add one column, Col(E), to the worksheet. Paste the copied values in the
new column.
4. Add a new column, Col(F) to the worksheet, right click on it and select Set Column Values in the
context menu. In the opened dialog, type Compare(col(A),col(E)) in the pop-up dialog and click
OK.
5. None of 30 values is 0, it means the error rate the testing data is 0. Our discriminant model is pretty
good.
Discriminant analysis assumes that prior probabilities of group membership are identifiable. If group
population size is unequal, prior probabilities may differ. We can use Proportional to group size for the
Prior Probabilities option in this case.
1. Go to sheet Discrim2, Prior row of the Error Rate table under Classification Summary for
Training Data branch indicate the prior probabilities for membership in groups. It is assumed that a
case is equally likely to be one of the three groups. Adjusting the prior probabilities according to the
group size can improve the overall classification rate.
714
Statistics
2. Click on the button and select Change Parameter from the context menu. Select Proportional to
group size for Prior Probabilities radio box. Click OK button.
3. We can see the classification error rate is 2.50%, it is better than 2.63%, error rate with equal prior
probabilities.
715
Tutorials for Origin
5.7.5.1 Summary
Partial least squares (PLS) is a method for constructing predictive models when there are many highly collinear
factors.
This tutorial will start with the spectral data of some samples to determine the amounts of three compounds
present. The data includes:
This tutorial will establish a model to predict the amount of the three compounds from v1 - v43
1. Start with a new project or a new workbook. Import the data file:
\Samples\Statistics\MixtureSpectra.dat
2. Highlight Column("v1") through Column("v43").
3. Select Statistics: Multivariate Analysis: Partial Least Squares. This opens the pls dialog box to the
Input Data tab.
4. The highlighted columns are automatically added as independent variables. Click the triangle button
next to Independent Variables, and click Select Columns... in the context menu.
5. Ensure the lower panel is expanded by clicking the button with two arrows in the bottom right of the
Column Browser dialog.
6. In the lower panel click the ... button. A Range dialog box will open. Clear the Entire Column(s)
box and set the data range from 1 to 20. Click OK, then click OK to close the Column Browser.
716
Statistics
7. Click the interactive button to the right of Dependent Variables. Return to the worksheet, select
column("comp1") and drag to column("comp3"). Click the interactive button again to restore the
dialog box.
8. Since v1 to v43 are absorbance, there is no need to standardize them. Click on the Settings tab, set
Method to SVD and clear the Scale Variables check box.
9. Select the Cross Validation check box. It helps find the optimal number of factors in the model.
717
Tutorials for Origin
10. Click the Plots tab and expand the Component Plot branch. Select the following check boxes and click
the OK button.
o Variable Importance Plot
o X Loadings Plot
o Y Loadings Plot
o X Scores Plot
o Y Scores Plot
o Diagnostics Plots
1. The Cross Validation table shows the optimum number of factors to extract. PRESS is the predicted
residual sum of squares of the model. The model with minimum Root Mean PRESS has the optimal
number of factors:
718
Statistics
2. The Diagnostics Plots are residual plots of Y and X, which can be used to judge the quality of the model.
Overall we can say that the fitted model is good because:
o Layer 1 - The Predicted values-Actual values graph indicates that the model fits well for the
first component.
o Layer 2 - In the Predicted values-Residual graph, residuals are randomly distributed around
zero. This indicates that there is no drift in the process.
o Layer 4 - The P-P plot of residual can be used to check whether the variance is normally
distributed. The result falls almost in a line, which means the variance is normally distributed.
719
Tutorials for Origin
3. A summary of importance of v1~v43 is given by the VIP plot. If the variable has small regression
coefficients and low VIP values, we can consider excluding it in the model. For example
720
Statistics
o Coefficients of v41 ~ v43 are also small in the three coefficients below:
4. However, as in step 2, it appears that the model fits well so it is also acceptable to keep these less
important variables.
1. The Variance Explained table shows the proportion of variance explained by each factor. In the
example, Factor 1 explains 71.36% variance for the X effect and 75.6% variance for the Y effect.
Factor 2 explains 23.99% variance for the X effect and 22.14% for the Y effect. The Variance
Explained Plot indicates that more attention should be paid to the first two factors as these two
explained more than 95% variance for X and Y effects.
2. The Loading Plot reveals the relationships between X and Y variables in the space of the first two factors.
o From the Y loading plot we can see that the three compounds have different loading on
Factor 1 and Factor 2.
721
Tutorials for Origin
o From the X loading plot it is apparent that v26 ~ v38 have similar heavy loadings for Factor
2, and v17, v18, v19,v23 and v24 have similar light loadings for factor 1 and factor 2.
Notes: To examine the plot in detail, you can double-click to open the graph containing the loading plot
722
Statistics
After the model is established, we can predict the amounts of the three compounds in new samples from their
spectra emission intensities at different wavelengths:
1. Click the green lock on the PLS1 sheet and select Change Parameter from the context menu.
2. In the dialog that opens, click on the Input tab and select the Predict Responses check box.
3. Click the interactive button to the right of Independent Variables for Prediction. Return to the
workbook, select the MixtureSpectra sheet. Select column("v1") to column("v43"). Click the interactive
button again to restore the dialog box.
4. Click the triangle button next to Independent Variables for Prediction, and then click Select
Columns... in the context menu.
5. In the lower panel of the Column Browser dialog, click the ... button. Deselect the Entire
Column(s) box and set the data range from 21 to 25. Click OK to close the Range dialog and
Column Browser dialog..
6. Click the OK button to apply the settings and close the dialog.
7. The PLSResults1 sheet will now contain the predicted amounts of the three compounds in the five
new samples:
723
Tutorials for Origin
5.8.1 Summary
Power and sample size analysis is useful in design of experiments. Insufficient data translates into a lack of
power to reject a false null hypothesis and collecting too much data is a waste of time and resources.
Therefore, it is essential to determine the sample size requirements prior to conducting an experiment. The
power of the experiment can be computed for a given sample size, and required sample sizes can be computed
for given power values.
This tutorial will show you how to calculate sample size or estimate power value to design experiments, using
some practical examples.
Background:
A sociologist wants to determine whether the average infant mortality rate in the United States is equal to 8.
In experiment design, the difference of rate cannot vary more than 0.5. And it is already known that the
standard deviation should be 2.1 from pilot studies.
Question:
What would the sample size be, in order to estimate the average infant mortality rate at a confidence level of
95% ( =0.05) for power values of 0.7, 0.8 and 0.9?
Steps in Origin:
1. Activate an empty worksheet, select Statistics: Power and Sample Size: (PSS) One-sample t-test;
2. In the PSS_tTest1 dialog box, choose the following settings and click OK.
724
Statistics
Origin Output:
A result sheet will be generated, listing the calculated sample size for hypothetical powers.
Result Interpretation:
According to results, when designing his experiment the sociologist should conduct a survey of 111 samples
for a power value of 0.7; 141 samples for power value of 0.8; and 188 samples for power value of 0.9.
Background:
A doctor's office participates in two local insurance plans, Healthwise and Medcare. The purpose is to compare
the mean time (in days) until reimbursement of claims for the two plans. Historical data shows that for the
Healthwise plan, the average time is 32 days and the standard deviation is 7.5 days. For the Medcare plan, the
average reimbursement time is 42 days and the standard deviation is 3.5 days.
725
Tutorials for Origin
Question:
If 10 claims from each plan were selected and the corresponding reimbursement times were recorded, what is
the power to detect the difference in mean reimbursement times between the 2 plans by 5% or more?
Steps in Origin:
*Note that this value will be used as the standard deviation later for the power calculation.
2. Sample size of 1st group and 2nd group should be 10 (20 samples total).
3. Activate an empty worksheet and select Statistics: Power and Sample Size: (PSS) Two-Sample t-
Test,
4. In the PSS_tTest2 dialog box, choose the following settings and click OK.
Origin Output:
A result sheet will be generated, showing the calculated power.
726
Statistics
Interpretation of Results:
We can conclude that the doctor's office has a 0.95054:1 (or 95%) chance of detecting a difference if it
collects 10 claims for each plan. The chance that you will fail to reject the null hypothesis and incorrectly
conclude that the two means are not different is 4.946% (1 - 0.95054).
Background:
Two machines of the same type are used to measure the depth of an amorphous silicon (a-Si) thin film. To
determine if there is a difference in the two machines measurements, an engineer plans a study to compare
the depth measurements made by the two machines.
In a previous study on depth of the a-Si thin film, the standard deviation of the difference was found to be
2µm. In addition, it is known that the difference in measurement by the two machines should not exceed
0.5µm, and the average depth measured by Machine #1 is 5000µm.
Question:
How many samples must be taken at a confidence level of 99% to obtain power values of 0.8, 0.9 and 0.95?
Steps in Origin:
From the information above, it is concluded that the mean of the 1st group is 5000 µm and the mean of the
2nd group is 5000.5 µm.
1. Activate an empty worksheet and select Statistics: Power and Sample Size: (PSS) Paired t-Test
2. In the PSS_tTestPair dialog box, set controls as in the following image and click OK.
727
Tutorials for Origin
Origin Output:
A result sheet will be generated, listing the required sample size at different power values.
Interpretation of Results:
We conclude that the engineer has an 80% chance of detecting a difference if 191 thin film samples are
measured; a 90% chance if 242 thin film samples are measured; and a 95% chance if 289 thin film samples
are measured by each machine.
Background:
Researchers are interested in whether different plants have different nitrogen contents. They planned to record
nitrogen contents in milligrams for 4 species of plants (80 observations per species). Previous research
suggests that the square root of MSE (Mean Squared Error) is 60 and the CSS (corrected sum of squares) of
the means is 400.
Question:
Is the plan feasible? (i.e. will the calculated power be acceptable?)
728
Statistics
Steps in Origin:
Origin Output:
A result sheet is generated, and the power value is calculated from the known condition.
Interpretation of Results:
It appears that the original research plan is deficient. There is only a 69% chance of detecting a difference
from each group. To get more reliable results, researchers must collect more samples per species of plant.
729
Tutorials for Origin
5.9.1 Summary
The Receiver Operating Characteristic (ROC) analysis curve is mainly used for diagnostic studies in Clinical
Chemistry, Pharmacology, and Physiology. It has been widely accepted as the standard method used for
describing and comparing the accuracy of diagnostic tests.
Please refer to the Origin help file for details on how to use the ROC curve.
5.9.3 Steps
In this example, we perform a study to determine whether serum sodium can help to diagnose Rocky Mountain
Spotted Fever (RMSF).
The data is retrieved from people with or without RMSF, the sodium level for each person is measured by 2
screening techniques. ROC curve analysis is carried out for data from both methods, used to check the
relationship between serum sodium and RMSF, and helped to judge which diagnostic method is better.
1. Click the Import Single ASCII button to import the sodium.dat file into Origin, the file is under the
\Samples\Statistics folder.
2. Select Statistics: ROC Curve... to open the ROC curve dialog.
3. Under the Input Data branch, select column B(Method1) and C(Method2) for Data, and column
A(Sickness) for State, respectively.
4. Set RMSF as Positive State Value and select the Positive v.s. Low button for Test Direction under the
Computation Control branch.
5. Accept all other default settings and click the OK button to carry out the analysis.
730
Statistics
Results Interpretation: Go to worksheet ROC Curve1, where the analysis results are listed.
From the table, we can see that the Asymptotic Prob of both methods are much smaller than 0.05, hence we
can conclude that both methods are effective.
731
Tutorials for Origin
In ROC analysis, the closer the area is to 1.0, the better the test is, while the closer the area is to 0.5, the
worse the test is. In this analysis, the area of method 1 and method 2 are 0.88862 and 0.79407, respectively.
Both these results are much larger than 0.5. However, the area of method 1 is closer to 1.0, so we can
conclude that method 1 is better than method 2.
In addition, we can examine the shape of ROC curve, which is also included in the report sheet. Since method
1 appears to have greater sensitivity then method 2, we can roughly conclude that method 1 is better than
method 2.
732
6 Graphing
6.1 Graphing
6.1.1 Plotting
Creating a Graph
Basic 2D Plotting
Basic 3D Plotting
Overview of Customization
6.1.2 Axis
6.1.4 Layers
733
Tutorials for Origin
Double Y
3Ys Y-YY
734
Graphing
6.1.9 Contour
XYZ Contour
Ternary Contour
6.1.10 Statistics
Box Plot
Q-Q Plot
Scatter Matrix
6.1.11 Polar
Polar Contour
Polar Crop
735
Tutorials for Origin
6.1.12 3D Graphs
3D Pie Chart
3D Vector
6.1.16 2D Vector
736
Graphing
6.1.18 Waterfall
2D Waterfall
3D Waterfall
6.2 Plotting
6.2.1 Plotting
Basic 2D Plotting
Basic 3D Plotting
Overview of Customization
6.2.2.1 Summary
This tutorial will show you how to create the following graph:
737
Tutorials for Origin
6.2.2.3 Steps
Open Tutorial Data.opj and browse to the folder 3D Bar with Labels.
738
Graphing
2. From the Origin menu select Plot > 3D: Surface: 3D Color Fill Surface to create a 3D plot that will
have Speed Mode turned on:
4. On the Size/Speed tab, clear Matrix data, maximum points per dimension. This turns off Speed
Mode allowing for full display of the dataset. Click Apply.
739
Tutorials for Origin
6. To flatten the plot of the US, click on the Surface tab and enable the Flat option.
7. On the Fill tab, click the Contour fill from matrix radio button to set the colors according to the matrix
information. Deselect the Fill back surface check box as well.
8. Next click the Colormap/Contours tab to set the matrix colors and click Level....
9. In the Set levels dialog that opens, select the #Major Levels radio button and set it to 2. Set the
Total # of Levels to 2 and click OK to close the dialog.
10. Click on each color level under the Fill... heading to open the Fill dialog and choose the color. Set the
three colors to Black, Gray and a customized blue with an RGB of 0, 64, 128 as shown below:
11. On the Mesh tab, clear the Enable box and click OK to close the dialog box.
740
Graphing
1. With the graph active select Graph: Plot Setup on the Origin menu. This opens the Plot Setup dialog
box.
2. In the upper-left corner set Available Data to Worksheets in Folder. This will make the data in Book2B
available for plotting on the same graph.
3. Select Book2B, set Plot Type to 3D - Bars. In the middle panel set X, Y and Z as columns A1, G1 and D,
respectively. Click Add to add the plot to the current layer:
741
Tutorials for Origin
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
4. To customize the 3-D bars, double-click on them to open the Plot Details dialog box. On the Pattern
tab, set the border color to Wine and the fill color to Red. On the Outline tab set the Width (in %) to
10. Click Apply
5. Next, select the Label tab and check the Enable box.
6. Set the Label Form as Col(B):"City" so that labels display the city name located in Col(B) of the
worksheet.
742
Graphing
7. Set the Position in Z as Top Outside with an Offset of 10 and set the Orientation in the YZ plane. Set
the other controls as shown below and click OK to close dialog.
8. At this point the labels will not show as the axes scale is too small for them to be in the graph range.
Double-click the vertical axis (Z Axis) and go to the Scale tab, set From to 0 and , To to 8000000. Click
OK to exit.
9. Double-click on the graph again and in the Plot Details dialog box, select the Graph1 option in the left
panel. On the Display tab set the Color to LT Gray. Click OK to close dialog.
10. Double-click the Z axis title and change it to Population (Million).
743
Tutorials for Origin
11. The final graph should resemble the one shown below:
12. Since this is a 3D OpenGL Graph, use the Rotate Tool button on the Tools toolbar or hold down the
R key and use the mouse, to rotate. You can also click the graph and select the button to enter
744
Graphing
rotation mode as shown below, or use the controls in the 3D Rotation toolbar:
6.2.3.1 Summary
Origin provides templates library. You can create and modify templates by your own and add to the collection.
Creating a graph in Origin is as simple as selecting the desired data and then selecting a template from a
menu or from the graphing toolbars. The Plot Setup dialog offers more flexibility in creating plots, such as
plotting data from multiple books or sheets.
Starting with Origin 2016, a more powerful "cloneable" template has been added. These templates are
designed for "smart plotting", meaning you can clone a graph with a complicated layer hierarchy or with
source data that cannot be specified by simple selection. See this tutorial on plotting from user-defined graph
templates to learn how to save and use both standard and cloneable templates.
745
Tutorials for Origin
1. Click the Import Multiple ASCII button to open the dialog for import multiple ASCII, select the files
S15-125-03.dat, S21-235-07.dat and S32-014-04.dat from \Samples\Import and Export\ and click
Add File(s) to add three files to the lower panel.
2. Make sure Show Options Dialog is checked, click the File Name column header to sort the files, click
OK.
3. In the Import and Export: impASC dialog Change Import Options: Import Mode to Start New
Sheets. Expand the (Re)Naming Worksheet and Workbook node and change settings so that
only the sheet gets renamed.
5. Make the third worksheet, S32-014-4, active. To create a three layer graph, highlight the three Y
columns, Delta Temperature, Magnetic Field, and Position, and then select Plot: 2D: Multi-Y: 3Ys Y-
YY. Note: There is no need to highlight the Time column, as Origin will automatically plot the Y
columns against the associated X column in the worksheet.
746
Graphing
1. Highlight column B and click the Line button to generate a line plot.
747
Tutorials for Origin
2. Right click on the data plot and point to the Change Y context menu, then select column C (Magnetic
Field) in the fly-out.
3. You may see a reminder message about rescaling the graph to show all data. Choose Yes and click
OK so that the updated plot will be auto-rescaled.
748
Graphing
With this context menu, you can change the X or Y data of the current plot to be
another column in current sheet. This column will be any column other than the current
X or Y data column from the same worksheet, regardless of column designation.
You are also allowed to use the Change Worksheet context menu to change the
current X and Y data to be the columns with same column index in another worksheet
of current workbook, regardless of column designation and column short name.
Note: You can also use the Layer Contents or Plot Setup dialog to change the input data.
749
Tutorials for Origin
1. Go back to the book with the three sheets of data from the above example.
2. Highlight the Delta Temperature column (Column B) from the first sheet and then select Plot: Line:
Line to create a line plot.
3. Go back to the workbook. For each of the remaining two sheets, select the Delta Temperature
column and position the cursor at the edge of the column until you see the cursor change to .
4. Then you can drag-and-drop the column into the graph page. Another curve will be added to the
current layer.
750
Graphing
5. After adding the other curves, double-click on the layer icon to open the Layer Contents dialog.
You need make sure that the Double click to open Plot Setup option doesn't been selected in the
Context menu(expanded by right-clicking on Layer icon) firstly.
751
Tutorials for Origin
6. In the Layer Contents dialog, hold Ctrl key to select the three items listed in the right panel, then click
Group button to group the three plots.
You can also use the Plot Setup dialog which can be opened by selecting Plot
Setup... from the context menu above to do the same setting,
7. Click Ok button to close the dialog. Grouping the plots allows for quick creation of presentation-ready
graphs, because each selection in the group is assigned a differentiating set of plot attributes (line color =
black, red, green; symbol shape = square, circle, triangle; etc...).
752
Graphing
8. Select Graph: Legend: Update Legend... to open the legendupdate X-Function dialog. Set the Auto
Legend Translation Mode to Custom. Enter @WS for Legend Custom Format.
9. Click OK and the legend will now contain the worksheet name for each data plot.
10.
753
Tutorials for Origin
The default plot type of the drag and drop plot is Current, which is the same
as the current active plot. However you could change the default option. To do
this, click Tools: Options and go to the Graph tab, and change the setting of
Drag and drop plot drop-down menu.
The Layer Contents dialog box is useful primarily for adding or removing data plots from the graph layer.
Starting with Origin 2016, you can switch layers without closing the dialog box, making it easier to add plots
to, or remove plots from, a multi-layer graph. To demonstrate, we will return to the 3-layer graph that we
created in the first exercise in this tutorial:
In the first exercise, we plotted data from sheet S32-014-04. In this exercise, we will swap the data from
sheet S32-014-04 with data from sheet S21-235-07.
1. Right-click on the layer 1 icon in the upper-left corner of the graph window and choose Layer Contents.
2. In the dialog box that opens, click the drop-down list in the upper-left corner and select Worksheets in
Folder.
3. Right-click on the left-panel headings, clear Book Name and select Sheet (if not already displaying)
so that you can see which worksheets contain which workbook datasets, then click on the Sheet
heading to sort datasets by sheet name.
754
Graphing
4. In the right-hand panel of Layer Contents, select Delta Temperature from sheet S32-014-04 and
click the Remove Plot button to remove the plot from graph layer 1.
5. In the left-hand panel, select Delta Temperature from sheet S21-235-07 and click the Add Plot button
, then click Apply to add the new plot to layer 1. You have now swapped one dataset for another.
6. Click the Layer(1) button at the top of the dialog and choose Switch Layer > 2. Layer 2.
7. Repeat the process of removing the existing Magnetic Field dataset from layer 2 and replacing it with the
Magnetic Field dataset from sheet S21-235-07, then click Apply.
755
Tutorials for Origin
8. Click the Layer (2) button and choose Switch Layer > 3.Layer 3 and repeat the process of swapping
the Position dataset in sheet S32-014-04 with the Position dataset in sheet S21-235-07, then click Apply
and close the dialog box.
The Plot Setup dialog box is useful for a variety of plotting tasks, including creating graphs, modifying the plot
type, adding plots to or removing plots from the graph, grouping or ungrouping plots, and editing the plot
range.
1. Return to your workbook and ensure that no data are selected. It doesn't matter which worksheet is
active; what is important is that no columns are highlighted.
2. Select Plot: 2D: Multi-Panel: 4 Panel from the menu. When no data are selected, Origin opens the Plot
Setup dialog, allowing you to choose the data you wish to plot.
3. Expand the top panel by clicking the button. Hold down Ctrl key to highlight the three worksheets.
Alternatively, you can just click and drag your selection so that all three worksheets are highlighted.
756
Graphing
4. In the middle panel, common columns in all three sheets are displayed. In this case, all three sheets have
similar data with matching column names. Click the button at top-right of this panel to show the
available plot columns listed with similar column long name. This mode is easier because you don't have
to check the X and Y designation check boxes.
5. Open the bottom panel of the dialog, the Plot List, if it is not already visible. Layer 1 is highlighted. Select
Delta Temperature in the middle panel, and then click the Add button. Since you already selected the
three worksheets in Step 3, this will add all Delta Temperature columns from the selected worksheets to
757
Tutorials for Origin
layer 1.
6. Repeat these steps to add all Magnetic Field columns and all Position columns into Layer 2 and Layer 3,
respectively.
758
Graphing
Note that in each layer, the three data plots are automatically grouped.
7. Click the OK button to create the graph.
8. You'll note that the default legend that is created for each layer is not particularly helpful. The Origin
graph legend object is highly customizable, so before we go further, we will modify the default legend.
Right-click on any of the legend objects and select Legend: Update Legend from the shortcut menu.
759
Tutorials for Origin
9. In the dialog box that opens, do the same settings at step 8 of the section By Drag and Drop. Note that
the Legend Custom Format syntax @WS is LabTalk Substitution Notation for the name of the worksheet
containing the data for each line plot.
10. We have one extra (empty) layer on the graph page. To delete that layer, click on it once to select it then
press the Delete key on the keyboard. Take care not to delete the graph window as we will use it in the
next section of this tutorial.
In the graph above, the legend for each layer is same with each other. You can delete
two of them. Or do settings below in the Legend Update dialog, to just show one
legend for whole graph window.
760
Graphing
Once the settings are applied, you can press Ctrl + double-click on the legend text to
do further in-place edits; or you can right-click on the legend box to select
Properties... from context menu and do further advanced editing in the Text Object
dialog.
When your data includes a column of categorical data, or multiple columns characterizing some sort of nested
sub-grouping of data, just as the data below
761
Tutorials for Origin
Beginning with Origin 2017, you have introduced the Trellis Plot which has one layer but with M X N panels.
1. New a workbook. Click the button to import the file <Origin program
folder>/\Samples\Statistics\2010.dat into the active worksheet.
762
Graphing
2. Highlight col(H)~col(J) to select Plot> 2D : Trellis Plot menu. The dialog plot_group will pop up. Select
col("City") as horizontal group variable and col("Gender") as vertical group variable for the panels.
3. Click OK button to plot the graph. Double-click on the X axis to open the Axis dialog, set From and To for
horizontal axis to -10 and 90 in the Scale tab. You will get the graph as below:
763
Tutorials for Origin
4. Just as you can see, this trellis plot has only one layer but with six panels(2×3):2 rows represent the
variable "Gender", Female and Male; three columns represent the variable "City", A, B, and C.
Besides the trellis plot, you can also plot these kind of data as a grouped box/column plot.
1. Active the source worksheet above again. Highlight col("Salary") to select Plot > 2D : Grouped Box
Charts - Indexed Data menu to open the dialog plot_gdoxindexed. Select col("Gender") and col("City")
as Group Columns.
764
Graphing
3. Just as you can see, the data col("Salary") has been plotted as a grouped box charts: Two groups by
"Gender", Female and Male; within these two groups, three subgroups by "City" , A, B, and C.
Origin offers a plotting option, Multiple Panels by Label, that allows you to create a multilayer graph, each
layer of which contains multiple plots, identified by the same label.
1. Open the file Samples\Graphing\Automobile Data.ogw (Hint: Make sure that your Open files filter is
set to Workbooks(*.ogw)).
765
Tutorials for Origin
2. Click on top left corner of the worksheet to select the entire sheet. Select Plot: 2D: Multi-Panel:
Multiple Panels by Label to open the plotbylabel dialog.
3. Set the dialog options as following, and click the OK button to create the graph.
766
Graphing
6.2.4.1 Summary
Origin's 2D plots are highly customizable. You can easily modify plot attributes, arrange layers, and select
different datasets for each layer. This tutorial will teach you the basic plotting skills.
6.2.4.3 Steps
767
Tutorials for Origin
1. Start with an empty worksheet, select File: Import: Single ASCII... to open the Import Single ASCII
dialog, browse to the \Samples\Curve Fitting subfolder of the Origin program folder, and import the file
Dose Response - No Inhibitor.dat.
2. Highlight columns 2 through 4 and select Statistics: Descriptive Statistics: Statistics on Rows. Make
sure to check the Mean and Standard Deviation check boxes on the Quantities tab to output these
results.
3. After you click the OK button, two new columns, Mean(Y) and SD(yErr) are added to the source
worksheet. Here, yErr means that this is an error column and the data in this column can be used to plot
error bars.
Note: To simplify plotting, each column in an Origin worksheet has a plotting designation. To change a
column's plotting designation, select the column and click on the Column menu. Alternatively, right-click
on the column and choose Set As from the shortcut menu.
1. Highlight the Mean(Y) and SD(yEr-) columns and select Plot: Line+Symbol: Line+Symbol to create the
plot:
768
Graphing
2. Change the X scale to Log. To do this, double-click on the X axis to bring up the Axis dialog. On the Scale
tab, change the axis Type to Log10:
769
Tutorials for Origin
770
Graphing
3. Select Graph: Rescale to Show All from the menu, which will rescale the X and Y axes of the graph. :
4. To edit the curve, double-click on any plot symbol to bring up the Plot Details dialog. Alternatively, right-
click inside the graph and choose Plot Details from the shortcut menu. On the Line tab of right panel,
select B-Spline as the connecting line type to get a smoother curve.
5. When all modifications have been made and the graph looks the way you want it, you can use this graph
to create a template, to be used in the future with similar data. Select File: Save Template as to open
the Save Template dialog. In the Category drop-down list, select UserDefined; and then type a proper
Template Name. In this example, we use MyTemplate. Click OK to save the template.
771
Tutorials for Origin
6.2.4.3.3 Plot into graph template with the Plot Setup dialog
1. Click the New Workbook button and import the file \Samples\Curve Fitting\Dose Response -
Inhibitor.dat as above. Perform Statistics on Rows, calculating the Mean and SD of this worksheet as
you did above, following the same steps.
Setup dialog, click the or button to expand/collapse them.) To finish creating the plot from your
template, please follow the steps a - e outlined on the picture below.
772
Graphing
773
Tutorials for Origin
6.2.5.1 Summary
In Origin, Contour plots and 3D plots, such as Color Map Surface plots, can be created directly from XYZ data.
But, if you want to plot a smoother 3D surface, you are strongly advised to use one of Origin's built-in gridding
routines to convert the XYZ data into a matrix.
774
Graphing
2. Highlight column C and right click. Select Set As: Z from the fly-out menu.
3. Select Plot > 3D: Surface: 3D ColorMap Surface to create a 3D Colormap Surface plot (Graph1 by
default).
4. Right click the layer icon on the left-top of the graph to open the Layer Contents dialog. In this dialog,
click on the button and select 3D Scatter/Trajectory/Vector from the fly-out menu.
775
Tutorials for Origin
5. Select column C from the left panel and click on the Add Plot button to add the 3D scatter plot to the
graph. Click OK to close the dialog.
6. Double-click on the scatter plot of Graph1 to open the Plot Details dialog. In the Symbol tab, set Shape
to Ball, Size to 12 and Color to Map: Col(C)(expand Color Chooser to do settings in the By Points sub-
tab as shown below).
776
Graphing
8. In the Colormap tab, click on the column header Fill... to open the dialog. In the Fill dialog, choose Load
Palette, click on Select Palette, and select Rainbow from the list.
9. Select Layer1 from the left panel of the Plot Details dialog. In the Lighting tab, select Directional as
Mode and do the settings under Light Color just as the image below showing. Click OK to close the dialog.
777
Tutorials for Origin
778
Graphing
Press the "S" key while hovering on a 3D openGL graph. The cursor will change modes.
Drag with your mouse or use arrow keys to change lighting source direction.
If you want to create a 3D surface that is smoother than the surface plot above(created from XYZ data), you
can firstly convert the XYZ data into a matrix using the XYZ Gridding tool. And then, use the result Matrix
data to create the 3D surface.
3. Activate the matrix, and select Plot > 3D: Surface: 3D Colormap Surface to create another 3D graph,
says Graph2.
779
Tutorials for Origin
4. Go back to Graph1, right-click on any white space in Layer frame to select Copy Format: All Style
Formats in the context menu.
5. Switch to Graph2 again, right-click on the Layer frame, select Paste Format in the context menu.
6. Select Format: Plot Properties... from main menu to open the Plot Details dialog. Go to
Colormap/Contours tab, clear Enable Contours check box:
780
Graphing
781
Tutorials for Origin
6.2.6.1 Summary
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.
782
Graphing
1. Open the Tutorial Data.opj and browse to the folder Custom Axis Scale to Show Different Scale
Range.
2. 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.
3. 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.
4. 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.
5. To save it as standard template, right click on Graph1 window title bar and select Save Template As... to
open dialog.
6. Input BlueCircle as Template Name and add some descriptions Blue solid circle in Template
Description edit box.
7. 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.
8. Make sure Mark as Cloneable Template box is unchecked, click OK button to save it as standard
template.
1. 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.
783
Tutorials for Origin
1. Press F11 key or select Help: Learning Center to open the Learning Center dialog. Select Graph
Sample in the left-side panel, and select Smart Plotting with Cloneable Template from the Samples
in drop-down list.
2. In the graph list, double-click on the 4th graph to open the Raman Spectrum subfolder.
3. 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.
784
Graphing
4. To do so, right click on graph Raman Spectrum window title bar and select Save Template As... to
open Utilities\File: template_saveas dialog.
5. 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).
6. 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.
7. Click OK button to exit the dialog and save the template.
785
Tutorials for Origin
1. Activate workbook with title Peak2, click template library button to bring up the dialog.
786
Graphing
2. Click to select the cloneable template (indicated by Dolly icon) MyPeakTemplate and click Plot
button to clone the graph.
787
Tutorials for Origin
3. Alternatively you can activate workbook Peak2 and go to menu Plot: Templates: User:
MyPeakTemplate (UserDefined) to directly clone the graph.
6.2.7.1 Summary
The Plot Setup dialog can be used to add/reorder/arrange data plots in an exiting graph. This dialog provides
flexibility in selecting the source data sheet and in specifying how data are to be plotted.
Use the Plot Setup dialog to group data plots in the layer
6.2.7.3 Steps
1. Click the New Project button on the Standard toolbar, to begin with a new project.
2. Click the Import Wizard button on the Standard toolbar. The Import Wizard opens. (Note that if this is
the first time that you have started the Import Wizard, you will experience a slight delay as Origin
compiles the necessary files.)
788
Graphing
3. Verify that the ASCII radio button is selected in the Data Type group.
4. Click the browse button to the right of the File text box. Navigate to the Origin folder; browse to the
Samples folder and then the Import and Export folder.
5. Press CTRL and select files S15-125-03.dat, S21-235-07.dat, and S32-014-04.dat, then click Add Files.
6. Click OK.
7. Leave the Import Filters for current Data Type as Data Folder: VarsFromFileNameAndHeader.
(This filter has the settings to use when importing the file.)
8. Set the Import Mode as Start New Sheets.
9. Click the Finish button. The three data files import into the workbook, each as a new sheet. You will have
a book with three sheets: Trial Run 1, Trial Run 2, and Trial Run 3.
1. Right-click on the layer 1 icon in the upper-left hand corner of the graph and choose Plot Setup.
2.
There are three panels in the Plot Setup dialog. Expand the Plot Type panel
by clicking then expand the Available Data panel by clicking the second
button.
For information on "grouping" plots, see Grouping Data Plots in the OriginLab User Guide.
The existing graph legend uses the names of the imported data plots. We will modify the legend to show the
sheet name.
789
Tutorials for Origin
For more information on customizing the default legend, see these topics:
Graph Legends
6.2.8.1 Summary
For the line/symbol plot in 2D Cartesian coordinate system, Origin supports smart labels which can be auto re-
positioned to avoid overlapping. Leader lines (both straight lines and oblique lines) can be added to connect
the data points and their labels.
790
Graphing
1. Open the Tutorial Data.opj and browse to the Smart Peak Labels with Leader Line folder in the Project
Explorer.
2. There are two sheets in A100527IR workbook. 100-52-7-IR is an IR absorbance data and Peak_Centers1
are peak center result found by Origin's Peak Analyzer tool.
3. Highlight Col(B) in sheet 100-52-7-IR to plot a line graph by selecting Plot: Line: Line menu.
4. Double click on layer 1 icon to open the Layer Contents dialog. Select col(pcy) in left panel. Click the
dropdown list next to A button in the middle and select Scatter as plot type. Click -> button to add
the data into the graph.
5. In the Plot Details dialog, select second plot in the left panel, go to Symbol tab, do following
settings:
791
Tutorials for Origin
7. Click on the Apply button, you will see the some labels are overlapped.
8. Go back to Label tab, check the Auto Reposition to Avoid Overlapping check box, select Y for the
Reposition Direction drop-down box and set the Leader Lines group as below. Also set Vertical
Offset to be 170 so the leader lines are more obvious.
792
Graphing
9. Click OK button to close the dialog. You will see the labels are repositioned smartly.
1. The highest peak's label can't be seen. Double-click on the Y axis to open the Axis dialog, go to
Vertical icon in Scale tab, change From and To to -0.05 and 0.8, then click OK to apply the setting.
793
Tutorials for Origin
2. Press CTRL key down and double click the highest peak's label 1730 to open Plot Details dialog. A node
18 shows on left panel. It's the row indexing of the special point.
The following steps can further customize the graph to be exactly the same as the image in Summary.
794
Graphing
1. Double click X axis to open Axis dialog. set From and To for X axis to be 400 and 3500.
2. To show top and right frames around the graph, select Grids tab in Axis dialog. Check Opposite check
box under the Additional Lines branch for both Horizontal and Vertical.
3. To change the layer size, select Format: Layer Properties... from main menu to open the Plot
Details dialog. On Size/Speed tab, change the layer size in the Layer Area group as below:
6.2.9.1 Summary
This graph displays three datasets with error bars. The error bars have been set to draw as lines with fill areas.
Transparency has been set for all three curves so that data in overlapping regions can be clearly seen.
795
Tutorials for Origin
6.2.9.3 Steps
1. Open Tutorial Data.opj and browse to the Error Bars with Fill Area folder in Project Explorer (PE).
2. Highlight all columns in the worksheet. In the main menu, click Plot: Line, and then click Line.
796
Graphing
3. Double-click on the plot to open the Plot Details dialog. Select the first plot node under Layer1 in the
left panel. In the right panel activate the Group tab. Choose Independent in Edit Mode.
4. On the Line tab set Width as 3. To set a custom color click on the button right to Color and select
Custom from the drop list.
797
Tutorials for Origin
Right-click on the Custom button to bring up Color dialog. Click on Define Custom Colors to expand
the right panel. For further use save the custom color in the Custom colors: palette:
798
Graphing
5. Repeat the step 3 for the other two plots. Except, set the colors of the second plot and the third plot as
RGB(192, 80, 77), RGB(79, 129, 189) respectively.
6. In the left panel, select the first of the three error plots. On the Error Bar tab, set Connect as
Straight, then the Fill Area Under Curve option will show up in Style section. Check the box before
it and the Pattern tab should now be available.
799
Tutorials for Origin
7. On the Pattern tab, change the fill color to the custom color saved before to match the line color, and
set Transparency to 50.
8. Repeat the last two steps for the other two error plots. Click OK to complete the graph.
800
Graphing
6.2.10.1 Summary
In Origin, you can mark out a segment of plot with different plot style, such as a segment of dashed in a solid
line plot.
6.2.10.3 Steps
1. Start with an empty worksheet. Select File: Import: Single ASCII... from the Origin menu to open the
Import Single ASCII dialog. Browse to the \Samples\Graphing subfolder of the Origin program folder,
and import the file AXES.DAT .
2. Click the button on the Standard toolbar to create a new graph window and then select Graph: Plot
Setup from the main menu to bring up the Plot Setup dialog.
3. Show all of the three panels of the Plot Setup dialog. Select the AXES worksheet in the top panel. Then
go to the middle panel to select A as X and B as Y. After that, click Add to add this data plot to the
801
Tutorials for Origin
bottom panel. Repeat this step three times. Three data plots should be listed in the bottom panel.
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
4. In the lower panel, click in the Range column that corresponds to the first data plot. The button should
be activated. Then click this button to open the Range dialog box.
802
Graphing
5. Clear the Auto check boxes (if they are selected) and then set From to 1 and To to 20. Click OK to close
the dialog.
6. Similarly, set the ranges for other two data plots to "20 to 30" and "30 to 40" respectively.
7. Click the OK button to close the Plot Setup dialog. You should get a graph like this:
8. Double-click on the curve in the graph window to open the Plot Details dialog. Select the second data
plot from the left panel. In the right panel, change the Style to Short Dash, and then click the Ok
803
Tutorials for Origin
button.
804
Graphing
6.2.11.1 Summary
Editing your Origin graph is very easy. Any graph element can be selected and with its associated dialog, the
properties can be modified. In fact, you can customize your graph right down to a single data point.
Resize a Layer
Customize Axes
Customize a Point
1. Open Customizing Graphs.OPJ from the \Samples\Graphing folder and select the Resize Graph and
Customize Symbol folder from the Project Explorer window.
2. Make Graph2 active and right-click inside the layer, above the data points to select Add/Modify Layer
Title from the context menu that opens. Add a title, as shown in the graph below:
3. The layer can easily be resized graphically by dragging the sizing handles. To resize it, single click inside
the layer, but not on a data point. The layer will become selected as seen below, and then you can drag
805
Tutorials for Origin
one of the 8 anchor points to resize the layer. Note: If you hold the CTRL key down while dragging, the
aspect ratio will be maintained.
4. You can also use the Plot Details dialog by specifying exact numbers to dictate the layer size more
precisely. Double-click inside the layer to open the Plot Details dialog. On the Size/Speed tab, set the
layer area to the values shown in the image below:
Note: Check the Link Axis Length to Scale with X:Y Ratio check box to set the length ratio of X and Y
axes (the Width and Height of the layer frame) to maintain the aspect ratio of the actual X and Y scales
when the layer size is changed. You can set your own ratio value in the following box.
In this section, we will show you how to change the color of a data plot, and customize the axes.
1. Click on one of the data points of Graph2 to select the entire data plot, and change the color of the data
points to red by using the Line/Border Color button in the Style toolbar.
2. Next use the Axis dialog to customize the axes. Double-click on the X-axis to open the dialog and set the
controls as follows:
806
Graphing
o Select the Horizontal icon in the Scale tab, select the Type under Major Ticks as By Counts
and input 5 as the Count.
o Select the Vertical icon in the Scale tab, set the From as 0, To as 16, Type for Major Ticks as
By Counts and enter 11 for Counts.
o Go to the Line and Ticks tab and select both Top and Right page with CTRL button pressing
down. Check the Show Line and Ticks box to show the line and ticks for the top X and the right
Y axis. Click OK to apply the settings and close the dialog. The graph should appear as shown
below:
In this section, we will show you how to save the graph above as a template and reuse it.
1. In the menu, select File: Save Template As (alternatively, right-click on the graph window title bar and
choose Save Template As from the context menu) and rename the template as MyGraphTemplate.
807
Tutorials for Origin
2. Create a new workbook and import the data file \Samples\Curve Fitting\Sensor2.dat, by using File:
Import: Single ASCII. Highlight column B and select Plot: Templates: User: Template library. Then
select MyGraphTemplate and click the Plot button to create a graph.
808
Graphing
Note, you can also use the batch plotting tool to create multiple graphs at once from different
worksheets/workbooks with same data structure. You can learn how this tool work from this tutorial.
Origin stores the properties of a graph in a theme file. In this section we will show you how to customize a
graph by using a theme.
1. With Graph3 active, select Tools: Theme Organizer to open a dialog. Select the Times New Roman
Font theme and click Apply Now. Select Ticks All In and click Apply Now, then click the Close button
809
Tutorials for Origin
to close the dialog. The graph should resemble the following graph:
2. The next step is to copy the formatting of the current graph and paste it to Graph2. Right-click to the
right of the layer, anywhere on an empty white or grey space and select Copy Format: All Style
Formats. Activate Graph2, right-click in a similar spot and select Paste Format. Graph2 should look
like the image below:
810
Graphing
You can reorder the data plots either by the the Layer Contents dialog, Object Manager or the Plot Setup
dialog.
Open Customizing Graphs.OPJ from the \Samples\Graphing folder and select the Plotting Order folder
from the Project Explorer window.
1. Activate Graph 1 window. Double-click on the Layer 1 icon on the top left corner of the graph to open
the Layer Content dialog.
2. Click the >> button to hide the left panel. In the right panel, select the Gauss Fit Count line plot.
Click the downward pointing arrow button to move the line plot down in the plotting order.
3. Click the Apply button. The Gauss Fit Count line plot is now on top of the column plot. Click the
Close button to close the dialog.
811
Tutorials for Origin
1. Activate Graph 1 again. Expand the Object Manager, which should be docked to the right edge of Origin
workspace by default, by moving your mouse over to the Object Manager bar.
2. Right-click on the Gauss Fit Count line to select Move Up from context menu to move this plot
upward.
812
Graphing
3. Then, you will see the red line will be back of the histogram plot.
813
Tutorials for Origin
1. Use the same data as the previous example. In the Plotting Order folder activate Graph 1. Select
Graph: Plot Setup from the main menu to open the Plot Setup dialog (You can also right-click on layer
1 and select Plot Setup...).
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
2. In the Plot List panel, drag the line plot and drop it beneath Column/Bar Plot Type.
814
Graphing
3. Click the OK button and you will see that the red curve is now drawn on top. Notice the legend reflects the
new plotting order as well.
In this section, we will show you how to customize a single data point.
1. We will continue to work in the Plotting Order folder. Make sure Graph 1 is active. Note that if you click
to select one of the columns, all columns are selected. Click again to select just that one column. Change
the color to green using the Fill Color button on the Style toolbar.
2. You can also use the Plot Details dialog to customize single columns separately from the rest. Hold down
the CTRL key while double-clicking on the columns to open the Plot Details dialog. The settings in this
dialog will edit the properties of just that single data point. Note that the index number for that selected
data point is highlighted in the left panel of the Plot Details dialog. Set the Gradient Fill group as follows,
to fill the column with a yellow to red color gradient.
815
Tutorials for Origin
3. You can customize a pie chart segment in the same way. In the Edit Single Data Point folder, activate
the pie graph. Hold down the CTRL key and double-click on one of the slices to open the Plot Details
dialog. Under the Pattern tab, set the Fill Pattern to Dense, and set Pattern Color to Red.
(Alternatively, you could have clicked once and then clicked again on a slice to select just that one point,
816
Graphing
and then used the Style toolbar to customize that point.) The graph should appear as the image below:
4. You can customize a single data point and label it. Go back to the Resize Graph and Customize Symbol
folder. Hold down the CTRL key and double-click on one of the scatter points to open the Plot Details
dialog. Under the Symbol tab, click the triangular Preview button to open the symbol gallery, and select
Sphere for the symbol type. Increase the Size to 18, and click the OK button to close the dialog.
5. Use the annotation tool to add the X and Y values that correspond to the customized data point. Select the
Annotation button from the Tools toolbar (Hint: The Data Reader, Annotation and Data Cursor tools are
grouped. If you don't see the Annotation tool, click the arrow to the lower-right of whichever tool is visible
on the toolbar).
Move the annotation cursor to the customized data point and double-click on it. Origin will automatically
add a text object. Hit the ESC key or click on the Pointer button to exit annotation mode. Single-click and
drag to position the text object. A line will automatically be drawn connecting the point and the label.
817
Tutorials for Origin
Right-click on the text object and select the Properties... to open the Annotation-Text dialog. Then you
can customize the text label format in the this dialog. In the Text tab enter
%(1,@LL)=$(Y,.2) %(1,@LU) in the edit box. And the button to the right of the edit box provides
818
Graphing
Beginning with Origin 2017, you can drag annotation labels from point to point. Click
the Pointer button, press the ALT key and use the cross-hairs to drag the label to
another data point.
So far, we have been customizing data points in a single data plot. In this section, we will show you how to
customize a grouped data plot.
1. Select the Grouped Data folder. Book3 will be active. Highlight the entire worksheet and click the line
819
Tutorials for Origin
4. Select Graph: Rescale to Show All. The Y scale of the graph automatically rescales, while the X scale
doesn't change because the option was set to Fixed. Resize the layer and drag the legend to the desired
spot.
5. Click on one of the data plots to select the entire group, and then use the Line/Border Color button
on the Style toolbar to change the colors. Click on By Plots tab, select Q03 Rainbow7 from the
820
Graphing
6. Then select the first increment list. The graph should look like this:
7. Though these data plots have been grouped, you can also customize each of them individually by clicking
on the data plot twice. For example, clicking the yellow data plot twice (click once, pause and click again)
and then clicking the Line/Border Color button on the Style toolbar will change the color to
another color, such as Olive.
821
Tutorials for Origin
8. You can also customize the graph by double-clicking on one of the data plots to open the Plot Details
dialog. Under the Group tab, you can click the browse button...
...to open the Increment Editor dialog. In this dialog, customize the graph as shown in the following
image. Note that you can also drag the index of a row and move it to change the order of the color list.
9. Right-click on the inner position of this dialog and select Save Increment List to save it as MyPalette
for future use. Right-click to get the context menu and select the Load Increment List option. You will
822
Graphing
find that MyPalette appears as the first entry in the fly-out menu, as the following image shows:
In the following section, we will show you how to use Palettes to set colors for a group of data plots.
1. Activate Book3 and highlight all the columns. Select Plot: 3D: Waterfall: Waterfall to create a graph.
Double-click on the X-axis to open the Axis dialog, and set From as 0.5 and To as 3 in Scale tab. Select
Y icon from the Selection list, and set the From, To, and Increment of Major ticks option to -10, 100
823
Tutorials for Origin
2. Click on one of the data plots and use the Line/Border Color button on the Style toolbar to
change the colors. You can select the Rainbow palette under Palettes list in the By Plots tab. The
graph should resemble the image below:
824
Graphing
3. You can double-click on one of the plots to get the color list, as the following image shows:
You can find that the Increment has been set to Binned, so colors are picked from the 256 available in
the Rainbow palette.
4. We will change the palette to Reef by clicking on the browse button to open the Increment Editor
dialog. Then right-click on the inner portion of this dialog and select Load Palette : Reef,then click OK.
The color list in the Plot Details dialog should be set as shown below:
825
Tutorials for Origin
Click on Ok button to close the Plot Details dialog. The graph should appear as shown below:
6.2.12.1 Summary
In this tutorial, we will show you how to create overlapping column plots, and then set transparency to make
the overlapping parts visible.
826
Graphing
Set Transparency
6.2.12.3 Steps
1. Select Help:Learning Center menu to open Learning Center dialog. Select Graph Sample item in the
left panel and then select Column and Bar for Samples in drop-down list.
2. Double-click on the last thumbnail to open the folder Overlapped Bars.
3. Highlight all columns in the worksheet [Counts]Sheet1(The source data Counts.dat can also be imported
from the folder <Origin Installation Directory>\Samples\Graphing\), and then from the menu, select
Plot>2D: Bar: Column to create a column graph.
4. Double-click on the plot to open the Plot Details dialog. In the dialog, choose the Group tab. Click on the
color bar under Details and click in the Fill Color row. Then click on the button that appears to open the
Increment Editor dialog. In this dialog, you can set the first three colors to be some specific colors such
827
Tutorials for Origin
as Royal Blue, Orange, and Dark Cyan. Click OK to close the dialog.
828
Graphing
5. Select the Pattern tab in Plot Details, and set the Transparency control to 51%.
6. Select the Spacing tab, and set Gas Between Bars to zero and Overlap to 100.
829
Tutorials for Origin
7. Click the OK button to close the Plot Details dialog. Select View: Show: Frame to add the frame. The
resulting graph should look like the image below:
6.2.13.1 Summary
In this tutorial, we will show you how to implement various plotting tasks including creating graphs, modifying
the plot type, adding plots to or removing plots from the graph, grouping or ungrouping plots, and editing the
plot range, using Plot Setup dialog.
1. Start with a an empty worksheet and from the menu, select File: Import: Single ASCII or click the
830
Graphing
6.
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
Next we want to group this three plots together. Use the same graph from the previous example.
831
Tutorials for Origin
1. Press CTRL then select all three plots at the bottom panel, right click and select Group. Then these plots
would be under the Group node.
3.
Note:
1. The plot grouping operation enable you to customize the appearance of these grouped data
plots in Group Tab of Plot Details dialog.
2. To ungroup data plots, you can go back to the bottom panel of Plot Setup dialog then click
832
Graphing
Next we are going to remove the data plot of Sensor C then add the data plot of Sensor D into the graph. Use
the same graph from the previous example.
1. Activate the graph, then click Graph: Plot Setup to go back to the Plot Setup dialog. At the bottom
panel, highlight the plot of Sensor C, then right click to select Remove. Click Apply then OK to close the
dialog. The Sensor C plot would be removed from the graph.
2. To add the data plot of Sensor D, select the Group node in lower panel and go to the upper panel by
clicking on the double up-sided blue arrow icon on top right corner, select Column H (Sensor D x) as X,
and Column I (Sensor D y) as Y. Click Add. Click Apply then OK to close the dialog.
3. Next we are going to customize the style of the grouped plot. Double click the plot to enter Plot Details
dialog. At the plot level, select Line tab, set Width as 3.Click Apply then OK to close the dialog. The
833
Tutorials for Origin
834
Graphing
3. Click this button. The Range dialog would pop up. Uncheck the Auto of From and To. Then Customize it
as From 1 To 15 and click OK to close the dialog.
4. To apply this display range for other plots, right click the the data plot of Sensor A again and select Apply
Range To Group.
5. To rescale the plot, click the checkbox of Rescale on the Layer 1 row of the Range Column.Click Apply
then OK to close the dialog.
Next we want to change the plot order of these three plots. Use the same graph from the previous example.
1. Activate the graph, then click Graph: Plot Setup back to the Plot Setup dialog.
2. At the bottom panel, keep pressing the mouse on the plot of Sensor B then drag the plot above Sensor A.
835
Tutorials for Origin
3. Click Apply then OK to close the dialog.The graph would appear as follow. You can see that the data plot
of Sensor A is on top of that of Sensor B.
Next we want to change these three line plots into scatter plots and modify the data plot range. Use the same
graph from the previous example.
1. Activate the graph, right click at the Layer index icon on the graph upper left corner, then select Plot
Setup to go back to the Plot Setup dialog.
2. Select the data plot of Sensor B in the bottom panel, then select Scatter in the Plot Type panel. Click
Replace to replace the original line plot.Other plots in the same group will automatically replaced by
836
Graphing
Multi-Panel plot with several plots in each layer can be created conveniently using Plot Setup dialog.
1. Create a new project, start with a an empty worksheet and from the menu, select File: Import: Multiple
ASCII or click the Import Multiple ASCII button to open the file browser.
2. Press CTRL and choose the file Step01.dat, Step02.dat , Step03.dat, and Step04.dat from the folder
<Origin Installation Directory>\Samples\Curve Fitting\.... Click Add File(s). Check the Show Options
Dialog check box, and click OK to bring up the impASC dialog.
3. Under Import Options, set Import Mode as Start New Books. Accept other default settings and click OK
to close the dialog.Four workbooks Step01.dat, Step02.dat , Step03.dat, and Step04.dat will be created.
4. Do not activate any workbook and click Plot: Multi-Panel: 4 Panel to go to the Plot Setup dialog.
5. Click the double up-sided blue arrow icon on top right corner to open top panel, then select Worksheets
in Project in Available Data drop-down list. All four workbooks would appear in the upper panel.
6. Use Ctrl key to select all four workbooks in the upper panel, then select Column B (Sensor A x) as X, and
Column C (Sensor A y) as Y in the middle panel.
837
Tutorials for Origin
7. Select Plot Type as Line and select Layer1 in ther bottom panel. Click Add. All data plots of Sensor A in
these four workbooks would be added to Layer1.
838
Graphing
8. Repeat the previous step to add Sensor B, Sensor C, and Sensor D to Layer2, Layer3, and Layer4
respectively.Click OK to close the dialog. The graph would appear as follow:
6.3 Axis
6.3.1 Axis
6.3.2.1 Summary
839
Tutorials for Origin
Origin supports multiple breaks on an axis as shown below. The number of breaks and the break positions can
be customized in the Axis dialog box. Furthermore, you can add recession bars( the "vertical bars" shown as
below) by adding multiple reference lines on the X axis and fill the gaps between them.
This tutorial is associated with the Multiple Axis Breaks folder of the sample project <Origin EXE
Folder>\Samples\TutorialData.opj.
Also, you can see this graph in Learning Center(Select Help: Learning Center menu or press F11 key). It is
listed under the Line and Symbol sample graph table. Double-clicking on the thumbnail will open the target
folder.
1. Activate the workbook. Highlight Col(A) and Col(B) and select Plot: Line: Line from the main menu to
plot a line graph. Select and delete the legend.
2. To customize the graph axes double click on an axis to open the Axis dialog box. Click the Horizontal
icon in Scale tab and set the X axis scale as graph below:
840
Graphing
3. Go to Bottom icon in Tick Labels tab, change the display format of tick labels to 16(means year as
yy) and add a prefix '.
841
Tutorials for Origin
4. In order to add several breaks to the X axis select the Horizontal icon in Breaks tab . Check the
Enable box and set 3 axis breaks.
842
Graphing
5. Click the Details... button to open the Breaks Details dialog, set Break1 from 12/1/1961 to
9/1/1972:
6. Select the Break 2 node in the left panel, change it to be from 3/31/1977 to 8/29/1980. Switch to
Break 3 node, change it to be from 7/27/1984 to 3/1/2007. Click the OK button to apply and exit the
Break Details dialog and in the Axis dialog, click the Apply button to view the changes.
7. To customize the Y axis, select the Left icon under the Tick Labels tab and use the format
Engineering:1k as the tick label display. Set the prefix as "$". Click Apply to view the changes in
the graph.
843
Tutorials for Origin
8. Go to the Breaks tab again and with the Vertical tab selected, enable 2 axis breaks at scale value 3.1 T
to 4.5T and 6.7T to 12.5T, as we had done for the X axis in Step 4 to 6.
9. Click OK to apply the settings and get the graph similar as follows:
844
Graphing
1. Double-click on X axis to open the Axis dialog. Go to Reference Lines tab, click the interactive
button beside the Reference Lines at Value text box to select col(C) from worksheet. The x
coordinates of all recession periods will be listed in the display table as reference lines. Then check
Alternate Fill box to fill each period.
845
Tutorials for Origin
846
Graphing
The following steps can further customize the graph to be exactly the same as the image in Summary.
1. Double click X axis title Date in the graph and rename it as Year.
2. To change Y axis range, double click on Y axis to open the Axis dialog. Go to the Scale tab with
Vertical icon selected, set From, To, Major and Minor ticks as below.
847
Tutorials for Origin
3. Go to the Breaks tab again, select the first axis break and click Details to open the Break Details
dialog with the Break 1 node selected. Clear the Auto check box next to the break position option
and change it to 38%. Clear the Auto Scale check box and then change the tick settings as below:
848
Graphing
4. Select Break 2 node, set break position, Major Ticks and minor ticks as below:
849
Tutorials for Origin
5. Click OK to apply and exit the Breaks Details dialog. Click Apply in the Axis dialog to apply settings.
6. Select Grids tab. Select both Vertical and Horizontal icons on the left panel, check Opposite to show a
frame around top and right axes.
7. Right click in a blank area inside graph layer 1 and select Add/Modify Layer Title from the context
menu. Enter US Recessions and Recoveries as the layer title.
8. Adjust the page dimension with Graph node selected in Plot Details dialog.
850
Graphing
6.3.3.1 Summary
This graph will show you how to specify tick locations using a dataset and show customized tick labels at those
locations.
6.3.3.3 Steps
1. Copy the sample data, and paste it into row 1 of column A in Origin worksheet. Set the first row as
Long Name and the second row as Units.
851
Tutorials for Origin
2. Highlight columns A and B. Select Plot:Line + Symbol:Line + Symbol from the main menu.
Alternatively, you can simply click the Line + Symbol button on the 2D Graphs toolbar.
3. Double-click the graph to open the Plot Details dialog. On the Symbol tab, change the symbol to a
solid circle, and the color to Olive. On the Line tab, change the line color to Olive and click OK to
close the dialog and apply the changes.
852
Graphing
4. Double-click the X axis to open the Axis dialog. For both Horizontal and Vertical icon in Scale tab,
enter these settings for the X and Y axes:
853
Tutorials for Origin
854
Graphing
5. On Line and Ticks tab, go to Top and Right page, and check on Show to show the axis on top
(right), Set the ticks style follows the graph below:
855
Tutorials for Origin
6. Then, click the Apply To... button and go to the Apply to Others dialog, set the following:
856
Graphing
7. Click OK to close the Apply to Others dialog and return to the Axis dialog.
8. Go to Display tab in Tick Labels tab, and set the ticks Labels for bottom follows the graph below. In
addation, you need to rotate the tick labels by 90 degree in Format tab for both top and bottom
(which can be done in Bottom page) axis.
857
Tutorials for Origin
9. On the Bottom page under Tick Labels of X Axis, set the Rotate(deg.) to 90 similarly.
10. Select the Grids tab in Axis dialog axis. Check on Show in Major Grid Lines group for both Vertical
and Horizontal:
858
Graphing
11. Click OK to close the Axis dialog. Adjust the Layer Area in Format: Layer Properties: Size/ Speed
tab. Your final graph should look like this:
859
Tutorials for Origin
°K volts
860
Graphing
70 0.85831
125 0.7679
181 0.63948
246 0.53202
288 0.40753
348 0.24898
399 0.13759
436 0.09435
6.3.4.1 Summary
This tutorial will show you how to manipulate the date and time data, and customize the date and time data on
the graph.
861
Tutorials for Origin
6.3.4.3 Steps
1. Start with a new project and import the data file Sample\Import and Export\Custom Date and Time.dat
under Origin's program folder.
2. Double-click on A(X) to open the Column Properties dialog; set Format as Date, Display as
Custom Display, and input dd'.'MM'.'yyyy hh':'mm':'ss'.'## in the Custom Display box as shown
below.
862
Graphing
3. Click OK button to go back to the worksheet. Highlight col(B) and select Plot: Line: Line from the
main menu to plot it as a line graph. You will see that the tick labels of X axis are all the same. This is
because the tick labels are showing the date information only, but the X data are all in the same day.
So we need to change the tick label format to display time.
863
Tutorials for Origin
4. Double-click on the X axis (or select Format : Axes : X Axis from the main menu) to open the Axis
dialog. Select Horizonal icon in the Scale tab, set the following first:
864
Graphing
5. Go to the Bottom icon in Tick Labels tab, change Type to Time and select Display to HH:mm as
shown below.
865
Tutorials for Origin
6. Click the OK button. The tick labels will now show as the corresponding time as in the graph below:
6.4.1 Summary
The Copy Columns To.. feature allows you to copy columns from a worksheet to a new worksheet while
keeping the two sheets linked. Using this feature you can set multiple Filter conditions on one columns by
866
Graphing
creating a corresponding number of worksheets. For example to set two Filter conditions on the Column Gas
Type we created two sheets Type1 and Type2 that were linked to worksheet Raw.
We also used various features to create a dynamic Graph that would update to reflect the changes in Filter
conditions in real time. You can watch the video tutorial explaining these concepts here:
https://www.youtube.com/watch?v=N0Pud-91qCM
Add multiple filter conditions on the same columns using different worksheets
Add a dynamic filter label in a graph that updates with changes in the filter condition
6.4.3 Steps
This tutorial is associated with the Tutorial Data.opj file under <Origin EXE Folder>\Samples path.
Open the Tutorial Data.opj file and browse to the folder Compare Graphs with Filters Data and active
workbook Book1. The workskeet Raw contains data for the emission of different green house gases in
different countries over a period of years.
3. In the Copy Columns to: colcopy dialog that opens, change the Recalculate to Auto so later when
input data is changed the result will be automatically updated. Also make sure the
DestinationColumn(s) is set to <new>!<new> meaning a new worksheet is added, and click OK
867
Tutorials for Origin
4.
7.
868
Graphing
1. On Sheet Raw highlight column Country and select the Filter button.
2.
3. This will create a funnel icon on the top left of the Country column. Click on this and in the menu that
opens deselect the Select All check box and check the France check box. Click OK
869
Tutorials for Origin
4.
5. The worksheet now only shows information for the country France.
6. In Sheet Type1 set a Filter on the Gas Type column for the gas HFCs. Since sheet Raw and sheet Type1
are linked, this worksheet will now show only the HFC emission values for the country France.
7.
8. In Sheet Type2 set a Filter for Gas Type PFCs. This worksheet now only shows PFC emission values for
Country France.
870
Graphing
3.
4. In the Data Browser dialog, make sure that List Datasets = in Current Book and select both the
Value columns in Sheets Type1 and Type2. Click Add and OK out.
871
Tutorials for Origin
5.
6. In the Stack: plotstack dialog, set Plot Type to Scatter and click OK. This will create the following
graph:
872
Graphing
7.
8. In the newly created graph double click on any axes, in the Scale tab set the Rescale as Auto. Do this
for every axes on both plots of this graph so when the worksheet filter is changed and the graph data
changes, the axes will rescale automatically.
9.
873
Tutorials for Origin
Note: By holding the Ctrl key and selecting both Horizontal and Vertical icons, you can change
Rescale for X and Y axes in the same layer, simultaneously. Use the Layer drop-down at the bottom
of the dialog box to apply changes to both graph layers (i.e. Layer 1 and Layer 2).
10. Set the Layer drop-down to Layer 1, then click the Tick Labels tab. With Bottom icon selected,
change the Display to show just the year.
11. Click the Line and Ticks tab. With the Right icon selected, and set Major and Minor Ticks Style to
None and Apply.
874
Graphing
12. Set the Layer drop-down list to Layer 2 and repeat for the Top X axis and Right Y axis in Layer 2 and
click OK.
13. Delete the two Y axis title objects at the left part of the graph, add a new text label Value and rotate it to
90 degrees (right click and select Properties to change rotation angle) and use it as the new Y axis title.
14. Next we're going to do a Linear Fit so the emission trends are more apparent.
15. Activate the graph and go to Analysis:Fitting: Linear Fit....
16. Set Recalculate to Auto.
17. Use the arrow button next to the Input box to select Add all plots in active page. Click OK to close the
dialog and perform a linear fit on the two plots.
875
Tutorials for Origin
18.
19. Double-click on the linear fit curves and go to the Plot Details dialog, in the Line tab, set the color as
Red for each curve. Delete the two legend objects and move away the report table. The resulting graph
will look like this:
876
Graphing
20.
1. Click on the Sheet Type1 and select the Filter label row cell in column B.
877
Tutorials for Origin
3. Select the Text Tool , and click on the graph upper panel. When the blue text box appears hold
down Ctrl + Alt + V. This will paste the Data Filter Label as a link into the text box.
4. Click off of the new text label, then right-click and select Properties.
878
Graphing
5.
6. In the dialog that opens, click on the Programming tab, then check the Real Time check box so the
label changes every time the data filter is changed.
7. Do this with the Filter Labels in Sheet Type2 and Sheet Raw. Add the words "Gas Type" before the "PFC"
and "HFC" labels and "Country" before the Country Data Filter Label. Also Add a Layer Title:
879
Tutorials for Origin
8.
880
Graphing
3.
4. In the Graph Browser dialog that opens, select the graph we just created, and then click OK
5. Enlarge the graph by selecting it and dragging the edges. If you change the Filter Types in the worksheet
now, the graph will update accordingly.
6.5 Layers
6.5.1 Layers
881
Tutorials for Origin
6.5.2.1 Summary
A typical graph page generally includes three elements: a set of X, Y (and Z) coordinate axes, one or more
data plots, and associated text and graphic labels. Origin combines these three elements into a movable,
resizeable unit called a layer. While a page can contain as many as 121 layers, only one layer can be active at
any one time.
6.5.2.3 Steps
1. Click the Import Single ASCII button, , on the Standard toolbar. The ASCII dialog opens.
2. In the Origin folder, browse to the Samples folder and then the Graphing folder. Select Wind.dat from the
list of files.
3. Click Open. The data file imports into the worksheet.
2. Click the Line button, , on the 2D Graphs toolbar. A line plot is created. It appears that this data
would be better plotted on a double-Y graph, a graph with two controlling Y axes.
3. Click the X to Close this window. You will be asked if you want to hide or delete the window. Click the
Hide button. (If you Delete, you will not be able to Undo, and you will need to re-create the graph. Hiding
closes the window from view, but you can later make it visible using the Project Explorer window.)
4. The Speed and Power columns should still be highlighted. Click the Double-Y Axis button, , on the
2D Graphs toolbar. This new graph contains 2 layers.
1. Double-click on Graph1 from the Project Explorer window. The graph opens and becomes the active child
window.
2. Select Format:Page and go to the Legends/Titles tab.
3. Set the Auto Legend Translation Mode to Data Range.
4. Click OK.
882
Graphing
1. Double-click on Graph2 from the Project Explorer window. Graph2 is now in front and becomes the active
child window.
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
4. Uncheck the Show check box for the Speed data plot.
5. Click OK. This data plot is only hidden which is why the legend still indicates its presence in the layer.
6.5.3.1 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.
883
Tutorials for Origin
The Layer Management dialog lets you add, arrange and link layers on a single graph page.
Add a second axis using a nonlinear relationship with the primary axis
Use Layer Management for more complex layer positioning and linking
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.
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 and Uniform Height 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 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 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 . 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.
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.
884
Graphing
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.
o 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.
o You can also do similar settings in the Axis dialog to add such opposite axis:
885
Tutorials for Origin
5. Double-click and edit the top X-axis title and change it to: Energy (eV)
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
886
Graphing
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.
887
Tutorials for Origin
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.
3. Click Apply.
888
Graphing
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.
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.
889
Tutorials for Origin
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.
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.
890
Graphing
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.
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:
o From the Merge drop-down list, choose All in Project. Graph1 and Graph2 will show in the
Preview panel.
o Make sure Number of Rows = 2 and Number of Columns = 1.
o Make sure Treat Each Source Graph As a Unit is selected.
o Set the Vertical Gap to 20.
891
Tutorials for Origin
892
Graphing
4. Click OK to close the dialog box. A new merged graph page is created:
6.5.4.1 Summary
This tutorial will show how to merge four graphs to one graph, which contains multiple layers with linked axis.
893
Tutorials for Origin
6.5.4.3 Steps
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
1. Open the Tutorial Data project and browse to folder Multiple Layers with Step Plot in Project Explorer.
2. Activate the workbook and highlight column Value1 and make a graph by selecting Origin menu Plot >
2D : Line + Symbol: Line + Symbol.
3. Activate the graph, right-click the legend and choose Properties from the context menu. In the Object
Properties dialog,
o In the Text tab, put this text in the text field: \b(Vertical) and set Size to 36.
o Go to the Frame tab, and set as following image. Click the OK button. Move the legend to the
correct position.
894
Graphing
4. Double click on the open white space in layer of the graph to open the Plot Details dialog. In the left
panel, select Layer1. Activate the Background tab in the right panel, choose LT Gray for the Color.
Then select the plot in Layer1 from the left panel, under the Symbol tab in the right panel, set Size
to 15 and Symbol Color to red. Switch to the Line tab, choose Step Vert from the Connect drop-
down list and set Width to 4 and click OK to apply settings.
895
Tutorials for Origin
896
Graphing
5. Now we are going to duplicate similar graphs from the other three columns. Right click on the graph
window title bar and select Duplicate (Batch Plotting) from the context menu:
897
Tutorials for Origin
6. In the dialog that opens, select Column from the Batch Plot with drop-down list, hold Ctrl key and
click to select all three columns C, D, E and click OK:
7. For graph from each column, the legend text and Connect drop-down list will be different, listed
below.
898
Graphing
8. Activate a graph and then select Origin menu Graph: Merge Graph Windows to open the
merge_graph dialog. Change the settings as the following image shows. Then click the OK button to
merge these graphs.
9. Activate the new merged graph, choose Origin menu Graph: Layer Management to open the Layer
Management dialog. In the Layer Selection panel, rename the layers by double clicking on the
name and reorder the layers by clicking on the layer index and dragging up and down. Make sure the
final layers' names and order are the same as the image shows below (In the Preview panel, the
layers' indices and positions can be shown).
899
Tutorials for Origin
10. In the Layer Selection panel, press Ctrl key on the keyboard to select the following layers: Vertical
Center, Horizontal and Horizontal Center. Go to the Link tab, select 1 from the Link To drop-down
list. Then both X Axis Link and Y Axis Link are set to Straight(1 to 1). Then click the Apply
button.
900
Graphing
11. Go to the Axes tab, select Vertical layer from the left panel, then check all Axis check-boxes under
Bottom branch, Left branch, Top branch and Right branch. Also, select In for Tick drop-down list
under Top branch. Click the Apply button.
12. Select Vertical Center layer, in the Axes tab, Bottom branch, Left branch and Right branch share
the same settings. And settings for Top branch shows in the image below. Click the Apply button.
901
Tutorials for Origin
13. Select Horizontal layer, in the Axes tab, check the Axis check-boxes under both Top branch and
Right branch. Click the Apply button.
902
Graphing
14. Select Horizontal Center layer, in the Axes tab, check the Axis check-box under Top branch. Click
the Apply button.
903
Tutorials for Origin
16. Double click on the X axis of the lower-left layer to open the X Axis dialog. In the Scale tab, change
the axis scale as the image below:
17. Click the Vertical icon on the left panel to go to Scale tab for Y Axis and change the axis scale:
904
Graphing
18. Go to Tick Labels tab and click Bottom icon on the left panel and change the display of X tick labels:
905
Tutorials for Origin
19. Go to Special Ticks tab and hide the label at axis end by selecting Hide from Show drop-down list
for Axis End:
906
Graphing
20. Click on the Left icon on left panel, and hide the label at Y axis end by selecting Hide from Show drop-
down list for Axis End.
21. Repeat step 16 to step 18 for the X axis of the lower-right layer.
22. Double click on the axis of lower right X axis, go to Tick Labels tab and Format, change the Size to be
30 and check Bold box.
23. Click on the Apply To... button on the bottom, in the bring up Apply To dialog.
24. Check Size and Bold boxes under Tick Labels node and select This Window from the drop-down
list for both and click OK to apply the settings so that all axes' tick label size is set to be 30 now.
907
Tutorials for Origin
25. Change the both Y titles to Price and make them bold.
6.5.5.1 Summary
The graph layer is the basic building block of all Origin graphs. A graph layer consists of a set of coordinate
axes and (usually) one or more data plots, plus attached axis titles, plot legends, text labels, drawn objects,
button objects, etc. The graph layer can be moved to any location or resized to any dimensions within the
graph window. An Origin graph window contains between 1 and 1,024 graph layers.
When working with graphs that contain multiple layers, it helps to have some tools and a strategy for applying
customizations to multiple layers a time, as opposed to simply modifying each plot or each axis scale
individually. Beginning with Origin 2018b, you can edit multiple graph layers simultaneously using the Plot
Details Layers tab Common Display controls.
How to control the scaling of elements (axis titles, tick labels and graph legends) when graphs are
merged.
908
Graphing
How to merge graph windows containing a single layer into a multi-panel graph.
How to configure the merged graph so that plot or axis customizations made in one layer are applied to all
layers.
How to remove unneeded legend objects and customize one object so that it serves as a legend for the
multi-panel graph.
6.5.5.3 Steps
1. Start a new project. Press F11 to open Origin Central, click the Graph Samples tab, set the graph
drop-down list to Multi-Panel Graphs and double-click on the Multiple Panel Graph from Index
Data.
2. In the worksheet that opens, click on the Output Data tab and resize the window so that you can see all
12 columns of data. Note that the column headings have (1) a green lock on them, indicating that these
are calculated values and (2) the column designations repeat in the pattern X1, Y1, Y1, X2, Y2, Y2, etc.
3. Select columns B(Y1) and C(Y1) and click the Line + Symbol button on the 2D Graphs toolbar.
Repeat the process for columns E(Y2)+F(Y2), H(Y3)+I(Y3), K(Y4)+L(Y4). You should now have 4
similar graph windows, each containing a single graph layer with two plots (Note that you don't need
to select the X column when making these graphs because Origin's default behavior is to plot Y values
against any X column immediately to the left of selected Y columns).
909
Tutorials for Origin
We are going to merge the above graph windows into a single 4-panel graph window but before we do that,
we will briefly discuss element (axis titles, graph legends, etc.) scaling so that we understand how to control
this in a merged graph.
1. Click on one of the four graph windows -- it doesn't matter which one -- and click Format: Layer
Properties.
2. In the Plot Details dialog box, click the Display tab and note the Scale Elements settings. By default,
Scale With Layer Frame is selected. This tells us that when the size of the layer is changed, the size of
attached elements such as the axis titles, graph legend, etc., will be scaled accordingly.
3. Click OK to close Plot Details, then right-click on the graph window title bar and choose Duplicate. You
now have two identical windows.
4. Click on the duplicated window and click Format: Layer Properties, again. Click on the Display tab
again, but this time, set Scale Elements to Fixed Factor: 1, then click OK to close Plot Details. We now
have two identical graphs, one with Scale Elements = Scale With Layer Frame and one with Scale
Elements = Fixed Factor: 1.
5. Reposition and resize your identical graphs so that we can do a side-by-side comparison.
As mentioned, we ultimately plan to merge 4 separate graphs into a single, 4-panel graph and in doing
so, we must shrink the size of our graphs to fit four to a page. What will be the effect of shrinking on text
elements, for instance? We have set up a comparison to identical graphs, one with elements set to
scale with the layer and one with elements set to a fixed size.
910
Graphing
6. In the graph window that is set to Scale With Layer Frame, click once in an empty portion of the graph
page and when the green selection handles appear, hold the CTRL key and drag a corner handle so that
the graph covers approximately 25% of the page.
7. Repeat the last step with the graph window that is set to Fixed Factor: 1.
8. Now, compare the resulting smaller graphs and note, in particular, the difference in the way that the
various elements -- the plot symbols, the text and legend objects -- behaved when the graph was
made smaller.
We can see that setting the elements to Fixed Factor: 1 is probably going to cause problems when four
graphs are merged onto a single page, so when we merge, we will leave the default setting for each of
the merged graphs to Scale With Layer Frame.
9. So that you don't get it mixed up with the other graphs, delete the "Fixed Factor" graph.
1. With all four (and only the four) of your original graph windows showing in the workspace, choose Graph:
Merge Graph Windows and open the Merge Graph Windows dialog box.
2. Make sure that all four graphs are listed in the Graphs box, then expand the Scale Elements branch and
make sure that Scale Mode is set to Auto. Note the Preview pane to the right side of the dialog box,
showing an approximation of your final, merged graph. Tip: If you want to keep your original graphs,
make sure the Keep Source Graphs box is checked, or the graphs will be destroyed.
3. Click OK and a four-panel graph is created. Note the four layer icons in the upper-left corner of the
merged graph -- one icon for each graph layer.
911
Tutorials for Origin
Suppose that we want to customize some elements or properties of the layers, plots and axes in a multi-panel
graph? We could make edits to each layer, one-by-one, but this would be tedious. Beginning with Origin
2018b, you can use the Plot Details Layers tab Common Display controls to apply edits made to one layer,
to other layers.
1. With your 4-panel (merged graph) active, click Format: Page Properties. This opens the Plot Details
dialog box.
2. Click on the Layers tab.
3. Under Common Display, check the Plot Properties box. As the "blue hint" tells us, we should check the
appropriate boxes here first, then make customizations at the Layer/Plot level. We can use the Apply to
controls to selectively apply Common Display changes (see documentation of Apply to controls).
4. In the left panel of Plot Details, click the arrow to the left of the Layer1 icon to expand to show the
two data plots in the layer.
912
Graphing
5. Click on the first plot in the layer, then on the Symbol tab to the right side of Plot Details, click on the
symbol gallery (downward-pointing arrow) and change plot symbol shape to Circle, then change Size to
15. Leave Symbol Color as Auto as that will allow symbol color to follow line color. Click OK to close Plot
Details and note that the symbol size is increased in all plots in our 4-panel plot.
6. We can continue to customize our 4-panel plot using Format and Style toolbar buttons. Click on one of
the gray plots and note that both plots in the layer are now highlighted. Pause slightly and click a second
time on the gray plot and this time, you will see that only that plot is selected.
7. Click the Line/Border Color button on the Style toolbar and choose Navy. Note that gray plots in each
of the four panels are now navy blue in color. The graph should look something like this:
At this point, we have a satisfactory graph and we may consider our work finished. However, one thing that we
should be aware of is that when the four graphs were merged, the scaling down of font size produced one
small issue.
1. Select one of the graph legend objects, then hover over it with your mouse and you will see a tooltip
that appears something like this:
913
Tutorials for Origin
The tooltip reports that the (font) size = 22 but that the actual size is 10.1. This occurs because, as we
expected, the font was scaled down when we merged graphs. The problem now is that we have a font
size that looks like it is 10.1 but Origin still thinks of it as a size = 22 (Look to the Font Size list on the
Format toolbar and it will report the original size of 22). We can correct this conflict with a simple menu
command.
2. With the graph window active, choose Graph: Fix Scale Factors and accept the default value of 1 by
clicking OK. Now, select one of the four legend objects, hover and you'll see that the tooltip now reports
that both size and actual = 10.1 (the decimal is not meaningful as Origin rounds to the nearest 0.5). Note
also, that the Format toolbar now reports Font Size = 10.
While we could have skipped this detail, it is not uncommon for users to want to be confused by conflicting
information about scaled font sizes and this menu item is the best way to reset font size so that you know just
what you are working with.
At this point, our graph looks satisfactory but we could do a couple of things to improve it. One would be to
remove extra white space from the graph. We have a couple of options there but one quick way to do this is to
choose the Fit Layers to Page menu item.
1. With the graph window active, choose Graph: Fit Layers to Page. This opens the Fit Layers to
Page:gfitp dialog.
2. Set a Margin of 5 and clear the Maintain Layer Aspect Ratios box, then click OK. Our graph layers are
slightly re-proportioned and the white space around the outside is reduced.
If you are exporting or copying your graph to an external application, the Export
Margin Offsets dialog box can also be used to remove white space from the outside of
the graph.
We don't need the four graph legend objects since each panel plots the same two variables. So, we will
eliminate three objects and slightly reconfigure the fourth to act as a legend object for the four panels.
1. Press CTRL + select three of the legend objects and when the green selection handles appear surrounding
the three, press Delete.
2. Drag the remaining legend object to the top-center of the graph page.
3. With the legend object still selected (green handles showing), press CTRL again and drag one of the green
handles on the side of the legend object and drag it out horizontally until it looks like this:
914
Graphing
1. Center the graph legend on top of the page. Your graph should now look something like this:
6.6.2.1 Summary
It is possible to copy and paste formatting from one plot to another, so there is no need to spend time
recreating identical customizations such as size and color of symbols and lines.
Copy a plot format (color, size, etc. of the symbol or the line), and apply it to other plot.
6.6.2.3 Steps
915
Tutorials for Origin
1. Click the New Project button on the Standard toolbar to begin with a new project.
2. Select File: Import: Single ASCII menu, and import exponential decay.dat in the \Samples\Curve
Fitting subfolder in your Origin program directory.
3. Highlight column B, C and D, and select Plot: 2D: Line+Symbol: Line+Symbol" menu to plot these
three datasets.
4. Double-click on the plot to show the Plot Details dialog box.
5. Choose Group tab in the dialog, and select Independent for the Edit Mode -- this makes it easier to
customize individual plots.
6. Make sure that the top data plot (Time(X) Decay 1(Y)) is selected in the left panel of the Plot Details
dialog. If not, select this plot branch in the left panel.
7. Select the Symbol tab, and change the Size to "5". (You can also change the shape or the color to others
of your choice.)
8. Select the Line tab, and change the width to "0.2". (You can also change the style or the color to others
of your choice.) Click OK. You will see that the Decay 1 plot has been customized.
9. Click on Decay 1 plots to select. Right-click on it and select Copy format. This will copy the plot format
of Decay 1 to the clipboard.
10. On the graph, click on the Decay 2 data plot to select it, right-click and select Paste Format to: All. You
will see the plot format of Decay 1 copied to Decay 2.
Note: Right-clicking on third plot "Decay 3" to select Paste Format(Advanced) to open the Apply
Formats dialog, you can do further and more detailed settings.
6.7.2.1 Summary
916
Graphing
In this tutorial you will choose a Plot Details setting Fill to next data plot. When we
say "next" this refers to the next plot in the plot list in the left panel of Plot Details".
This has nothing to do with intersecting plots on the graph page.
This tutorial is associated with <Origin EXE Folder>\Samples\Tutorial Data.opj. Note that this tutorial requires
numerous steps to produce a complex graph. Users should understand that this is not a basic Origin graphing
tutorial.
1. Open the Tutorial Data.opj and browse to folder Multiple Fill Area.
2. Activate workbook Book2, Sheet1. Highlight columns C through F, then click Plot: 2D > Line: Line. A
grouped line plot is created.
3. Select and delete the X axis title and legend object from the graph.
4. Double-click on any plot to open the Plot Details dialog. Go to Line tab and set Transparency to
100%.
917
Tutorials for Origin
5. Go to Group tab and set Edit Mode to Independent, then click Apply. This will allow us to specify
custom fill area modes for each line.
6. Highlight the first plot in the left side of Plot Details. On the Line tab, enable Fill Area Under Curve
and select Fill to next data plot - Above Below Colors.
918
Graphing
8. Go to Pattern_Below tab and set Fill Color to Red, the click Apply. The first filled area part of our
plot is added.
919
Tutorials for Origin
9. Highlight the second plot in the left side of Plot Details. Go to the Line tab, enable Fill Area Under
Curve and select Fill to next data plot - One Color.
920
Graphing
11. Repeat step 6~8 for the third plot in graph but on the Pattern_Above tab, set Fill Color to None and
Transparency to 0 (you must clear Follow Line Transparency). On the Pattern_Below tab, set Fill
Color to Blue.
12. Your stacked fill area plot should now look like this:
921
Tutorials for Origin
In the graph we just created, there are some overlapping fill areas that we do not want. We will hide them by
adding a white fill area to cover them. We will be using the Layer Contents dialog box to add datasets to the
graph, some of them multiple times.
1. From the menu, select Graph: Layer Contents. Use the right-pointing arrow button in the middle of
the dialog to add these plots to the datasets to the right side of the dialog.
2. Use the Ungroup button to ungroup any plots that come over as groups. Grouping is denoted by the gn
beside each dataset. You want to make sure that no groups exist (you can ignore the first four datasets
that were added).
3. Arrange added plots in exactly the order shown. Use the up- or down-arrow buttons above the right side
list, to rearrange the list as needed. Note that only ungrouped plots can be independently ordered. When
your list looks like the figure above, click OK to close the Layer Contents dialog box.
4. Double-click on a data plot to open the Plot Details dialog box.
5. In the left side of Plot Details, highlight the fifth plot down (C(Y)). On the Line tab, check Fill Area Under
Curve, and from the drop-down choose Fill to next data plot - Above Below Colors, Color = Red and
Transparency = 0. On the Pattern_Above tab, Transparency = 0 and Fill Color = White. On the
Pattern_Below tab Fill Color = Red.
6. Highlight the sixth plot down (D(Y)) and set Color = Red and Transparency = 0.
7. Highlight the seventh plot down (E(Y)). On the Line tab, check Fill Area Under Curve, and from the
drop-down choose Fill to next data plot - Above Below Colors, Color = Blue and Transparency = 0.
On the Pattern_Above tab set Fill Color to White and Transparency to 0. On the Pattern_Below tab,
Fill Color = Blue.
8. On the eighth plot down (F(Y)), click the Line tab and set Color to Black and Transparency to 0.
9. On the ninth plot down (H(Y)), click the Line tab and set Color to Orange and Transparency to 0.
10. On the tenth plot down (I(Y)), click the Line tab and set Color to Blue and Transparency to 0.
11. For the eleventh and twelfth plots (B(Y), G(Y) respectively), click the Line tab and set the line Color to
Gray and the Transparency to 0.
12. For the thirteenth plot down (E(Y)), click the Line tab and from the drop-down set Fill to next data plot
- Above Below Colors, Transparency = 0. On the Pattern_Above tab, set Fill Color = None,
Transparency = 0; on the Pattern_Below tab, Fill Color = White.
922
Graphing
13. For the fourteenth plot down (C(Y)), click the Line tab and verify that Color = Black and Transparency
= 0.
14. For the fifteenth (last) plot down, click the Line tab and set Color = Red and Transparency = 0.
15. Close Plot Details and click the Rescale button on the Graph toolbar. Your graph should look
roughly like the following. To polish your graph, continue with the last section.
1. Double-click on the X axis (bottom, horizontal) tick labels. This opens the X Axis dialog box. Click the
Scale tab and set the date range From 1/1/2013 To 8/20/2013. Set Minor Ticks Count = 0.
2. On the Tick Labels tab set Display to show a three-letter abbreviation for month (e.g. Apr).
3. Click Apply.
4. To draw a box around the whole graph layer, choose View: Show: Frame.
5. Lastly, to add the dashed lines at temperature = -10 and +110, double-click on the Y axis (left,
vertical). Click on the Reference Lines tab and enter the following:
923
Tutorials for Origin
6. Click the Details button and in the Reference Lines dialog box, clear Auto Format, set Style to Dash
and Thickness to 1. Do this for both the -10 and +110 lines and click OK.
7. In the Axis dialog box, click OK to close the dialog. Your graph should now look like this:
6.7.3.1 Summary
This tutorial shows how to plot two functions and customize the graph by partially filling an area between the
two function curves.
924
Graphing
6.7.3.3 Steps
This tutorial with the Fill Partial Area between Function Plots folder in the project <Origin EXE
Folder>\Samples\Tutorial Data.opj.
To apply different fill colors to two or more portions of the curve, you need to plot curves in segments. In this
tutorial, you will learn how to fill an area between curves defined by X <= 1.
1. Open the Tutorial Data.opj and browse to the Fill Partial Area between Function Plots folder. Book2L
contains two function curves (Note: To see how to generate a dataset from a function, see the last
section of this Tutorial).
2. Select rows 1~36 (-2.5 <= X <= 1) of all three columns in Sheet1 of Book2L and on the menu, click
Plot>2D: Line: Line to plot two lines. The two datasets (lines) are automatically grouped.
3. Now, go back to the worksheet, select rows 36~51 (1 <= X <= 2.5) of all three columns and hover over
the edge of the highlighted area until the cursor looks like this . Drag and drop the selected range,
onto the graph you just created . If prompted to rescale the axes and show all data, choose Yes.
925
Tutorials for Origin
5. Double-click on one of the line plots, to open the Plot Details dialog box. Select the 1st plot under the
Layer1 node on left panel.
6. Go to Line tab and check Fill Area Under Curve. Select Fill to Next Data Plot - Above Below
Colors. Notice that this action adds a Pattern_Above and a Pattern_Below tab to the dialog box.
7. Go to Group tab, click the line color list in the Details column to select the increment list Candy as
below:
926
Graphing
8. Go to the Pattern_Above tab and set the fill color of the black line to LT Magenta with a 50%
transparency.
927
Tutorials for Origin
9. Go to the Pattern_Below tab and set the fill color below the black line to be LT Cyan. Note that
there is not a separate transparency control for Pattern_Below (uses the same transparency
settings as Pattern_Above).
10. Select the third plot in the left panel, go to Group tab, click the line color list in the Details column to
select the increment list Candy as below:
928
Graphing
11. Click OK to close the dialog box. The area in between the curves where X<=1 is now filled.
1. We want to change the X axis display range from -2.5 to 2.5 and the Y axis display range from -
10.5 to 4. To do this, double-click on the X axis to open the Axis Dialog box. Set the X axis(
Horizontal icon) in Scale tab as follows.
929
Tutorials for Origin
2. Go to Vertical icon in Scale tab and set the Y axis scale as follows.
3. To configure the X and Y axes so that they intersect at 0,0, Select both Bottom and Left icon in the
left panel of the Axis Dialog. Set Axis Position to At Position = 0.
930
Graphing
4. Click OK to close the dialog. Delete the Axis titles, and then select the two line groups separately to
set Width to 2 both using the style toolbar. Then, the graph will looks like:
In the graph above, there are three intersections of two function curves. We want to mark two of them, at X=-
2 and X=2 respectively.
931
Tutorials for Origin
1. Click the blue line(X<=1) twice to select this curve only as below:
2. Then, click once again on the intersection at X=-2 to select this individual point and then right-clicking on
it to select Edit Point to open the Plot Details dialog. You can learn more about how to show and
customize a individual point on graph.
932
Graphing
3. In the dialog that opens, you will see a special point showing its row index has been added and selected
under the second plot.
o Go to the Symbol tab, customize its style as below:
o Go to the Drop Line tab, enable the vertical drop line and set its style as shown below:
o Go to the Label tab, check the Enable check box to set Label Form to (X,Y) and Font Size to 22
4. Click OK to turn off this dialog. Do the similar steps as step 1 ~ step 2 to add another intersection at
X=2(row index = 46).
933
Tutorials for Origin
And then, set the same styles for it. At the end, you will get the graph such as the one shown below:
934
Graphing
1. To hide the axis tick labels at (0,0), open the Axis dialog again and go to Special Ticks tab, then for the
Bottom icon set as below and do the same for the Left icon.
2. To add arrows to the ends of the axes. Go to the Line and Ticks tab of Axis dialog. Select both Bottom
and Left icon in the left panel of the Axis dialog. Expand Arrow node, check the Arrow at End
checkbox, and then set Width to 5.
3. Double-click on X axis to open the Axis dialog. Go to Reference Lines tab, enter 1 in the Reference
Lines at Value text box, then click any place in the list table to add a reference line at X=1. Do the
935
Tutorials for Origin
settings as below:
Click OK to close this dialog, and then click OK button to apply the settings and close the Axis dialog too.
You can also use the Add Straight Line tool(opened by selecting Graph: Add
Straight Line menu) to add such a vertical straight line at X=1.
936
Graphing
4. To add the two curves' formulas to the graph, right-click on a blank area and choose Add Text.... Type
any character into the object to create a text object firstly. And then right-click on it to select Properties
from the context menu to open the Object Properties dialog. Enter the first formula in the Text tab.
y=-x\+(2)+3x
y=2x\+(3)-x\+(2)-5x
5. Click OK button to close the dialog. Add one more text object and open Text Properties dialog again to
enter the second formula above in Text tab. Click OK button again, then these two formulas have been
added to the graph window both. Reposition them as needed.
6. Select the Curved Arrow Tool and add two curved arrows to connect formula labels to line plots.
937
Tutorials for Origin
1. Open a new workbook. Choose Add New Columns to the worksheet so there are 3 columns.
2. Right-click Col(A) and select Fill Column with: A set of Numbers...
3. In the patternN dialog box, set up the following parameters:
4. Double-click on the F(x) label row of Col(B) to turn to the in-place edit mode, then enter -1*A^2+3*A as
below.
Note: Since Origin 2017, a new control Spreadsheet Cell Notation has been added and turned on
by default(you will see the icon at the top-left corner of the worksheet), Origin supports to use
column Short Name as notation in column formula, such as A+1 instead of col(A)+1.
938
Graphing
5. Highlight col(C) and right-click on it to select Set Column Values from context menu to open Set Values
dialog. In this dialog, enter formula and the range definition as below:
6.7.4.1 Summary
This tutorial will show how to create a line graph with recession bars. This type of graph is common when
plotting economics data with periods of recession marked as vertical bars.
939
Tutorials for Origin
Add reference lines and fill paired reference lines to show recession bars
6.7.4.3 Steps
This tutorial is associated with <Origin EXE Folder>\Samples\Tutorial Data.opj. Open the Recession Bars
folder from Project Explorer and the workbook Book1G is activated.
6.7.4.3.1 Add Reference Lines and do Alternate Fill to add Recession Bars
1. Highlight col(A) and col(B) in the worksheet, choose Plot: Line: Line to create a line graph. Click on the
line plot to select it and then use the Line/Border Color button in Style toolbar to set its color to
red.
940
Graphing
2. Double-click on X axis to open the Axis dialog. Go to Reference Lines tab, click the interactive
button beside the Reference Lines at Value text box to select col(C) from worksheet. Then the x
coordinates of all recession periods will be listed in the display table as reference lines.
3. Check Alternate Fill box to fill each period. And uncheck the Line check box to hide all reference
lines (by checking the Line check box on Line column header and then unchecking it to remove all
selections in this column).
941
Tutorials for Origin
If you elect to show Label Text, you can choose <auto>, <value as entered> or enter your
own custom string. For more information see The Reference Lines Tab, Label Text.
1. Click the Graph1 icon in the left panel (take care not to clear the check box beside
it) and on the Display tab, set Color as Dark Cyan. Click the Layer1 icon, set the
Color on the Background tab as White , clear the Data on Top of Axes check
box and check Frame check box in the Display tab. Click OK to close this dialog.
942
Graphing
2. Double-click the X axis to open the Axis dialog. Click the Tick Labels tab, under
Display page select 2016 from Display drop-down list.
943
Tutorials for Origin
3. Go the Format page and change Rotate (deg.) to 90, so that all tick labels will
rotate 90 degrees. Click Apply to view the settings.
944
Graphing
945
Tutorials for Origin
5. Go to the Title tab and change the content in Text box to Year to modify the X axis
title.
6. Highlight Left icon on the left panel and change the Y axis title text to be (Index 2002
= 100) and click Apply.
7. Go to the Scale tab again and this time the Vertical icon is selected which indicates it
is the Scale tab for Y axis, set the From value to 0. Click the Apply button.
8. Go to the Grids tab and show the major grid lines in LT Gray following the settings
below:
946
Graphing
10. Go back to the graph and delete the legend. Right-click on the layer and select
Add/Modify Layer Title to add a title. Type Industrial Production: Durable
Consumer Goods (IPDCONGD) in the text box. Highlight the text and click the
button on the Format toolbar. Adjust the text to an appropriate size by typing
or selecting a number in the Font Size list in the Format toolbar. You
should get the following graph.
947
Tutorials for Origin
6.7.5.1 Summary
The scatter plot below depicts 3 decay and recovery curves obtained after taking two-photon fluorescence
measurements of reversible photodegradation in a dye-doped polymer. To learn more about the graph, please
read the case study.
948
Graphing
6.7.5.3 Steps
1. Download the zip file from here and extract the text files .
949
Tutorials for Origin
2. Open Origin and click the Import Multiple ASCII button on the Standard toolbar to open the
ASCII dialog and then import the text files.
950
Graphing
3. In the impASC dialog, set Import Mode as Start New Sheets. Click OK to finish importing.
4. We will use the Plot Setup dialog to create a graph with 8 plots. Active the workbook, and make sure that
no datasets are now selected. Click the button on the 2D Graphs toolbar to open the Pot Setup
dialog.
Show all of the three panels of Plot Setup dialog (if not all of them are shown) by clicking the and
buttons.
First, we will add 4 line plots into a graph by using the Plot Details dialog. Highlight all dataset in the top
panel, and then select column Timemin as X, column Theory as Ys in the middle panel. Then add them
into the bottom panel.
Then we will add 4 scatter plots in to the same graph. Select Scatter from the Plot Type drop-down list,
make sure all dataset in the top panel has been selected, and then select column Timemin as X, column
951
Tutorials for Origin
NormData as Ys in the middle panel. Then add them into the bottom panel.
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
5.
In bottom panel, if there is a Group branch under Layer1, right-click on it to select Ungroup from
the short-cut menu to ungroup these plots.
952
Graphing
Click OK to generate the graph which look like the following image shows.
6. Double-click the layer icon at the top-left corner of graph window to open the Layer Contents dialog.
Then group the Theory plots and NormData Plots as Group 1 and Group 2 using the Group button after
953
Tutorials for Origin
highlight the 4 Theory/Norma Data plots separately by using mouse and the Shift key,
7. Then we will customize the 8 plots in the Plot Details dialog. Select Format: Plot Properties to open the
Plot Details dialog. In the left panel of the dialog, you could see there are 8 plots: the first 4 plots are line
plots, the other 4 are scatter plots.
8. We will first customize the 4 line plots. Open Plot Details by double clicking the plot. On the left panel, 4
line plots are put ahead of the 4 scatter plots. You can select the first line plot by selecting the first plot
under Layer 1 in this panel then go to Line tab. Select B-Spline from the Connect drop down list and set
the Width to 3. Then click the Apply button. In the Group tab, select None for the increment cell in
Line Color row. Click OK to apply these settings.
9. Then customize the 4 scatter plots. Go to Plot Detail and then select the fifth plot in the left panel, which
should be the first scatter plot. Go to Symbol tab, change the Size to 8 and Edge Thickness to 0.
In the Group tab, we will mainly customize the symbols in the list box that in the middle of the tab. In the
Symbol Type row, select By one in the Increment column. Click the button to open the Increment
Editor dialog, in the dialog select UpTriangle, Circle,Hexagon and Square for the first 4 rows.
In the Symbol Edge Color row, select By one in the Increment column. In the Details column, click
the color list to select the list Q11: Candy from the color list drop-down list.
In the Symbol Interior row, select By one in the Increment column. Click the button to open the
Increment Editor dialog, in the dialog select Solid, Solid,Half Left and Solid for the first 4 rows. Click
954
Graphing
OK button to close the Plot Details dialog, then the graph will look like.
10. Then customize the Axes of the graph. Double click on the X axis to enter Axis Dialog.
First, we customize the axes scale. Go to Horizontal icon in Scale tab, change From to -5, To to 690;
set Major Ticks Type as By Increment and Value as 100, respectively. Repeat these steps to customize
the Y axis range ( the Vertical icon) as From to 0.61 and To to 1.01, and Value as 0.05.
955
Tutorials for Origin
To customize the Axis Ticks, select Top icon in Line and Ticks tab, enable the Show check box, then go
to Top icon in Line and Ticks tab, select In from both Major Ticks and Minor Ticks drop-down lists.
956
Graphing
Repeat the same steps for Right Axis under Right icon.
11. Then you will will customize the titles and the legend. Change the titles follows the images shows. Right
click on the legend and select Legend:Update Legend from the context menu to open legendupdate
dialog. In this dialog, do the following:
957
Tutorials for Origin
Click Ok to close this dialog. Then the legend will update. Double-click on it to turn to the in-place edit
mode, remove the first four rows.
The final graph will look like
958
Graphing
6.7.6.1 Summary
This tutorial will show you how to create a multiple line plot and how to customize it.
6.7.6.2 Steps
1. Create a new worksheet. Click the Import Single ASCII button and import the
Micro_Raman_Spectroscopy.txt file under <Origin EXE Folder>\Samples\Graphing\ path.
959
Tutorials for Origin
2. Highlight all the columns in the worksheet. Right-click and select Set As: XY XY from the context
menu. Then click the Line button on the 2D Graphs toolbar.
960
Graphing
3. Double-click on the X axis to bring up the Axis dialog box. In the Scale tab, set the options as the
screenshots below.
961
Tutorials for Origin
4. Click the Vertical icon on the left panel to go to the Scale tab of Y Axis and then set the options as
in the screenshots below and Click OK.
962
Graphing
5. Now, we will apply a Graph Theme to add a top X axis and a right Y axis. Select Tool: Theme
Organizer to open the Theme Organizer dialog. Activate the Graph tab and select Opposite Lines
from the table. Then click Apply Now. Click Close to close the dialog.
963
Tutorials for Origin
6. Click the Line button on the Tools toolbar and draw a line across the peaks' centers as the sample
image shows. Hold down the SHIFT key while drawing the line to force it to snap to the vertical.
Double-click on the line. In the Line tab, select Dash with the Type drop-down list. Click OK.
7. Click the Text button in the Tools toolbar. Add a text object near the line object and enter 461 into
the text object.
Right-click on the text object and select Properties from the shortcut menu. In the Text of the dialog,
set the options as in the screenshot below. Click OK.
964
Graphing
8. Right-click on the title of the Y axis and select Properties from the short-cut menu. In the Text of
the dialog, enter Raman intensity/arb.units in the edit box, highligh it, click the Bold button, and
change size to 28. Click OK.
965
Tutorials for Origin
9. Right-click on X axis title and select Properties from the shortcut menu. In the Text of the dialog,
enter Wavenumber/cm-1 in the edit box, highlight it, click the Bold button, and change size to 28.
Highlight -1 click SuprtScript button. Click OK.
966
Graphing
6.7.7.1 Summary
This tutorial will show you how to create a multi-line-plot with special position annotation line.
6.7.7.2 Steps
1. Open Tutorial Data.opj and browse to the Multi-line-plot with Special Position Annotation Line
folder in Project Explorer (PE).
2. Active to the worksheet in workbook Multi-line-plot with Special Position Annotation Line. To plot a
multiple line plot, highlight all the columns in the worksheet, and click the Line button on the 2D
967
Tutorials for Origin
3. Double click the axis to open the axis dialog, set the axis scale and ticks via dialog:
o Go to the Line and Ticks tab and set the ticks:
968
Graphing
o Go to the Scale tab in same dialog, set the scale for X and Y axis:
For X (Horizontal): From 74505 to 74575;
For Y (Vertical): From -2500 to 45000;
4. Go to the Ticks Labels tab and change the display format for Left into Scientific: 10^3, then, go to the
Grids tab with Horizontal icon selected, check Show for Major Grid Lines, click OK to close the dialog.
5. Select the View: Show: Frame in main menu to added a line frame on the graph. The graph is similar to
this now:
969
Tutorials for Origin
6. Double click the plot line to open the Plot Details dialog, in Group tab, open the Increment Editor as
shown in graph, designate color for each line, then click OK to close two dialog.
970
Graphing
7. Then, you will add vertical line on Graph, select Graph: Add Straight Line in main menu to open the
dialog, set the X coordinates in the dialog, and set color: red, click OK to apply the settings.
8. A straight line with text was added on the graph. Edit the Text object above the line object by double click
it, the and in Format toolbar is helpful when creating superscripts and subscripts. Entering the
content as shown in graph below:
971
Tutorials for Origin
Then, click somewhere outside the text box to quit the text editing, drag to move the text to a proper
position.
Now, the text object get the X coordinates of the line, when you drag to move the line object horizontal,
the text also updates simultaneously.
9. Add explanatory strings for line plot, add a title on the graph by using Text Tool as well.
The Symbol Map can only be opened while in In-place edit mode. To
enter In-place edit mode, double-click on the text label. Then, open
the Symbol Map by pressing CTRL+M. Or right-click inside the text
label and select Symbol Map.
o Text Control dialog box (from previous versions of Origin): Hold down the
CTRL key when double-clicking text. Highlight any portion of the text and
apply the desired style, Greek font, etc.
You can also right-click on a text label and select Properties to open
972
Graphing
this dialog.
10. The finished graph is similar to the graph in Summary Section in this tutorial.
6.7.8.1 Summary
A scatter central plot is a graph with the X and Y axes located in the middle of the layer. In this tutorial, a
scatter central plot will be created, then the symbol and the axes will be customized.
973
Tutorials for Origin
6.7.8.3 Steps
1. Start with an empty worksheet with two columns. We are going to fill a worksheet column with values
using the Set Values dialog box.
2. Highlight column A, right-click and select Fill Column with: Row Numbers from the shortcut menu.
Right-click column A again and select Set Column Values to open the Set Values dialog box. Type
This - 11 in the text box, then click Apply to finish setting values for column A.
3. Click the button to select column B in the Set Values dialog box. Type A^2 + A + 1 in the text
box this time. Then click OK to set values for column B.
4. Highlight column B and select Plot: Symbol: Scatter Central from the Origin main menu. This
creates a scatter central plot.
974
Graphing
5. We will change the color and shape of the scatter points. Double-click on the scatter plot to open the
Plot Details dialog, expand Layer1 node on the left panel and highlight its sub-node. In the Symbol
tab of right panel, click the down-sided triangle button beside Preview and choose the solid circle
symbol. Click the button beside Symbol Color and choose Individual Color: Red. Click OK to close
Plot Details.
975
Tutorials for Origin
6. Now we will customize the axes. Double click on the Y axis to open the Axis dialog box. On the Scale tab
for Y Axis, change the To value to 450.
7. Click Special Ticks tab, enter 200 in At Axis Value column right below Axis End and uncheck its
correspond box in Show column to hide the special tick as displayed in following:
976
Graphing
8. Click the Bottom icon on the left panel and click to highlight the Axis End row, then choose Hide from
the drop-down list in Show column.
9. Click OK to finish axes settings. The scatter central plot looks like the following.
977
Tutorials for Origin
10. Now, delete the legend and change the labels of axes A to X and B to Y and make the text bold.
11. Right click on the X axis label and select Properties shortcut menu and choose 0 from Rotate(deg.)
drop-down list, and click OK. Move the X to the end of X axis. Add a text object Y = X2 + X + 1 and
978
Graphing
979
Tutorials for Origin
6.7.9.1 Summary
You can masking subranges of data graphically. In this tutorial, a line graph is created first, then the masking
tool is used to mask the low peaks on the graph.
980
Graphing
6.7.9.3 Steps
1. Create a new workbook, click the Import Single ASCII button to import the file
Line_Graph_with_Masked_Data.txt under <Origin EXE Folder>\Samples\Graphing path.
2. Highlight both columns in the worksheet and select Plot: Line: Line from the Origin main menu to
plot a line graph.
981
Tutorials for Origin
3. Double click on the X axis to open the Axis dialog box. Set the increment value to 0.25 as in the
image below:
982
Graphing
4. Click the Vertical icon on the left panel to set the Y axis scale as in the following image:
983
Tutorials for Origin
5. Click OK to close the Axis dialog and delete the graph legend. Change the X label to Time[s] and the
Y label to Signal[A.U.], and bold both text labels and set the font size as 28. Create a title by adding
a text object that says Time Series. Bold the title and set the font size of the title to 36.
984
Graphing
6. Activate this graph, then click and hold the Regional Mask Tool button on the Tools toolbar until a
menu appears. Select Mask Points on Active Plot to enter masking mode.
985
Tutorials for Origin
7. Click an appropriate place on the graph and drag out a rectangle to select the low peaks and, at the
same time, mask them. Drag out additional rectangles until all low peaks are masked. Then click the
Pointer button on the Tool toolbar to exit masking mode.
6.7.10.1 Summary
This tutorial will show you how to create a symbol plot with color transparency, categorical legend and bubble
scale. This graph displays a symbol plot of XY data where the size of the symbol and its color have been
mapped to two other data columns in the worksheet: Mass and Type. The categorical legend can be utilized to
identify Type via color and the bubble scale can be used to check Mass via symbol size. Color transparency has
been applied to the plot so that overlapping data points are visible.
986
Graphing
How to control the size and color of plot symbols using values in worksheet columns.
6.7.10.3 Steps
1. Open Tutorial Data.opj and browse to the Bubble with Transparency folder in Project Explorer (PE).
2. Go to Book2G, highlight Col(A)~Col(C) in the worksheet and select Plot: Symbol: Bubble from the main
menu.
3. Select Format: Plot Properties... in the main menu to open the Plot Details dialog. Then go to the
Symbol tab and set the symbol format as in the following:
987
Tutorials for Origin
988
Graphing
4. Click OK to save settings and close the dialog. The graph should now look like this:
5. To update the axes scales and title, select Format: Axes: X Axis... to open the Axis dialog box. Modify
the following settings:
o In the Scale tab for X Axis, choose the following setting:
989
Tutorials for Origin
o Click Vertical icon on the left panel and go to Scale tab for Y Axis and set the following:
990
Graphing
o Go to Title tab, and change Y axis title as Sample Y-Dimension (cm) and set font and size as
following:
991
Tutorials for Origin
o Then click Bottom icon on the left panel and change X axis title as Sample X-Dimension (cm)
and set and size as following:
992
Graphing
6. Double click on the bubble scale to bring up Bubble Scale Control dialog. Select Nested from Layout
drop-down list and check Half Circle and Show Leader Line boxes and click Apply as shown in
993
Tutorials for Origin
following:
994
Graphing
7. Click on the left panel to go to Levels page, set From as 20 and To as 50 and change increment Value
to 10 as shown in following:
995
Tutorials for Origin
8. Click Title on the left panel, check Show box and change content in Title to be Mass, then set the Size to
be 28 and check Bold box. Click OK to close dialog as shown in following:
996
Graphing
997
Tutorials for Origin
11. Right click on the legend and select Properties from shortcut menu, customize the text as shown in the
following:
13. Select the Text Tool button on the Tools toolbar and click once to the left side of the page just above
the frame. Type the following into the text object: Agate Cross-Section by Type and Location. Customize
the font. Select and re-position the text object as needed.
998
Graphing
6.7.11 Symbol Plot with Size and Colormap from Other Columns
6.7.11.1 Summary
This tutorial will show you how to create a symbol plot with size and color from other columns.
This graph displays a symbol plot of data from multiply columns where the size and color of the symbol have
been derived from other data columns in the worksheets. User defined Colormap has been applied to the plot.
999
Tutorials for Origin
How to control the size and color of plot symbols using values in worksheet columns.
6.7.11.3 Steps to Construct a Symbol Plot with Size and Colormap from Other Columns
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
1. Open the Tutorial Data project and browse to folder Symbol Plot with Size and Color Mapping in Project
Explorer.
2. Select the Col(X)and Col(Y) in first sheet of the workbook and click Plot: Symbol: Scatter to get a
scatter plot.
3. Click Graph: Layer Contents in main menu with the graph active, and select all the columns with Long
name Y, Y1, Y2 and add them into the right panel. Click Ungroup button to ungroup all datasets. Click
1000
Graphing
OK to close dialog. The order and quantity of column Long name listed in right panel should be exactly the
same as the graph, use up and down button to adjust the position, and use to remove the repetitive
items.
4. Double click the scatter to open the Plot Details dialog, go to Symbol tab, Set the Symbol for each plot
one by one follows the Graph below, after each step setting, please click Apply to make a rudimentary
saving.
1001
Tutorials for Origin
5. The next 7 steps will guide you finish the symbol setting for each dataplot. Symbol setting for dataplot 1:
1002
Graphing
1003
Tutorials for Origin
1004
Graphing
1005
Tutorials for Origin
1006
Graphing
1007
Tutorials for Origin
1008
Graphing
10. Symbol setting for dataplot 6 and 7, which act as the legend:
1009
Tutorials for Origin
11. Then, Click OK to close the window. Double click the Axis X to open the Axis dialog, and set the Scale for
both Horizontal and Vertical icons From -50 to 50 with same Major and Minor ticks style:
1010
Graphing
1011
Tutorials for Origin
12.
1. The Edge color of the post-Electrical Open and pre-Electrical Open plot both used Map:Col(C), so we will
further make some style setting for Color scale in Colormap tab. Click Level to open Set Levels dialog,
set levels from 0 to 155 with Major Levels 5.
1012
Graphing
2. Double click each Level value to edit them and double click each Fill color to edit them as well:
Click Apply to apply these color setting to the graph (for the post-Electrical Open scatter).
3. Then we would like to save the setting as a theme named as mycolor.oth. The theme will be applied to the
post-Electrical Open scatter.
1013
Tutorials for Origin
1014
Graphing
1015
Tutorials for Origin
OK.
5. Click Graph: New Color Scale in main menu, an Color Scale will display in the graph.
1016
Graphing
1. Select Format: Layer Properties in main menu to open the Plot Details dialog, go to the Size/Speed
tab, edit the Layer Area as follows:
2. Go to the Display tab in Plot Details dialog, edit the Clipping Margins(%) to -2%, click OK to close
dialog.
1017
Tutorials for Origin
3. Copy the previous Legend and paste it on the graph, edit the new legend in this way:
Add a title Elapsed Time for the color scale in Title tab, Click OK to apply.
5. Double click the axis to open the Axis dialog. Set Grids line for both Horizontal and Vertical in Grids tab in
the same style as shown in graph below:
1018
Graphing
6. At last, add a Text "symbol size is relative to event energy" in the graph by using Text Tool in Tools
box.
1019
Tutorials for Origin
6.8.2.1 Summary
This tutorial will show you how to create and customize a 2D Pie chart.
6.8.2.3 Steps
1020
Graphing
2. Highlight column B and select the 2D B&W Pie Chart button on the 2D Graphs toolbar.
1021
Tutorials for Origin
3. Right click on the Legend and select Delete from the short-cut menu.
4. Right-click on the graph and select Plot Details from the short-cut menu to open the Plot Details
dialog. In the Pie Geometry tab, set the options as in the screenshot below.
1022
Graphing
Click OK to close the Plot Details Dialog. Rearrange the text labels so that they do not crowd each
other.
6. Select the Text button from the Tools toolbar. Then click near the top of the layer. Enter Population
by Major Ethnic Group to add a title for the graph. Use the tools in the Format toolbar to
customize the text, as needed. The graph should look something like this:
1023
Tutorials for Origin
Click on the empty data cell in row 1, column A(X) and paste the copied data.
Hispanic 45.4 1
White 35.7 18
Asian/Pacific 8.9 24
Other 0.3 18
1024
Graphing
6.8.3.1 Summary
In this tutorial, we will create a graph to compare African population distributions for 2010 vs. predictions for
2050.
1025
Tutorials for Origin
Merge graphs
6.8.3.3 Steps
To create this graph, we must create four separate bar plots, customize them and merge them into one graph.
1. Start with an empty Origin workbook, import the data file African_Population.dat under <Origin
EXE Folder>\Samples\Graphing path. (Or if you do not have the file in your Origin installation,
download the zipped data file from ftp.)
1026
Graphing
2. Highlight column B and select Plot>2D:Bar:Bar to plot a bar graph. Use the Fill Color button in the
Style toolbar to change the fill color to Red.
3. Now we are going to duplicate similar graphs from the other three columns. Right click on the graph
window title bar and select Duplicate (Batch Plotting) from the context menu:
4. In the dialog that opens, select Column from the Batch Plot with drop-down list, hold Ctrl key and
click to select all three columns C, D, E and click OK:
1027
Tutorials for Origin
5. Three similar graphs will be created (When you get a Reminder Message asking Would you like to
rescale the axes to show all the data, select Yes and click OK).
6. We now have four bar graphs of four groups: male-2010, female-2010, male-2050, female-2050.
1028
Graphing
1. First we will customize Graph1 (i.e. the one with legend showing male-2010).
2. Double-click on the data plot to open the Plot Details dialog box. Expand Layer1 node on the left panel
and highlight its subnode, on the Pattern tab on right panel, change the Color of Fill to Blue. Click OK
to apply the color setting and close the dialog.
3. Double click on the Y axis (the horizontal axis in bar plot) to open the Axis Dialog. On the Scale tab
for Y Axis, set From = 17, To = 0, Value of major tick increment = -5:
1029
Tutorials for Origin
4. Click the Vertical icon on the left panel and go to Grids tab of X Axis and clear the Show check box
under the Minor Grid Lines branch, to hide the minor grid lines. Click Apply:
1030
Graphing
5. Go to the Line and Ticks tab and set Style under Minor Ticks to None:
1031
Tutorials for Origin
6. Now we will hide minor grid lines and minor ticks for all other graphs. Click the Apply to... button to
bring up Apply To dialog and select the check box beside Ticks and Grid Lines. In the drop-down
menus for both, select All Windows in Folder and click OK to apply settings. Now, minor grid lines
and ticks in all graph windows in the same folder of Project Explorer will be hidden:
1032
Graphing
7. Next we will customize the Y axis scales for Graph2(female-2010) and Graph3(male-2050). Open
the Axis Dialog for each graph and set the axis scales following the screenshots below:
1033
Tutorials for Origin
1034
Graphing
8. Double-click on X axis of Graph4 to open the Axis dialog to set the X-axis scale following the
screenshot below:
1035
Tutorials for Origin
9. Double-click on the data plot of Graph3 (male-2050) and open the Plot Details Dialog. Expand Layer1
node to highlight its subnode, click the Pattern tab on right panel, set the Color for Fill to Blue.
10. For Graph2(female-2010) and Graph4 (female-2050), select the tick label for X axis (vertical axis)
and press the Delete key to remove them. Similarly, remove the axis titles for both X and Y axes.
Now you should have four customized bar plots like those below:
1036
Graphing
Now we have four distinct bar graphs. We will merge these four graphs and do some final customizations, such
as adding text annotations.
1. Activate one of the four graph windows and select Graph: Merge Graph Windows from the main
menu. This opens the merge_graph dialog box. Edit the settings as follows and merge these four
bar graphs into one graph window.
1037
Tutorials for Origin
2. In the merged graph, drag the two Y (horizontal) axis titles "Population (million)" to center align them.
Sequentially select and delete the four graph legends.
3. Right click on an open space in the graph layer and select "Add Text". Type to create the four text labels.
The text labels used are:
Figure 1. African population by five – year age groups and sex, 2010 versus 2050
2010
Males
N=515,267
Females
N=517,776
2050
Males
N=998,354
Females
N=1,000,112
Source: Population Division of the Department of Economic and Social Affairs of the United Nations
Secretariat,
1038
Graphing
World Population Prospects: The 2008 Revision, http://www.un.org/en/index.html, Monday, April 12,
2010; 3:19:17 PM.
You may further customize the position, text font, size, color and alignment of the newly added labels. Your
final graph should look much like the the graph pictured below.
6.8.4.1 Summary
1039
Tutorials for Origin
6.8.4.3 Steps
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
1. Open the Tutorial Data project and browse to folder Bar Plot with Errors in Project Explorer.
2. Activate the workbook Book2N, right-click the col(C) to select Set as: Y Error from the context menu.
3. Highlight Col(A), col(B) and col(C), select Plot: Column/Bar/Pie: Column from the main menu to
plot a column graph with Y error bar.
1040
Graphing
4. Activate the graph window, and then select Graph: Exchange X-Y Axes.
5. Highlight the col(D) in the worksheet and then activate the graph window again. Select Graph: Add
Plot to Layer: Scatter from the main menu to add the col(D) as scatter to the column graph.
1041
Tutorials for Origin
6. Double-click the column graph to open the Plot Details dialog. Set the Color and Pattern options in
the Fill group of Pattern Tab as below.
7. Select the scatter plot in the left panel, then set the Symbol as below. Then click OK button to close
the dialog.
8. Activate the graph window, hold the Ctrl key and select the first bar to set its pattern as Dense as
below from the Style toolbar.
1042
Graphing
9. Select Graph: Legend: Reconstruct Legend from the main menu to update the legend for graph.
10. Right-click the legend to select Properties from the context menu to open the Objects Properties
dialog. Set Background as Black Line. Then edit and move the legend as below.
1043
Tutorials for Origin
6.8.5.1 Summary
This customized graph shows an example of a bar graph with added error bars. The same Y data is plotted
twice, once as a scatter plot and again as a column plot. The error bars are attached to the scatter plot in this
case. Error bars can be included in the graph in both the Y and X dimensions.
1044
Graphing
Use the Plot Setup dialog to add a new data plot to your graph
6.8.5.3 Steps
This tutorial is associated with <Origin EXE Folder>\Samples\Tutorial Data.opj. (If you don't have the Project
file, please download the data file from here)
1. Open the Tutorial Data.opj and browse to the folder Column Graph with Error Bars. Activate the
worksheet and make sure the column plot designations are set as X, Y, Y Error and Label accordingly.
2. Highlight column 2 and select Plot: Column/Bar/Pie: Column to create a column graph.
3. With the graph window active, select Graph: Plot Setup... to bring up the Plot Setup dialog box. Click
the up-sided double triangle arrow icon to expand top two panels and we will add the scatter data and
1045
Tutorials for Origin
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
4. Click the Add button to add scatter data to the column plot. Then click OK to go back to column
graph window.
5. Double-click the columns to bring up the Plot Details dialog box. Customize the graph using settings on
the Pattern tab as shown below:
1046
Graphing
6. Double-click on the Y axis to open the Axis dialog box. Set the Y axis scale as shown in the screenshot
below:
1047
Tutorials for Origin
7. Then go to the Tick Labels tab to set X axis tick labels as shown in following screenshot:
8. Go to the Grids tab and click the Horizontal icon on the left panel to customize grids for Y Axis and turn
on major grid lines by duplicating the settings in the image below:
1048
Graphing
9. Click Apply first, and then hold Ctrl key to select both Vertical and Horizontal icons on the left panel
and select the Opposite checkbox to turn on opposite additional lines for both X and Y axes.
10. Click OK to apply settings and close the Axis dialog box. Finally, delete the legend object.
6.8.6.1 Summary
This graph displays a stack column plot. Each data point in each column has been labelled using the associated
data value, and custom formatting applied to column fills and labels.
1049
Tutorials for Origin
6.8.6.3 Steps
1. Open Tutorial Data.opj and browse to the Stack Column With Labels folder in Project Explorer (PE).
2. Activate the worksheet and select columns B through E. In the main menu, click Plot, then point to
Column/Bar/Pie and click Stacked Column. Alternatively, you can click the Stacked Column
button on the 2D Graph toolbar.
1050
Graphing
3. Double-click the X axis tick labels to open the Axis dialog box. Go to Tick Labels tab and set the X
axis tick labels as following:
1051
Tutorials for Origin
4. Select the Grids tab and hold Ctrl key to select Horizontal icon in left panel to simultaneously apply
changes to the Y Axis. , Check the Opposite box to add lines opposite both the X and Y axes:
1052
Graphing
5. Go to the Scale tab and click Vertical icon on the left panel to set the value of To to 102 for Y axis and
click OK to apply settings and close the Axis dialog box.
6. Double-click the plot to open the Plot Details dialog box. On the Group tab, set the Fill Color as
shown below:
1053
Tutorials for Origin
7. On the Label tab, select Enable. Set the Font, Color, and Size to Verdana, white, and 18. Set
Label Form to Custom and enter "$((y),.0)%" for the Format String.
1054
Graphing
1055
Tutorials for Origin
10. In the left panel, select Layer1. On the Background tab, set Color and Gradient Fill as shown
below:
1056
Graphing
11. Click OK to close the dialog box. To complete the graph, change the X and Y axis labels to "Year" and
"Population (%)", then add the graph title ―U.S. Population by Race.‖
6.8.7.1 Summary
This tutorial will show you how to create a clustered-stacked column chart in Origin. This graph consists of two
graph layers, each of which has a stacked column.
6.8.7.3 Steps
1057
Tutorials for Origin
After version 2015, Origin supports to set subgroup for mutilple stacked column plots in
a layer. And it is easier to plot the grouped stacked columns graph. Please refer this
tutorial: Grouped Stacked Column
1. Import the sample data Data 1 and Data 2 into different worksheets in Origin. Set the first line as Long
Name for them and set the sheet names as 2010 and 2011 respectively.
2. Create a new graph layer by selecting File : New : Graph from the main menu. And then select Graph:
New Layer: No Axes(Link XY Scale and Dimension) from the main menu to add another layer to the
graph window you just created.
3. Select Graph: Plot Setup... from the maint menu to open the Plot Setup dialog. In this dialog, select
Column/Bar in the Plot Type box, select worksheet 2010 and 2011 in the top panel respectively, assign
col(A) as X and col(B)~col(D) as Y in the middle panel, and then click the Add button to add them to
1058
Graphing
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
1059
Tutorials for Origin
4. Click OK button to close the Plot Setup dialog. Click the Rescale button, you will get a graph with two
column graphs overlapped as shown below:
5. Double-click on the graph to open the Plot Details dialog. Select Layer1 level in the left panel, go to
Stack tab in the right panel, and select the Cumulative option. Select NoAxes level, do the same
setting.
1060
Graphing
6. Select Graph1 level in the left panel, go to the Miscellaneous tab in the right panel, and check the
Column/Bar Gap/Offset Across Layers check box.
7. Click OK button, you will see the plot with two stacked columns will show side by side with an auto gap.
8. Double-click on the graph to open the Plot Details dialog again. Set the Border Color and Fill Color
respectively, as shown below:
1061
Tutorials for Origin
1062
Graphing
9. Go to the Pattern tab to set the Transparency as 40, Border Width as 0.2, and Gradient Fill as shown
for both graph layers:
11. Right-click on the graph legend, select Update Legend from the context menu to open the
LegendUpdate dialog. Set the Update Mode as Reconstruct, Legend as One Legend for All,Layer
1063
Tutorials for Origin
12. Click OK button to close the dialog and then update the axis labels, you will get the final graph shown
below:
1064
Graphing
6.8.7.4.1 Data 1
Jan 42 33 40
Feb 88 85 37
Mar 99 34 82
Apr 51 43 38
May 21 66 52
Jun 74 31 28
6.8.7.4.2 Data 2
Jan 96 87 35
Feb 62 66 15
Mar 65 86 51
Apr 32 24 87
May 77 26 34
Jun 69 33 71
6.8.8.1 Summary
1065
Tutorials for Origin
Origin supports grouped column graphs with indexed data. Multiple group levels are supported. Grouping
information can be shown in tick label tables on the X or Y axes.
Customize tick labels, colors, gaps, error bars and data labels
6.8.8.3 Steps
1. Open Tutorial Data.opj and browse to the Grouped Column with Error Bars and Data Labels folder
in Project Explorer (PE).
2. In the following steps, we want to customized the order of values shown in the graph but not change the
source data. Right click Column B in workbook, select Set As Categorical in the list menu, double click
the literal "Unsorted" to open the Categories tab. Then select Ascending in Sort list and click OK to
1066
Graphing
3. Do the same operation for Column C and F to set the Column C and Fas categorical data as well and set
the order of categorical values as Ascending.
4. We are going to create a grouped column chart from worksheet. Highlight column D(Y2) and E(yErr) and
select Plot > 2D: Group Plot: Grouped Column - Indexed Data... from the main menu.
5. In plot_gindexed dialog, click in the "Group Column(s)" to add columns B, C, and F (in that order) to
the Group List. Click the OK button.
1067
Tutorials for Origin
A grouped column plot with error bar is created. The 3-row tick label table at the bottom shows the
grouping information. Note that a worksheet is created to contain the data used to create this graph.
1068
Graphing
6. To hide the first tick label row, double-click on any tick label in the row, e.g. EC2. The Axis dialog box will
open with the Bottom 3 icon selected in the left panel. uncheck the Show box and click Apply.
7. We want to customize the appearance of the Bottom 2 tick label rows.Select the Bottom 2 icon on the
left panel and clear all Border check boxes in Table tab, then click the OK button.
1069
Tutorials for Origin
8. To show color information in the legend, right click the legend and choose Legend: Categorical Values.
Check on the Fill Color check box.
1070
Graphing
Cilck OK to apply the setting, delete the top two legend entries which are not needed.
The tutorial steps that follow, further customize the graph so that it looks like the image in the Summary
section.
1071
Tutorials for Origin
1. To turn on grid lines, go to the Axis Dialog Grids tab. Check the Show box for major grid lines in
Horizontal icon. Click Apply to apply the settings.
2. To turn on frames for both X and Y axes, Select both Horizontal and Vertical in left panel,check on
Opposite checkbox in Additional Links group.Click OK button to apply.
3. To show labels on top of each column, open the Plot Details dialog box by clicking on the graph bars. Go
to the Label tab and check the Enable box. Duplicate the settings as shown below.
1072
Graphing
4. To add a gap between each week, go to Spacing tab and set the Gap Between Subsets(%) to 15.
5. To control pattern by the worksheet data in column F, add a color gradient fill to the plot columns, go to
Pattern tab of Plot Details and set as follows. The gradient fill direction should be Horizontal Center
Out.
1073
Tutorials for Origin
6. To customize the pattern list, go to the ‘’Pattern List' tab in Plot Details dialog. Check the Use custom
increment list check box and create a custom pattern list. Note that you don't need to delete patterns
beyond the 3rd one in the list since only the 1st 3 pattern style are used.
7. To remove negative error bars, select the error bar plot in the left panel of Plot Details, (The second
dataset under Layer1), then go to the Error Bar tab and clear the Minus check box.
8. To change the graph page background color, select the Graph icon in the left panel of the Plot Details
dialog box. Go to the Display tab and set color to LT Gray.
1074
Graphing
9. To change layer background color to white, select Layer1 node on left panel of the Plot Details dialog.
Go to the Background tab and set Color to White.
10. To show pattern information in the legend, right click the legend and choose Legend: Categorical
Values. Check on the Fill Pattern check box.
11. To arrange legends horizontally, right-click on the legend object and select Properties... from the
shortcut menu. In Text tab of Text Object dialog box, arrange the remaining text in a single line.
Go to Frame tab, select None under Frame drop-down list. Click OK.
1075
Tutorials for Origin
12. Drag the legend to an appropriate position. Select and press Delete to remove the Y axis title.
6.8.9.1 Summary
In Origin, multiple datasets can be plotted as a stacked column graph. Usually these datasets are grouped
together by default. In addition, subgrouping is possible for stacked column graphs such as the one shown
below with 2 subgroups:
1076
Graphing
This tutorial is associated with the Grouped Stacked Column folder in the project <Origin EXE
Folder>\Samples\Tutorial Data.opj.
Note: You can also access this sample graph by double-clicking on its thumbnail under the Column and Bar
graph sample in the Learning Center dialog(Help: Learning Center menu or press F11) .
1. Activate the worksheet Sheet1, highlight col(B)~col(G) and select Plot>2D: Bar: Stacked Column
from the menu to create a stacked column graph:
2. Double-click on the column plot to open the Plot Details dialog. On the Group tab, select By Size
for Enable subgroup and set Subgroup Size to 3.
1077
Tutorials for Origin
4. Select Layer1 in left panel of Plot Details dialog and click the Stack tab. Check the Use
Subgrouping (in Group tab) for Cumulative/Incremental check box. Click the Apply button.
1078
Graphing
5. Click OK to close the dialog. Select Graph: Rescale to Show All from the main menu.
1. To create two rows of tick labels for the X axis, double-click on the X axis tick labels to open the Axis
dialog.
o Go to Bottom icon with Tick Labels tab selected.
o Under Format tab, change Font Size to 16
1079
Tutorials for Origin
o Under Table tab, check the Enable checkbox and set Number of Rows to 2. Bottom icon will
change into Bottom 1 and Bottom 2 on the left panel.
o Select the Bottom 2 icon and set Dataset Name to [Book1J]Sheet1!label in Display tab, and set
the Font size to 10 in the Format tab. This will change the tick label row to the car names from
the worksheet label (Y) column.
1080
Graphing
o To show a frame around the layer, select the Grids tab, Check on the Opposite check box under
the Additional Lines branch and click OK button for both Horizontal and Vertical icons.
The following steps can further customize the graph to be exactly the same as the image in Summary.
1. Double-click on the column plot to open the Plot Details dialog. On Group tab, click the button in the
'Details column of the Fill Color row. Increment Editor opens.
2. Click on the arrow to the right of the first color, then click on an empty color well under Custom. In the
Color dialog that opens, set the Red, Green and Blue values to 165, 196 and 0, then click OK.
3. Create five more custom colors using these RGB values: (243, 62, 12), (243, 200, 30), (0, 64, 127)
(119, 0, 31), and (124, 191, 243).
1081
Tutorials for Origin
4. Click the number (7) to left of the next color in the Increment Editor list, then scroll to the bottom of
the list, press Shift then click on the number to the left of the last color. Click Delete to remove the
selected colors so that you have just the six custom colors that you just created. Click OK to close the
Increment Editor.
5. On the Label tab, set Size to 12, Color to Dark Gray and click on the Bold button. Choose Custom
as Label Form and enter $(p,.0)% in Format String box. This adjusts the labels on the columns.
1082
Graphing
6. Click the Spacing tab and increase the Gap Between Bars(in %) to 30.
7. Select Layer1 in left panel of Plot Details dialog and click the Stack tab. Check the Show Total
Label on Stacked Column/Bar.
1083
Tutorials for Origin
6.8.10 Stack Column Plot with Different Positive and Negative Y Scale
6.8.10.1 Summary
We will show how you can use axis break without a gap to produce this graph, that has much larger Y scale
range for the negative bars.
1084
Graphing
divide one axis into several segments and set scales separately.
Also, you can see this graph in Origin Central(Select Help: Origin Central menu or press F11 key). It is listed
under the Column and Bar Charts sample graph table. Double-clicking on the thumbnail will open the target
folder.
1. Open Tutorial Data.opj and browse to the Custom Axis Scale to Show Different Scale folder in Project
Explorer and activate the workbook sample.
1085
Tutorials for Origin
2. select all the columns and choose Plot:Column/Bar/Pie:Stacked Column to create a stacked column
plot with error bars.
3. Positive columns cannot be seen since their absolute values are too small comparing to those of negative
columns.
1086
Graphing
4. We can break the Y axis at Y=0 and use different axis scale for those two segments. First double click on
the Y axis to open the Axis dialog and set Y Range (in Vertical icon) to be from -180000 to 80
5. Then go to the Breaks tab with Vertical icon active, and enable 1 axis break. Also set the Break Half
Length to 0 so the break indicator will not show. Set both the Break From and the Break To to 0 so the
axis will break at 0 and no break gap shows. Uncheck Auto Postion and enter 50 for the Position cell.
1087
Tutorials for Origin
6. Set Custom Scale for the region after break (Y>0)by clicking Details:
7. Click Apply to apply the settings and view the updated graph, you can see the axis scales are different for
the regions above or below the Y=0 line and the columns for positive values can also be seen in the
1088
Graphing
graph.
The following steps can further customize the graph to be exactly the same as the image in Summary.
1089
Tutorials for Origin
4. To change the positive and negative column colors to light gray and gray, double click on the columns to
open the Plot Details dialog to make the changes shown below
1090
Graphing
5. To customize the legend, right click on the legend object and select Properties to open the Object
Properties dialog, arrange the two legend entries to be in the same row as below and click OK
6.8.11.1 Summary
1091
Tutorials for Origin
Origin allows you to specify a dataset to control column/bar width. When the Scaling Factor is 0, the dataset
values determine bar width in terms of X axis scale values.
6.8.11.3 Steps
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
1. Open the Tutorial Data project and browse to folder Variable Column Width in Project Explorer.
2. Activate the workbook Book3A, highlight col(F), col(A) and col(B) and select Plot:
Column/Bar/Pie: Stacked Column from menu to plot a stacked column.
1092
Graphing
3. Double-click on the plot to open the Plot Details dialog. Click the Group tab then click the button
to open the Increment Editor. Select two custom colors as Fill Color.
4. Go to the Spacing tab, select Col(C): "w" as Width (in %) and set Scaling Factor to 0. After
clicking Apply, it will be displayed as '<0=Use X Unit> .
1093
Tutorials for Origin
5. Go to the Label tab, set Position to Center and select Col(C): "w" from the Label Form drop-down
list.
6. Click OK to close the dialog. Double-click on the X Axis to open the Axis dialog.
o Select Horizontal icon in the Scale tab, select By Custom Positions for Type and
[Book3A]Sheet1!F"Product Share (%)" for Position.
1094
Graphing
o Go to Bottom page in Tick Labels branch, set Type to Tick-indexed dataset and Dataset
Name to [Book3A]Sheet1!D"Item".
1095
Tutorials for Origin
o Go to the Grids tab and check the Opposite check box under the Additional Lines branch for
both Vertical and Horizontal
o Click OK to close the dialog.
7. Double-click on the Y axis title and change it to Unit Sales. Right-click the legend box and select
Properties... from fly-out menu. Edit the legend to display on one line. The graph should look like
the following:
1096
Graphing
6.8.12.1 Summary
This tutorial will show you how to create a Stack Column bar graph.
1097
Tutorials for Origin
6.8.12.3 Steps
2. Highlight all the columns and click the Stack Columns button on the 2D Graphs toolbar.
1098
Graphing
3. Then apply a graph theme to add a top X axis and a right Y axis. Select Tool: Theme Organizer to
open the Theme Organizer dialog. Activate the Graph tab and select Opposite Lines from the
table. Then click the Apply Now button. Click the Close button to close the dialog.
4. Double-click on the Y axis to open the Axis dialog. Go to Horizontal icon in Grids tab, and check
Show checkbox under the Major Grid Lines section. Click the OK button to add grid lines to the
graph.
1099
Tutorials for Origin
5. Go to the Title tab to change the title of Y axis to Millions of Unit Batteries. Then choose Top icon and
add a graph title Rechargeable Batteries CCC. The graph should look like:
1100
Graphing
Single ASCII button and select the file to import it into Origin.
1991 777719 -- --
1992 759629 -- --
Double Y
3Ys Y-YY
6.9.2 Double Y
6.9.2.1 Summary
This tutorial will show how to create a graph with double Y axes.
1101
Tutorials for Origin
Update legend
6.9.2.3 Steps
1. Open the project <Origin Installation Directory>\Samples\Graphing\Double Y.opj and activate the
workbook.
2. Highlight four columns of data in the worksheet, then choose menu Plot: Multi-Y: Double-Y to create a
graph with double Y axes.
3. Customize scatter plots:
o Double click on the plot to open the Plot Details dialog box. In the left panel, select the plot
in Layer1, and set the plot type to Scatter, symbol to Triangle and size to 10 (Hint: the
box accepts text entries).
1102
Graphing
o Choose the first plot in Layer2, then change the Plot Type, Size and Color as shown below.
1103
Tutorials for Origin
o Choose the Error bar plot in Layer2, then change Color to Gray in the Error Bar tab.
o Click OK to apply your customizations and close the dialog box.
4. Double click on X axis to open the Axis dialog box. On the Scale tab for X Axis, set the X axis scale
to be from 92 to 83 with increment of -2.
1104
Graphing
5. Click Vertical icon on the left panel and go to the Scale tab for Y Axis and apply the following
settings to the left Y axis:
1105
Tutorials for Origin
6. Click Horizontal icon on the left panel to go to Title tab and change the X Axis title to Transition
Temperature (K):
1106
Graphing
7. Click Left icon on the left panel to change the Y Axis title to Deposition Pressure (Torr).
8. Set the Layer drop-down to 2 to switch to Layer 2 controls. Repeat the settings as in step 5 - 6, but with
scale From = 765, To = 795, Type = Linear. For Major Ticks, change the Value for Increment to 10.
Go to Title tab and change Text to Annealing Temperature (\+(0)C).
9. Go to the Line and Ticks tab and set both Major Ticks and Minor Ticks to In and click OK to apply
settings.
1107
Tutorials for Origin
10. Click the legend to select it, then right-click and choose Properties from the shortcut menu. This
opens the Object Properties dialog box. Go to Frame tab, change Frame to Box. In the Text tab,
enter the following:
\l(1.1) As Grown
\l(2.1) Annealed
1108
Graphing
11. Click OK to close the Properties dialog box. Move the legend to an appropriate position.
6.9.3.1 Summary
This tutorial will show how to create a graph with three Y axes; one left Y axis and double right Y axes.
1109
Tutorials for Origin
Create a graph with three Y axes; one left Y axis and double right Y axes.
6.9.3.3 Steps
1. Open Tutorial Data.opj and browse to the 3Ys Y-YY folder in Project Explorer (PE).
2. Highlight all data columns in the worksheet, then on the Plot menu, click Multi-Y: 3Ys Y-YY to create a
graph with three Y axes - one left Y and two right Y.
3. Customize data plots:
1110
Graphing
o Double-click on the plot to open the Plot Details dialog box. In the left panel, select the plot
in Layer1, then change the plot type, symbol and color as shown below (be careful not to
clear the check box to the left of the plot):
o Click the data plot in Layer2 and change the plot type and symbol shape as shown in the
following:
1111
Tutorials for Origin
o Choose the Error bar plot in Layer2, then change its color to Black.
o Choose the plot in Layer3. Change the Plot Type to be Line + Symbol and go the Symbol
tab (right panel), choose the following settings:
1112
Graphing
o Select the Line tab (with Layer 3 still selected) and change Connect to B-Spline. Click OK
to close Plot Details.
1113
Tutorials for Origin
4. Double-click on the X axis to open the Axis dialog box. Configure the X axis scale as shown in the
following:
5. Go to Tick Labels tab and click Top icon on the left panel, check the Show box and show tick labels
of top axis.
1114
Graphing
6. Then go to Line and Ticks tab, check Show Line and Ticks box to show line and ticks for top axis
and click on Apply.
1115
Tutorials for Origin
7. Go to the Scale tab and click the Vertical icon on the left panel and duplicate the following settings:
1116
Graphing
8. Go to the Title tab, select Show and change the title Text to Deposition Pressure (Torr) and select
Auto from color drop-down list.
1117
Tutorials for Origin
13. Click OK to apply settings and close the dialog box. On the graph, right-click the legend object and
choose Properties from the shortcut menu. This opens the Object Properties dialog box. Go to
Frame tab, and change Frame to Shadow. Go to Text tab, and enter the text shown below, then
click OK to close the dialog box. Reposition the legend object, as needed.
\l(1.1) As Grown
\l(2.1) Annealed
\l(3.1) \g(D)T\-(C)
1118
Graphing
14. Add a graph title by creating a text object and typing Characteristics of Samples Grown Under Different
Conditions. Reposition as needed.
15. Right-click outside the graph (but still within the white area) and select Fit Page To Layers.... Accept the
defaults and click OK to adjust the page size to better fit the graph layers.
16. To the right side of the graph, click once to select the axis titles and the blue Y axis, then drag to
reposition them so that they don't overlap one another. Your graph should now look something like
this:
1119
Tutorials for Origin
6.9.4.1 Summary
This tutorial will demonstrate how to create a graph with stack lines by Y offsets.
1120
Graphing
6.9.4.3 Steps
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
1. Open the Tutorial Data project and browse to folder Stack Lines by Y Offsets in Project Explorer.
2. Highlight all the columns in the data worksheet of Book6A, and choose menu Plot: Y-offset/Waterfall:
Stack Lines by Y Offsets to create a graph with stack lines by Y offsets.
1. Delete the following objects by selecting them and pressing the Delete key on your keyboard:
Legend
Y axis
Y axis labels
Y axis title
X axis title
1121
Tutorials for Origin
2. Double click on the X axis to open the Axis dialog. On the Scale tab, change the value of To to 10.
Click OK to close the dialog.
1122
Graphing
1. Click the Rectangle button on the Tools toolbar and then create a rectangle on the graph.
2. Double click on the rectangle to open its properties dialog. Change the following settings.
Dimensions tab
Units = scale
Left = 0.25
Top = 9000
Width = 3.5
Height = 4000
1123
Tutorials for Origin
5. Double click on the scaler to open the Scaler Properties dialog. Set the following properties in the
dialog:
Font Size = 24
X branch
Length(Scale) = 2
Title = 2
Y branch
Position = Right
Length(Scale) = 2500
Title = 2500
1124
Graphing
1. Click on the top data plot (purple one) twice to select it. (Click only once will select the whole group):
1125
Tutorials for Origin
1126
Graphing
Note: an alternative is to go to the Offset tab in Plot Details dialog and change the Y offset.
6.9.5.1 Summary
This tutorial will demonstrate how to merge and customize two graphs.
1127
Tutorials for Origin
6.9.5.3 Steps
1. Create a new worksheet. Click the Import Single ASCII button and import the
Vertical_2_Panel_Line.txt file under <Origin EXE Folder>\Samples\Graphing path.
1128
Graphing
2. Select column 2 to column 4 and click the Line + Symbol button on the 2D Graphs toolbar.
1129
Tutorials for Origin
Go back to the worksheet. Select column 5 to column 8 and click the Line + Symbol button on the 2D
Graphs toolbar to create a new graph as shown below:
3. To merge the two graphs, select Graph: Merge Graph Windows from the menu. Accept the default
settings and click OK. The two graphs will merge in one window:
1130
Graphing
4. Ensure that Layer 1 is selected on the top left corner of the graph and double-click on the Y axis of
Layer 1 to open the Axis dialog. In the Scale tab, set the dialog options as shown below:
5. Click Horizontal icon on the left panel, and go to Tick Labels tab, uncheck the Show box to hide
the tick labels in Layer 1 and click OK to apply settings.
1131
Tutorials for Origin
6. Delete the X axis title in Layer 1. Set the same scale for the Y axis of Layer 2. The graph should now
appear as shown below:
1132
Graphing
7. Apply a theme to add a top X axis and a right Y axis. Select Tool: Theme Organizer from the main
menu to open the Theme Organizer dialog. Activate the Graph tab and select the Opposite Lines
from the table and click the Apply Now button. Use the Close button to close the dialog.
1133
Tutorials for Origin
8. Select the Legend of Layer 1 and right-click on it to select Properties from the short-cut menu. Set
the dialog options as shown below:
9. Select the Line button from the Tools toolbar and draw a line on the Layer 1 as shown in the sample
image. Hold down the SHIFT key while drawing to ensure that the line is vertical. Double-click on the line
to open the Properties dialog of the line object. In the Line tab, select Dash in the Type drop-down list
and enter 2 in the Width edit box. Activate the Control tab. Select both the Horizontal Movement and
the Vertical Movement check boxes. Click the OK button to finish.
10. Repeat steps 8-9 for Layer 2.
11. Select the Text button in the Tools toolbar. To add a title for the graph click in the middle of the
graph and enter Cigarette Smoking by Persons 18 Years and Over in the United States.
Double-click on the Y axis title of Layer 1 and Layer 2 and enter Percent Who Smoke.
1134
Graphing
6.9.6.1 Summary
This tutorial will demonstrate how to create a 4-Y plot and add recession bars.
1135
Tutorials for Origin
6.9.6.2 Steps
1. Create a new workbook, click the Import Single ASCII button and import the multi_axis_plot.txt
file under <Origin EXE Folder>\Samples\Graphing path.
2. Place the mouse cursor near the top left corner of the worksheet. When the cursor changes to a
down-right arrow, left-click to select the whole worksheet.
1136
Graphing
3. Right-click and select Set as: XY XY from the short-cut menu to set proper plotting designations for
the worksheet columns.
4. Highlight all the columns. From the main menu, select Plot: Multi-Y: 4Ys YY-YY to create a plot as
shown below:
1137
Tutorials for Origin
5. Double-click on the graph to open the Plot Details dialog shown below. In the left panel, select the
second plot in Layer 1 and set the Plot Type option at the bottom of the dialog as Line. In the right
panel Line tab, choose the settings shown below and Apply.
1138
Graphing
6. Select the Pattern tab. Set the dialog options as shown below and click OK.
1139
Tutorials for Origin
7. Ensure Layer 1 is selected in the top left corner of the graph and double-click on the bottom X axis to
open the Axis dialog for Layer 1. On the Scale tab, change the dialog options as shown below and
Apply.
8. Go to Tick Labels tab, change the dialog options as shown below and Apply.
1140
Graphing
9. Go to Line and Ticks tab, click the Top icon on the left panel and check Show Line and Ticks. Then
choose In for Style under Major Ticks and None for Style for Minor Ticks and click OK to apply
settings.
1141
Tutorials for Origin
10. Click on the legend to select it and use the mouse to drag it to the desired position.
1142
Graphing
6.9.7.1 Summary
This tutorial will demonstrate how to create a graph showing the energy-level structure of the Er3+ ion in a
YAG crystal.
1143
Tutorials for Origin
Merge graphs
6.9.7.3 Steps
1. Start with an empty worksheet and use the Single Import ASCII icon to browse to the
\Samples\Graphing subfolder of the Origin program folder, and import the file
Van_Rudd_Er_Energy_Levels.txt.
2. Highlight column B and create a symbol plot by selecting menu Plot: Symbol: Scatter.
3. Double click the data points scatter to open the Plot Details dialog. In the Symbol tab of the right
panel, change the symbol and symbol color as shown below:
1144
Graphing
4. In the Drop Lines tab, check the Horizontal box and set Width to 1. Click OK to apply the changes.
1145
Tutorials for Origin
5. Double click on the X axis to open the Axis dialog. Set the X axis scale from 0 to 1 in the Horizontal
icon in Scale tab :
1146
Graphing
6. Go to the Line and Ticks tab, Tick Labels tab, and Title tab respectively, make sure Bottom icon is
selected and deselect the Show Line and Ticks or Show box to hide all elements in the bottom X
axis including line & ticks, labels and title:
7. In the Vertical icon in Scale tab, set the following for the Y axis scale: From: 0, To: 24000, Value(in
Major Ticks Group): 2000.
8. Go to Left icon in Title tab, change the Text for the Y axis title to Energy Levels (cm\+(-1)):
1147
Tutorials for Origin
9. Go to the the Left icon in Line and Ticks tab, select In from the drop down menu for Major Ticks
and Minor Ticks:
1148
Graphing
10. Use OK to save the axis settings. Delete the legend object in the graph by selecting it, right-clicking
and choosing delete from the drop down menu. The graph should appear as shown below:
1149
Tutorials for Origin
11. Highlight cell 1-8, cell 9-15, cell 16-21, cell 22-26, cell 27-31, cell 32-43, and cell 44-48 respectively, to
plot scatter graphs by selecting menu Plot: Symbol: Scatter and then repeat step 3 through step 11 to
make another 7 graphs. Set the increment value of the Y axis (step 7) to 100, and the From and To
values as 0 to 600, 6500 to 6900, 10200 to 10500, 12300 to 12800, 15200 to 15600, 18300 to 20800,
22200 to 22700, respectively. The Title in Y axis (step 8) are also different and should be set as \+(4)I\-
(15/2), \+(4)I\-(13/2), \+(4)I\-(11/2), \+(4)I\-(9/2), \+(4)F\-(9/2), \+(4)F\-(7/2) \+(2)H2\-(11/2)
\+(4)S\-(3/2), and \+(4)F\-(3/2) \+(4)F\-(5/2), respectively. Then set the Y axis Major Ticks and Minor
Ticks to None.
12. In order to change the rotation angle of the Y title created in step 9, select the Y title, choose
Properties from the right-click menu and set the Rotate(deg.) to 0 in the Object Properties
dialog that opens.
1150
Graphing
13. Activate one of the graphs and select menu Graph: Merge Graph Window. Change the settings as
shown below and click the OK button to merge the 8 graphs previously created.
1151
Tutorials for Origin
14. Double click on the merged graph to open the Plot Details dialog. In the Size/Speed tab of Layer 1,
change the Layer Area as shown below:
15. Set the other layers' sizes to 15 x 15 (Width and Height in step 15), and move them to the desired
position. Adjust the size of the Y axis label and add the corresponding arrows and circles. The graph
should appear as shown below:
1152
Graphing
6.9.8.1 Summary
All child windows in Origin, with the exception of the Notes window, are created from template files. These
template files describe how to construct the window. For a graph window, the template file determines all page
and layer characteristics, such as page size, number of layers, inclusion of text labels and data plot style
information to name a few.
6.9.8.3 Steps
1153
Tutorials for Origin
1. Click the New Project button on the Standard toolbar, to begin a new project.
2. Open Import Wizard using the Import Wizard button on the Standard toolbar. (Note that if this is the
first time that you have started the Import Wizard, you will experience a slight delay as Origin compiles
the necessary files.)
3. Verify that the ASCII radio button is selected in the Data Type group.
4. Click the browse button to the right of the File text box. Navigate to the Origin folder; browse to the
Samples folder and then the Curve Fitting folder. Select Step01.dat from the list of files.
5. Click the Add File(s) button and save changes with OK.
6. Leave the Import Filters for current Data Type as Data Folder: step. (This filter has the settings to
use when importing the file.)
7. Click the Finish button. The data file imports into the worksheet.
1. Highlight the entire worksheet of data. (Note that you can select an entire worksheet by placing your
cursor in the blank area in the upper left corner of the worksheet. When the cursor becomes a downward
pointing arrow, click once to select the entire worksheet.)
2. Select Plot:Multi-Panel:9 Panel. A new 9 layer graph with 9 graphs is created.
3. Select the empty graph and ensure the 9th layer on the top left corner of the window is selected. Pressing
the Delete key will now delete this graph and this layer leaving 8 graphs on 8 separate layers behind.
4. Select Graph:Layer Management. In the Layer Management dialog that opens select the Arrange
tab.
5. Set Number of Rows to 4 and Number of Columns to 2.
6. Clicking the Apply button gives a preview in the small window on the right side of the dialog, showing a
2x4 arrangement.
7. Click OK to save the changes.
The goal is to save this 8 panel graph as a template; i.e. a new plot type, so that it can be used again with
new similar data. Since the template will also save plot style information, we will customize the graph a bit
further.
1. Select File:Save Template As. A dialog opens allowing you to choose the category that the template will
be saved in as well as the name given to the new template.
1154
Graphing
2. Change the Template Name to PAN8. (Note that the Template Name that appears when the dialog
opens is the name of the original template that was used to create the graph.)
3. Select the option Mark as Cloneable Template.
4. Click OK.
6.9.9.1 Summary
1155
Tutorials for Origin
Origin can be used to create a three panel graph with inset plots similar to the image shown below:
Use the Plot Setup dialog to create curves on one graph using data from multiple workbooks.
6.9.9.3 Steps
1156
Graphing
3. Ensure that nothing is selected in either workbook and click the line button on the 2D Graphing
toolbar.
4. This will bring up the Plot Setup dialog box.
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
1157
Tutorials for Origin
5. Under Available Data select the Worksheets in Folder option from the drop-down list. This will ensure
that in the panel to the right, data is available from all the workbooks in the current folder.
6. Make sure that the Original name: BOS worksheet is selected as shown above. In the center panel
enable the box corresponding to X and A4 and the second box corresponding to Y and B4.
7. This will set col(A4) as the X values and col(B4) as the Y values regardless of column designation in the
workbook. Select Add and a new curve will be created in the pre-existing Layer on the third panel:
1158
Graphing
10. On the second panel, select the check boxes as shown below:
11. Select Add and the plot will be added to the Layer in the third panel. Select OK to close the dialog box.
Your graph should look like the one shown below:
1159
Tutorials for Origin
12. Activate one of the workbooks and follow the procedure above to create two more graphs using the
following designations in the Plot Setup dialog (remember to change the plot type to Scatter for the data
from Measured):
Graph 2 Graph 3
Measured C D Measured A B
1. Select the Add Inset Graph With Data button on the Graph toolbar to add an inset graph to each
graph. Each inset graph appears on its own layer and each graph can be customized, zoomed, panned and
moved around like the full-size parent graph it was created from.
1160
Graphing
1. From the Origin menu select Graph: Merge Graph Windows: Open Dialog. Alternatively select the
1. Double-click the first graph to open the Plot Details dialog box.
2. Use the button to expand the left panel. Click on the arrow next to the Layer1 icon to expand it and
show the layer 1 contents.
3. Select the plot [ Measured ]Sheet1!E[ X ]... and on the Symbol tab, change the symbol to a circle,
the Size as 5 and the Symbol Color to Red as shown below. Select Apply.
1161
Tutorials for Origin
4. Select the plot [ Fitted ]Sheet1!A4[ X ],B4... and on the Line tab set the line color as Blue.
5. Click OK to exit the dialog box.
6. The next step is to apply this color scheme to all the parent graphs and inset graphs to avoid
manually changing them all. Right-click on the customized graph and from the context menu select
Copy Format: All Style Format:
7. Right-click on each remaining graph and select Paste Format from the context menu.
1162
Graphing
Beginning with Origin 2018b, you can use the Plot Details Common Display controls
for simultaneous editing of layer, plot and axis properties in a multi-layer graph. For
more information, see The (Plot Details) Layers tab controls.
6.9.9.3.5 Using the Layer Management Dialog Box to Link and Customize Axes
The next step is to set the scales on the axes and add axis breaks to show the important parts of the graphs.
1. Select Graph: Layer Management. In the dialog box that opens there will be a panel named Layer
Selection on the left. It lists all six of the layers in this graph - 3 for parent graphs and 3 for inset graphs.
2. In order to customize one parent graph axis and have the changes implemented on the other two
parent graphs, the axes are linked in the Link tab. The first Layer cannot be linked so it is the one
that is customized and the other graphs are linked to it. Select Layer 3 and in the Link tab set Link
to as 1 and set X Axis Link and Y Axis Link as Straight[1 to 1] as shown below:
1163
Tutorials for Origin
3. Click Apply.
4. Do the same for Layer 5 and click Apply.
5. Click OK to exit the dialog box.
6. Double-click any axis on the first graph to open the Axis Dialog.
7. Go to Horizontal icon in Scale tab, set From and To to -250 and 1500. Set the Increment Value on
the Major Ticks section as 250.
10. On the same page, clear the Auto check box for Position (% of Axis Length) and set it as 75.
1164
Graphing
11. Go to Vertical icon in Scale tab, set the scale as From: 0, To: 0.22 with increments of 0.1.
12. Select OK. All three graphs will now reflect your changes.
1165
Tutorials for Origin
13. To customize the Inset Graphs, zoom into the first one on Layer2 using the Zoom Pan button on
the Tools toolbar. Use the mouse wheel to zoom in.
14. Once zoomed in, select the Pointer button on the Tools toolbar to exit the zoom mode. Double-
click on the Inset Graph to open the Plot Details dialog. Select the [Measured]Sheet1!E[X]... graph
and on the Drop Lines tab, check the Vertical box. Click OK.
1166
Graphing
18. Select OK to exit the dialog box. Select the tick labels on the left Y axis and press Delete to remove
them. Do the same with axis labels.
19. Press CTRL+W to zoom out and return to normal graph size.
20. Select the customized Inset Graph, right-click and choose Copy Format: All Style Formats from the
context menu.
21. Select, right-click and Paste Format to the other two Inset Graphs, to duplicate the drop lines settings.
22. Repeat the last two steps, this time selecting Copy Format: Scales to duplicate the axis settings.
1. Activate the first Layer by clicking the layer icon on the top left corner of the graph. Right-click on the
graph and from the context menu choose Add/Modify Layer Titles. Type Wurtzite GaN in the box
that opens, change the font size and type face as desired and drag to an appropriate position:
2. Select the legend objects for the second and third graphs and press DELETE.
3. Select the remaining legend, right-click and choose Properties. In the Text tab of Object
Properties dialog box, type Fitted in place of %(1) and Measured in place of %(2). Place both on
the same line. Set the font size as desired. Go to Frame tab, and set the Frame to None. Click OK
and drag the legend object to an appropriate place.
1167
Tutorials for Origin
4. Delete the first and third Y-axis titles. Double-click the second one and type Intensity [arb. units]. Do
the same for the single X-Axis title, labeling it Energy Loss [cm-1].
5. Right-click on the graph and choose Add Text from the context menu or choose the button on
the Tools tool bar. Add text objects as shown below. Use the button for writing subscripts:
6. Select each of the inset graphs and change size or position as desired. Use the button on the
Tools toolbar to create arrows where desired on the Inset Graphs:
1168
Graphing
1169
Tutorials for Origin
6.10 Contour
6.10.1 Contour
XYZ Contour
Contour Plots and Color Mapping
Ternary Contour
6.10.2.1 Summary
This tutorial will show you how to create a contour from XYZ data.
1170
Graphing
Prior to Origin 2018 SR0, the application of a custom boundary sometimes generated
an imperfect fill at boundary margins. This has been improved in 2018. The user can
restore the previous contour-fill behavior using system variable @TCSM.
6.10.2.3 Steps
This tutorial is associated with the 2D and Contour Graphs project:\Samples\2D and Contour Graphs.opj
(Note: Users with Origin 2017 and later will find this data in Origin Central (press F11 to open) under Graph
Samples > Contour Plots).
1. Open the 2D and Contour Graphs: Contour: XYZ Contour folder in the Project Explorer. Activate
Book1B and highlight column D and then click Contour-Color Fill button from the 3D and Contour
Graphs toolbar.
1171
Tutorials for Origin
2. Double-click on the contour plot to bring up Plot Details dialog. Select the Contouring Info tab and
set the options in the dialog as the screenshot below:
3. Select the Color Map/Contours tab, click the Level heading and set the dialog as the following
screenshot shows:
1172
Graphing
o Click the Fill heading, select Load Palette and then select Rainbow from the Palette list and
click OK to close dialog.
o Click the Lines heading, make sure that Show on Major Levels Only is selected. Select the
Color check box under Apply to All and choose LT Gray from the drop-down list as contour line
color. Click OK to close dialog.
o Click on the line at value 30 to customize it separately and click OK to close dialog.
1173
Tutorials for Origin
4. Then go back to the Colormap / Contours tab, clear the check box Follow Contour Line under
Boundary so that the boundary line could have separate style.
5. Click OK to close the Plot Details dialog, then select Format: Axes: X Axis... to open the Axis dialog.
Then do the following things.
o Select the Scale tab and make sure the Horizontal axis icon is selected so X axis scale is being
updated, set From, To equal to -127, -65.
o Select the Vertical axis icon to customize the Y axis scale, set From=23, To=50.
6. Click OK to apply the setting and close the Axis dialog.
7. Now we are going to change the layer size/aspect ratio and turn off the XY axes and its frame. Make
sure the graph window is active and select Format:Layer Properties to open the Plot Details -
Layer Properties dialog, first go to the Size/Speed tab and change the values in Layer Area as
below:
1174
Graphing
8. Go to the Display tab and clear the X Axes and Y Axes check boxes under Show Elements. Click OK to
apply the setting and close the dialog.
9. Right click on the white space in graph layer and select Fit Page to Layers, accept the default dialog
settings and click OK to make all elements visible.
10. In the graph, select the axis title object Latitude and Longitude, hit the Delete key to remove them
from the graph.
11. Now we will customize the color scale object. Double-click on the color scale to bring up the Color Scale
Control dialog. Then do the following settings:
1175
Tutorials for Origin
1176
Graphing
1177
Tutorials for Origin
1178
Graphing
o
12. Click OK to apply the settings and close the Color Scale Control dialog.
13. Right-click above the contour plot and select Add Text to add a graph title 30-Year Mean
Temperature for the Month of January. Use the Format toolbar and/or double-click on the completed
text label to update the font, font size, etc. The graph should look like
1179
Tutorials for Origin
6.10.3.1 Summary
Origin offers rectangular, polar, and ternary contour plots. For rectangular contour plots, the data can be
either in a matrix or in a worksheet in XYZ format. Polar contour plots can be generated from three columns
of data in a worksheet, organized either as R Z or R Z. Ternary contour plots can be generated from
worksheet data organized in X Y Z Z format where the 2nd Z-column contains the 4th parameter which is the
height value at a given XYZ point in the ternary space.
Many options are available for customizing contour plots, such as setting different major and minor contour
levels, displaying contour lines only at major levels, applying color palettes, and also control for a custom
boundary in the case of contour plots created directly from the worksheet.
1180
Graphing
1. To create a new matrix click the New Matrix button . Move the cursor to the upper left corner
of the matrix until the shape of the pointer changes as in the following image and click to select the
entire matrix.
To set the dimensions, right-click and select Set Matrix Dimension/Labels in the context menu. On
the XY Mapping tab, change setting as shown below .
1181
Tutorials for Origin
2. Input data into the matrix by highlighting it and right-clicking. Select Set Matrix Values in the
context menu to open the Set Values dialog. Type i*sin(x) - j*cos(y) in the Formula edit box and
click the OK button to generate data. The matrix should look like this:
3. Each data point in the matrix corresponds to two different kinds of indices. One is the column and row
indices. The other is the X and Y coordinates. Select View: Show X/Y from the main menu to see
the X, Y coordinates:
4. You can also select View: Image Mode to show the image form of the matrix:
1182
Graphing
5. Select View: Data Mode to exit the image mode. Create a contour plot by activating the matrix and
selecting Plot: Contour/Heatmap: Color Fill. The graph should appear as shown below:
Origin makes it easy to customize every aspect of the contour plot, including the color scale and adding labels:
1183
Tutorials for Origin
1. Double click on the contour plot to open the Plot Details dialog. Make sure the left panel is expanded by
clicking on the arrow button on the bottom left of the dialog. Click on Layer1 in the left panel (leave the
check-box checked, and click on the word itself), and select the Size/Speed tab in the right panel.
Disable the Matrix data, maximum points per dimension box to turn off Speed Mode.
2. Expand the Layer option in the left panel and select [MBook1]MSheet1!1(Z)(1:10201) under it to
open the matrix level options. Select Colormap/Contours in the right panel and click on the Level
heading to open the Set Levels dialog. Click the Find Min/Max button and set Major Levels to 8
and Minor Levels to 32. Click the OK button.
3. Now load a palette for the contour. Click on the Fill heading. In the dialog that opens, select the Load
Palette radio box. Click the Select Palette button and select the Rainbow palette from the drop-
down. Click OK.
1184
Graphing
4. Click the Line heading to open the Contour Lines dialog. Check the Show on Major Levels only box
and click OK. Then click the OK button to close the Plot Details dialog.
5. Set the properties for the color scale. Right click on the color scale and select Properties from the
context menu to open the Color Scales Control dialog. Select Levels in left panel, select All Major
Levels for the Show on drop-down list.
1185
Tutorials for Origin
1186
Graphing
7. Click twice on a contour line (two separate single clicks) to select all lines at that level. Change the
color to Green by using the Line/Border Color button in the Font toolbar. Change the width
Make sure only one contour line is selected (not all the contour lines at that level) and right click on
the selected contour line. Select Add Contour Label to add a label.
1187
Tutorials for Origin
8. Click twice on a contour line to select it, right click and select Extract Contour Lines. Origin will
extract the data for that contour line to a worksheet. The following image shows part of the data in
the worksheet:
Origin can create contour plots directly from XYZ data in a worksheet without the need for an intermediate
matrix. Delaunay Triangulation is used to compute and draw the contour lines.
1. Create a new worksheet and import the 3D XYZ.dat from the \Samples\Matrix Conversion and
2. Highlight the third column and right click on it to select Set As: Z. Select Plot: Contour/Heatmap:
Color Fill to create a graph as in the following image:
1188
Graphing
1. Show the triangulation grid that is used to create a contour plot from the data. The individual data points
are located at the nodes or vertices of the grid. Create a new worksheet and import the XYZ Random
Gaussian.dat file from the \Samples\Matrix Conversion and Gridding folder by using the Import
2. Highlight the third column and right click on it to select Set As: Z. Select Plot: Contour/Heatmap:
Color Fill to create a graph.
1189
Tutorials for Origin
3. Double click on the contour plot to open the Plot Details dialog. On the Colormap/Contours tab,
click on the Line heading to open the Contour Lines dialog. Deselect Shown on Major Levels Only
and select Hide All to hide all the contour lines. Click OK to close this dialog. Then select the Show
Grid Lines and Show Data Points check boxes. Click OK to close the Plot Details dialog.
The contour plot with its superimposed grid should look like this:
1190
Graphing
A custom boundary can be applied to contour plots created directly from XYZ data where user provides the
data points for the boundary in additional columns of the same worksheet. This feature is useful when there is
a specific boundary data that defines the outline of an object, for example the profile of an engine where the
contour shows engine temperature.
1. Continue to use the worksheet and the contour plot that was created with the XYZ Random
Gaussian.dat in the previous example.
2. In the XYZRandomGaus workbook, click the Add New Columns button twice to add two columns.
Highlight the two columns and right click on them. Select Set As: XY XY from the context menu and
enter four rows of data such as below:
12 10
18 12
16 18
14 16
1191
Tutorials for Origin
3. Double click on the contour plot to open the Plot Details dialog. Select the Contouring Info tab in the
right panel. Set the dialog as in the following image to customize the boundary for the contour plot.
Remember to uncheck the Show Grid Lines and Show Data Points check boxes in the Color
Map/Contours tab. Click OK to close the Plot Details dialog.
4.
Prior to Origin 2018 SR0, the application of a custom boundary sometimes generated
an imperfect fill at boundary margins. This has been improved in 2018. The user can
restore the previous contour-fill behavior using system variable @TCSM.
1192
Graphing
6.10.4.1 Summary
This tutorial will show you how to create a Ternary Contour graph and to overlay a scatter plot.
6.10.4.3 Steps
1193
Tutorials for Origin
1. Open Tutorial Data.opj and browse to the Ternary Contour folder in Project Explorer (PE).
2. Activate Book1A, highlight the entire worksheet and select Plot: Contour: Ternary Contour to create a
Ternary Contour graph. The graph should look like this:
3. Now we will overlay a scatter plot on the ternary contour graph. Right-click on the layer icon and select
Plot Setup from the context menu. This opens the Plot Setup dialog box.
4. In the upper-left corner of the dialog box, set Available Data to Worksheets in Folder. Select Book1,
set Plot Type to Scatter and select check boxes to the left of columns A, B and C so that they plot as X,
Y and Z, respectively. Click Add to add the scatter plot to Plot list at the bottom of the Plot Setup dialog
1194
Graphing
box. The settings should duplicate those shown in the following image:
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
5. Now we will customize the contour graph and the scatter plot. Double-click on the contour plot to bring up
the Plot Details dialog box.
1195
Tutorials for Origin
6. Select the Color Map/Contours tab, click on the Level heading, then duplicate the settings as shown in
the image.
7. Click OK to close the Set Levels dialog box. Click on the Fill heading to open the Fill dialog box. Select
Load Palette. Select Rainbow from the Palette list and click OK.
8. In the left panel of Plot Details, select the scatter plot and customize the symbols as follows (note that to
enable the Fill Color list, you must click the downward-pointing arrow beside Preview and choose one of
1196
Graphing
1197
Tutorials for Origin
10. Drag the color scale to resize it and move it to a suitable place on the graph. The graph should now look
something like this:
6.10.5.1 Summary
This tutorial will show you how to create a Word Map by combining Line Plot and Contour graph.
1198
Graphing
6.10.5.3 Steps
1. Open Tutorial Data.opj and browse to the Map Combining Line and Contour Plots folder in Project
Explorer (PE).
2. Activate MBook1A matrix and highlight entire matrix. Select Plot: Contour/Heatmap: Contour -
Color Fill to create a contour graph.
1199
Tutorials for Origin
3. At this step, we will add a Line plot to the contour graph. Select Graph: Layer Contents to open the
dialog. In the top-right available data drop-down list of the dialog, choose Worksheets in Folder.
Select B(Y) column of the Book5 in the left panel, choose Line plot type, and add to the right panel.
Then click OK button. Delete the legend for the added line plot.
1200
Graphing
4. In the following steps, we will customize the graph. Select Format: Layer Properties to open the Plot
Details dialog. Select the Size/Speed tab, disable two checkboxes that in the Speed Mode, Skip Points
if needed group.
5. Expand the Layer1 branch and select contour plot in the left panel of the Plot Details dialog. Then do the
following things:
o Go to the Color Map/ Contours tab, click the Level heading to open the Set Levels dialog. Set
the dialog as the following image shows:
o Click OK button to close the dialog. Click the Fill head to open the Fill dialog, select Introduce
Other Colors in Mixing radio box. Then set From to Orange and To to Navy.
o Click OK button to close the dialog. Click the cell the in the Fill column and <0.5 row to set fill
color to Red.
1201
Tutorials for Origin
o Click OK button to close the dialog. Click the cell the in the Fill column and >7 row to set fill
color to Black.
o Click OK button to close the dialog. Click the Lines heading to open the Contour Lines dialog,
uncheck the Show on Major Levels only check box and then select the Hide All option.
o Click OK button to close the dialog. Click the Color box that in the Missing Value group, set fill
color to White. Click OK button.
1202
Graphing
6. Go to Numeric Formats tab of Plot Details dialog, select Decimal Places radio box and keep the
default value 1.
7. Click Ok button to apply the settings to the graph. The graph should look like:
1203
Tutorials for Origin
Double click on the Color Scale to open the Color Scale Control dialog and go to the Layout page, do
the following setting:
1204
Graphing
1205
Tutorials for Origin
8. Resize and reposition of the color scale. Then modify the X, Y axis tick labels, titles and add the graph
title as the example graph shows. The graph should look like
6.10.6.1 Summary
This tutorial will show you how to create a contour from XYZ data and add Z value as label for each XY data
point.
1206
Graphing
6.10.6.3 Steps
2. Highlight col(C) and set it as Z. Then highlight all columns and select Plot: Contour/Heatmap:
Color Fill from the main menu to plot a contour graph.
1207
Tutorials for Origin
3. Double-click the layer icon to open the Layer Contents dialog. In this dialog, select col(B) in the left
panel, set the Plot Type as Scatter, then add it to the right panel.
4. Click OK button to close the dialog. The scatter plot will be added to the contour graph.
1208
Graphing
5. Double-click the graph to open the Plot Details dialog. In this dialog, go to the Colormap/Contours
tab, the contour plot in the left panel is selected. Click the Level... header to open the Set Levels
dialog to set the Minor Levels as 4.
1209
Tutorials for Origin
6. Click OK button to go back the Plot Details dialog. Go to the Label tab while the scatter plot is
selected in the left panel, check the Enable check box to activate this tab. Set the Size as 12,
Position as Below and Label Form as Col(C).
1210
Graphing
7. Click OK button to close this dialog. The Z values will be added as labels to the graph. Click the Rescale
6.10.7.1 Summary
This tutorial will demonstrate how to create a contour plot with vectors overlay.
6.10.7.3 Steps
1. Open Tutorial Data.opj and browse to the Contour Plot with Vector Overlay folder in Project
Explorer (PE).
1211
Tutorials for Origin
2. Activate the W147 matrix and select Plot> 2D: Contour: Contour - Color Fill in the menu. The graph
below will be created:
3. Select Format: Plot Properties to bring up the Plot Details dialog. In the Colormap/Contours tab
customize the Contour settings as shown below:
o Click the Level heading to set the following levels at the Set Levels dialog:
1212
Graphing
o Click the Fill heading to select Load Palette, and choose Temperature from the Palette list in
Fill dialog. Click OK.
o Click the Line heading, enable the Color check box under Apply to All and choose Gray in the
Color drop-down list. Click OK.
1213
Tutorials for Origin
4. Go to Label tab, select the Significant Digits radio button and set the value to 1. Click OK.
5. Let's make preparations for the third section Merge the Two Graphs. First, we am going to hide the
axes. Select Format: Layer Properties and in the Display tab deselect the X Axes and Y Axes check
1214
Graphing
1215
Tutorials for Origin
1216
Graphing
o In the Title page, enter w(ms\+(-1)) in the Title box and set Font Size to 26.
1217
Tutorials for Origin
o In the Line and Ticks page, uncheck Show Line and Ticks on Right and Show Border check
box
o Click OK and position the color scale in the desired location on the right side of the graph by
selecting and dragging it.
1218
Graphing
1. Activate the WOR81147 worksheet, highlight the last three columns and select Plot > 2D: Vector:
Vector XYAM in the menu.
2. Double-click on any vector to bring up the Plot Details dialog on the Vector tab. Use the settings shown
below:
1219
Tutorials for Origin
1220
Graphing
o On the Scale tab, choose Vertical icon in the left panel of Axis dialog. Set the scale of Y as
From = 5, To = 95, and Value of Increment = 10.
o Go to the Line and Ticks tab in the Axis dialog. Press Ctrl key to select the Top and Right icon
in the left panel. Then check Show Line and Ticks check box, and set the Style of Major Ticks
1221
Tutorials for Origin
and Minor Ticks to In. The top X and right Y axis will be shown with line and ticks.
o Click OK.
4. At this stage, you may notice that the vectors extend outside the axes (layer frame). To make sure they
display within the layer frame, select Format: Layer Properties and in the Display tab check the Clip
1222
Graphing
5. Right-click on the legend of the vectors graph, and select Properties... in the context menu to open the
Object Properties. Set the dialog as shown below:
1223
Tutorials for Origin
1224
Graphing
The contour and vector graphs are generated by the steps above, and are ready to be merged into one.
1. Minimize or Hide all other graphs except for the contour and vector graphs created using the instructions
above. With one of the two graphs active, select Graph: Merge Graph Window... from the main menu.
2. In the Merge Graph dialog, specify the settings as the following:
o Expand the Arrange Settings node, and set the Number of Rows as 1.
o Expand the Spacing (in % of Page Dimension) node, and enter a value of approximately "25"
in the Right Margin text box to show the color scale legend from the contour plot. Click OK.
Or
o Use Theme Organizer to create and apply a font theme to the current graph.
1225
Tutorials for Origin
6.10.8 Create Heatmap with Virtual Matrix and Colormap Bar Plot
6.10.8.1 Summary
1226
Graphing
This tutorial create two kinds of graph, a Heatmap Plot based on a virtual matrix together with a Bar Plot with
Color Map, and merged them together.
6.10.8.3 Steps
1227
Tutorials for Origin
1. Open the Tutorial Data.opj and browse to the folder Heatmap and Virtual Matrix Manager. Open
workbook Electricity Usage with first sheet active.
2. The XYZ mapping of workbook is shown in graph below, this will help you to understand how the Heatmap
plot is created in next steps:
3. Highlight all cells in Z region. In order to quickly select all, select the Cell in Column(B)-Row 1 and use the
worksheet scroll bars to show the cell in last column and last row, hold Shift key and click this cell to
select all. click Plot: Contour/Heatmap: Heatmap in main menu to open the plotvm dialog for Heatmap
plot.
1228
Graphing
1229
Tutorials for Origin
5. In this dialog, check Format X Data and Format Y Data check boxes, click the button respectively to
format X and Y data following the graph below:
6. The tick labels in Y axis are too dense to be seen, so now we are going to change that. Double click the
axis in the graph to open the Axis dialog:
o Select Left icon in Tick Labels tab, go to Display tab, select Date as the Type, and set Display
drop-down list to Dec(Current Month), click Apply to save the setting.
1230
Graphing
o Go to the Table tab, check on Enable box, click Apply to save. You will find that the month
names are shown as tick labels for Y axis in the form of a table.
1231
Tutorials for Origin
7. Next, we will specify the scale and tick labels for X axis:
o Go to Bottom icon in Tick Labels tab, and make sure Time is selected as the Type in Display
tab, change the Display to hh pm, click Apply to save the setting.
1232
Graphing
o Go to Horizontal icon in Scale tab, make sure the settings resemble the screenshot below, click
Apply to save the setting. Click OK to close the dialog. Remove the title for X axis.
8. Click the tick labels for both XY aixs in the graph, change the font size to 10 via Format Toolbar.
9. Select Format: Plot Properties in main menu with Heatmap graph active.
o Set the Level for Colormap follows the graph below:
1233
Tutorials for Origin
o Click the Fill color of the Colormap on head cell(blue area) to set Fills follows the graph below:
1234
Graphing
o Scroll down to the Colormap tail, set its fill color to red in the same way.
o Click Save in Colormap/Contours tab to save the pattern as heatmap.oth which will be used in
the second parts of the graph.
1235
Tutorials for Origin
10. In the Plot Details dialog, click the first tree node in left panel (should be Graph1 by default),
change page size to 11*11 inch in Print/Dimensions tab, click Apply, then in the left panel, select
the sub tree node for Layer1, go to the Size/Speed tab, change the Layer area follows graph below,
click OK to apply the settings and exit the dialog:
1236
Graphing
11. We will turn off the speed mode by click the in Graph Toolbox to view the graph with higher
resolution. The finished graph for Heatmap should be similar to the graph below:
1237
Tutorials for Origin
Once the Virtual Matrix were created, they will be saved internally. You can browse them in
Virtual Matrix Manager. The saved Virtual Matrix can be used for Contour/Heatmap/3D
surface plot directly, you can select the virtual matrix from the input box of the plot dialog
as shown in graph below:
1238
Graphing
1. Go to the Temp sheet in Electricity Usage workbook, highlight the worksheet and select Plot:
Column/Bar/Pie: Bar in main menu to create a Bar plot.
2. Now, we will defined the style of axis:
o Double click the axis to open the Axis dialog, change the Scale of axis (X) follows the graphs
below in Vertical page of the Scale tab.
1239
Tutorials for Origin
o Then, change the Scale for axis(Y) in Horizontal page from -55 to 55 with Major Ticks value 25
and Minor Ticks counts 1, then click Apply.
1240
Graphing
o We will also hide the line and ticks for X axis in Line and Ticks tab by uncheck the box of Show
Line and Ticks. Besides, grids can be hide by using similar ways in Grids tab.
o Click OK to close the dialog.
o Change the Y axis title to CDD/HDD by double clicking on the Y title object and entering the in-
place edit mode. Delete the ticks labels and axis title of X axis by select it and hit Delete key.
3. Next, we will create the Colormap for the graph, the Colormap theme should be identical to the Heatmap
created before. Click the Format: Plot Properties in main menu to open the Plot Details dialog:
o Set the color for both Border and Fill as Map:Col(B).
1241
Tutorials for Origin
o Click the Level of the Colormap to set Levels follows the graph below:
1242
Graphing
Click OK to close the Set Level dialog and Click Apply in Plot Properties dialog to save the settings.
4. In the left panel, select the first tree node (by default, Graph2), change page size to 11*11 inch in
Print/Dimensions tab, click Apply, then switch to the Layer1 tree node and go to the Size/Speed
tab, change the Layer area follows graph below, then,click OK to close dialog:
1243
Tutorials for Origin
1244
Graphing
6.10.8.3.3 Merge the Heatmap Plot with Bar Plot and More Customization Steps
1. Select Graph: Merge Graph Window in main menu with Heatmap graph active, merge Graph1 and
Graph2 together, the Rearrange Layout should be unchecked, click OK to apply the setting.
1245
Tutorials for Origin
T
hen, you will resize the size of the merged graph (Graph3), click Format: Page Properties >>
Print/Dimensions tab, change the page size to 11*11 inch again, click OK. Click CTRL+W to adjust the
graph view.
2. Specify the style of the color scale:
o Double click the color scale to open the Color Scale Control dialog, set the Levels page as shown
in graph below:
1246
Graphing
1247
Tutorials for Origin
Click OK to apply the settings, drag the outline of the color scale in the graph to reach a proper size and
location.
3. Select the unwanted axis title or legend and delete them, add text object with graph information by using
text tool.
1248
Graphing
6.11 Statistics
6.11.1 Statistics
Box Plot
Grouped Box Chart with Color Indexed Data Points
1249
Tutorials for Origin
Q-Q Plot
Scatter Matrix
6.11.2.1 Summary
This tutorial demonstrates how to create the following box plot with the data points and distribution curves
both.
6.11.2.3 Steps
1250
Graphing
1. Open Tutorial Data.opj and browse to the Box Plot folder in Project Explorer (PE).
2. Activate the BoxData worksheet, select the January(Y), February(Y), and March(Y) columns and plot
them as a Box Chart using Plot>2D: Box: Box Chart.
3. Double-click on one of the box charts to bring up the Plot Details dialog. In the Group tab select None
from the Border Color drop-down list and use Apply to save the changes. This prevents the border
colors of the box plots from automatically incrementing.
4. In the Box Tab, set as shown below to enable the data plot to the left of box:
5. The Data tab shows up because data plot is also included in the plot. In this tab, change the settings
as shown below to create a distribution curve and change the binning options:
1251
Tutorials for Origin
6. In the Pattern tab adjust the settings as shown below. To create a custom color, expand the Color
option, click the vacant color under the Custom controls to open the Colors dialog. In the Custom
tab of this dialog box, enter the Red, Green and Blue values to define your favorite color as below:
1252
Graphing
7. In the Lines Tab set the line style for Whisker. The style of caps is set to "Auto" so it follows the
Whisker style, and the style for Median Line and Distribution Curve follows the box style set in the
Pattern tab:
1253
Tutorials for Origin
8. The next step is to customize the data symbols in the Symbol tab:
1254
Graphing
9. The style of the Percentile points is also changed in the Percentile tab:
1255
Tutorials for Origin
10. The next step is to change the background color. In the same Plot Details dialog, select Layer 1 in the
left panel to activate the tabs of layer level. If the left panel is not expanded use the button on the
bottom left of the dialog to expand it. In the Background tab, expand the Color option, click the vacant
color under the Custom controls to open the Colors dialog. In the Custom tab of this dialog box, enter
the Red, Green and Blue values to define your favorite color. Here, let us make the color(R:177, G:237,
B:254). Click OK to accept the setting and close the dialog.
11. In order to customize the axes, double-click on the Y Axis to open a Axes dialog box and on the
Scale tab, set the following axis scale specifications:
1256
Graphing
12. Go to the Title tab, select Left' icon in the left panel, change the Y axis title to Discharge
[ft\+(3)/sec]:
1257
Tutorials for Origin
13. On the Title tab, choose Bottom icon in the left panel. Then check the Show check box, and change
the X axis title to Month
1258
Graphing
14. Open the Grids tab, select Horizontal icon in the left panel, enable the Major Grid Lines and set
their styles as below:
1259
Tutorials for Origin
15. Click OK to save the settings and close the dialog. Select View: Show: Frame menu to add the frame to
this graph.
16. The legend can be deleted if desired by selecting it and pressing the delete key.
17. Right-click the layer and select Add/Modify Layer Title from the menu that appears. Enter the text
Water Discharge at Station 120011 in the edit box. Existing layer titles and axes titles can be modified by
double clicking on them till the text cursor appears.
6.11.3.1 Summary
Origin can be used to create grouped box plots from raw data with data points and distribution curves.
1260
Graphing
6.11.3.3 Steps
1. Open Tutorial Data.opj and browse to the folder Grouped Box with Index Color DataPoint.
2. Activate the workbook Book 5.
1261
Tutorials for Origin
4. On the 2D Graphs toolbar click the small triangle at the bottom of the sixth button to reveal the fly
out menu. Select Grouped Box Charts - Raw Data as shown below:
5. In the Plotting: plotgboxraw dialog, set the Group Number to 2, the 1st Group Row to
Comments and the 2nd Group Row to Long Name. This will create a box chart with the column
data arranged in three groups of two, with X axis row names derived from the Comments and the
Long Names on the worksheet:
1262
Graphing
6. Click the OK button. The grouped box chart from raw data is created with two grouping levels as
shown below:
7. To add data points in the graph, double click the plot to open the Plot Details dialog. Expand the Layer1
option on the left panel and select the first plot under it.
8. On the Box tab, set Type to Box[Right] + Data [Left]. Click the Apply button. This will add two
new tabs to the dialog: Data and Symbol
1263
Tutorials for Origin
9. To add a Distribution Curve, on the Data tab, set Distribution Curve Type to Normal. Set Bins
Alignment to Right to orient the curve.
10. Click the OK button. The data points and distribution curves will appear on the graph as shown
below:
1264
Graphing
1. Double click on the any one of the boxes to re-open the Plot Details dialog.
2. On the Group tab set both Border Color and Box Color to increment By One so each box in subgroup
has a different color.
3. Click the button on the Details section of Border Color. In the Increment Editor dialog that opens,
click the first color and change it to be Red. Change the second color to Gray. Click OK.
4. Click the button on the Details section of the Box Color to open the Increment Editor dialog. Click
1st color and click Define Custom Color button.
:
5. Set RGB values in Red, Green, Blue boxes on bottom right to be 255, 51 and 51, and click OK to close
dialog.
6. Do the same for the 2nd color. Set Define RGB value to be 143, 143 and 143, and click OK to close
dialog. Then click OK to close Increment Editor dialog and apply settings.
7. This step is to customize the descriptive statistic markers whether to show on the plot such as the 99%,
1%, Max and Min marks.
Go to the Percentile tab, and set the Edge Color to White and click Apply button. Since background of
the graph is also white, Max, Min, 99%, 1% will look like disappeared in graph.
On Percentile tab, users can also hide a Marker by setting the Type as
None(the last shape) in the dropdown list.
1265
Tutorials for Origin
8. On the Lines tab set the Color for the Whisker and the Caps to Gray and Median Line to White.
Click OK. The plot should appear as shown below:
1. Double click any box in the graph to open the Plot Details dialog.
2. On the Symbol tab. Set the Size to 5, the Shape to 2 Circle and the Interior to Open.
3. Click the Edge Color dropdown list and choose Indexing: Col(B):Machines. The symbol's edge
colors will be indexed to column B. All symbols with Machine value A386 will be one color and the
ones with C334will be a different color:
1266
Graphing
4. When symbol color is indexed, another tab Color List will appear in the dialog. To set a user defined
color increment list, go to the Color List tab. Enable the Use custom increment list box and set
the first two Color Values as Blue and Dark Cyan.
5. To customize the distribution curve color, on the Lines tab, set the Distribution Curve Color to Gray.
For grouped plots support multi-row tick label tables. The corresponding axis icons in the Tick Labels tab of
Axis dialog starts from the last table row, e.g. Bottom 1, Bottom 2, ..., Bottom N. This means the first row
from the bottom will correspond to Bottom1 and so forth.
1. To move the tick label row with SEG 1, SEG 2 and SEG 3 to the top X axis, double click on this tick label
row.
1267
Tutorials for Origin
2. This opens the Axis Dialog with the Bottom 1 axis icon selected. Right click the Bottom 1 icon on
the left panel and choose Move to Opposite.
3. Click the Apply button. The SEG 1, SEG 2 and SEG 3 tick label row will now appear at the top X axis on
the graph, and as the axis icon is renamed as Top 1 on the left panel in the dialog.
4. The previous Bottom 2 icon will become the Bottom 1 icon. Select the Bottom 1 icon. Go to the Table
tab. Set the Number of Rows to 3. Click the Apply button. Three identical bottom tick label tables will
appear on the graph and they are Bottom 1, Bottom 2 and Bottom 3.
5. To fill first bottom tick label row with light gray, select the Bottom 3 icon on the left panel, make sure you
are still at the Table tab and clear the Auto check box to enable separate control of tick label table
layout. Set Fill Color as LT Gray and deselect the Inside Border check box under Table Layout node.
6. The second row derives the labels from col(C) of the second worksheet A386_CC.MI. Select the Bottom
2 icon and go to the Display tab, set the Type to Text from dataset and set the Dataset Name from
the drop down as [Book5]"A386_CC.MI"!C"N".
7. Go to the Format tab and clear the Auto check box, change the Color to White. Then go to the
Table tab and set as the following:
1268
Graphing
8. Select the icon Bottom 1, go to the Display tab, set the Type to Text from dataset and then set the
Dataset Nameas [Book5]"C334_CC.MI"!C"N" since it uses col(C) from the third worksheet
C334_CC.MI.
1269
Tutorials for Origin
10. Select the Top 1 icon, go to the Table tab and set the table layout for top axis as below:
1270
Graphing
11. Then go to the Format tab, set Font Size to 22 and change the tick labels to Bold:
1271
Tutorials for Origin
1. Right click the box chart legend and select Legend: Box Chart Components... to open the
Enhanced Box Legend: legendbox dialog. Deselect all the components except for Data:
2. Click the OK button. The legend will show only the data symbols. Double click the legend text to go into
in-place edit mode. Delete the first row of the legend. Select and drag to move the legend object to a
better location.
3. To remove the black line around the legend, right click the legend object and choose Properties.... In the
Object Properties dialog, go to Frame tab to set Frame to None.
4. Origin doesn't support tick label table titles yet. But users can add text objects manually. Right click on
the white space to the left of the second bottom tick label row and choose Add Text... from the context
menu that appears. Type NA386=. Then, still in in-place edit mode, highlight A386 and click the
button on the Format toolbar to change it into subscript. Select and drag to adjust the positioning.
1272
Graphing
5. Add another text object NC334= to the left of the third tick label row and change C334 into subscript.
1273
Tutorials for Origin
You can click to select table labels and nudge them using the arrow keys on your
keyboard.
6.11.4.1 Summary
Origin's box plot is highly customizable. This tutorial shows how to create a I-Shaped box chart with
overlapping data points and customized percentiles.
1274
Graphing
3. Double-click on one of the plot boxes to bring up the Plot Details dialog box. Go to the Box tab and
set Type to Box + Data Overlap, Style to I-shaped Box and Whisker Range to Min-Max, and
check Outliers box.
1275
Tutorials for Origin
1276
Graphing
1277
Tutorials for Origin
1. Double-click on one of the plot boxes to bring up the Plot Details dialog box again. Go to the Group
tab and set Border Color Increment to None.
2. Go to the Symbol tab, set symbol Shape as 1 Square and Interior as Open, then set both Edge
Color and Fill Color to 15 Orange. Clear Follow line transparency and set the Transparency
slider to 80%.
1278
Graphing
3. Go to the Pattern tab and set Border Color to Purple and Width to 1.5.
1279
Tutorials for Origin
5. Go to the Percentile tab and duplicate the settings as shown below for Type and check Custom
Percentiles at <P, 100-P> box.
1280
Graphing
1281
Tutorials for Origin
1. Double-click on the X axis to open the Axis Dialog box. Go to the Scale tab and set Minor Ticks
Count to 1.
1282
Graphing
2. Go to the Format tab under Tick Labels page and hold Ctrl key to select both Bottom and Left
icons on left panel and set label Color to Black.
1283
Tutorials for Origin
3. Go to the Grids tab and click to select only Vertical icon on left panel and duplicate Minor Grid
Lines settings as shown below.
1284
Graphing
4. Go to Line and Ticks tab and click on the Top icon on left panel and check the Show Line and Ticks
box to show top axis.
5. Hold Ctrl key to select both Bottom and Top icons on left panel, duplicate settings as shown below
and click Apply to see your changes.
1285
Tutorials for Origin
6. To customize the Y Axis, go to Scale tab and click Vertical icon on left panel and duplicate the
settings as shown below.
1286
Graphing
7. Go to the Title tab and type Temperature (\+(o)F) into the Text box.
8. Go to Grids tab and check the Opposite box under Additional Lines node.
1287
Tutorials for Origin
9. Go to Line and Ticks tab and set Color under Line node to be Gray.
1288
Graphing
1289
Tutorials for Origin
1. Highlight all the columns in Book1. The global mean value will be calculated automatically and shown
on the Status bar.
2. Activate the graph window and select Graph: Add Straight Line from the menu. In addline dialog,
duplicate settings as shown below.
1290
Graphing
3. Right-click on an empty portion of the graph and select Add/Modify Layer Title. Type Weather History
for Boston, Fall (Sep, Oct, Nov)
4. Drag and re-position the axis and layer titles as needed.
There are another two approaches to add such a horizontal line at specified Y value in
Axis dialog:
Go to the Grid tab, select Vertical in the left panel and then enter the Y value
in the Y= text box under the Additional Lines branch. Please note, this option
only adds the line, you need add a special tick or just a simple text object to
mark this line.
1291
Tutorials for Origin
Go to the Reference Lines tab, select Horizontal icon in left panel, add a
reference line at Y=55.435 with the label, click Details button to set the style
of this line. You might need use the Style toolbar to change the color of the
text label.
6.11.5.1 Summary
Graphs in Origin are highly customizable. This tutorial will show how to customize the marginal histogram to
display distribution curves instead of columns.
1292
Graphing
Origin9.1 includes a special feature that allows you to set up different data filters in a single source worksheet
and to, for instance, graph data for each filter condition without destroying the previous plot. This is made
possible by copying filtered data to a new sheet and placing a "filter lock" on the filtered data.
6. In the colcopy dialog, enter 1992~1995!<new> in the Destination Columns text box as shown
below and click OK.
1293
Tutorials for Origin
7. In the newly created sheet, click the green lock in the Col(A) heading and select Worksheet Filters:
Lock.
8. Go back to the "automobile" sheet and repeat steps 4~7 twice more with Col("Year")'s filter conditions set
to 1996~1999 and 2000~2004, respectively. You need to type a sheet name in colcopy dialog manually
each time. The filter conditions are locked with each sheet, you can push them back using Worksheet
Filters: Push Back.
1. Go to sheet "1992~1995", highlight all columns and select Plot: Statistics: Marginal Histograms
1294
Graphing
2. Double-click any on any bar in the top histogram to open the Plot Details dialog. Go to the Data tab
and set Distribution Curve: Type as Normal. This is for Layer 2.
1295
Tutorials for Origin
3. Go to the Pattern tab and reproduce the settings shown below to hide bin bars.
4. Go to the Line tab and set Color to Black. Click Apply to see the changes.
1296
Graphing
1297
Tutorials for Origin
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
2. Select Layer 1 in lower panel. Set controls as shown below and click Add.
1298
Graphing
6. Click OK to close the Plot Setup dialog box and rescale the graph.
1299
Tutorials for Origin
1. Right-click the layer icon at the upper-left corner of the graph window and select Layer Contents....
2. Highlight all three plots and click Group, then click OK.
1300
Graphing
1. Double click the bottom axis to open the Axis Dialog for layer 1, then go to the Scale tab, and set
the axis scale for the Horizontal(X axis) and Vertical(Y axis) as below respectively:
1301
Tutorials for Origin
2. Click OK to close axis dialog. Double click on the graph to open the Plot Details dialog box and
select the first dataplot in layer 1 to go to Group tab. Set Symbol Type as None and duplicate the
following settings:
1302
Graphing
3. Click Ok to close the dialog. Go to the Symbol tab and duplicate the following settings.
4. Go to Layer 2, Data tab and set the bin scale to be the same as the X scale, then click Apply.
1303
Tutorials for Origin
5. Go to the Group tab for plots in Layer 2 and set the Edit Mode to Independent so that we can
individually customize the plot styles, click Apply.
6. Go to the Pattern tab and hide bars for all three dataplots in Layer2 as what we did in Steps to Create a
Plot with Marginal Distribution Curves, Step3.
1304
Graphing
8. Repeat step 7 for the other two plots in Layer2 and set line color to the corresponding symbol color in
Layer1.
9. Repeat steps 5~8 for Layer3, click OK to close Plot Details dialog and apply settings.
10. Activate Layer1 and select Graph: Legend: Data Plots from the menu.
11. Right click the legend object and click Properties..., set Background to Black Line, and font Size to be
18. Click OK.
12. Use Format:Page Properties to open the Plot Details - Page Properties dialog, go to
Legends/Titles tab and set as the following so that worksheet name will be used as legend text:
13. Drag and move the legend to a new position as needed. At this stage the graph should look like
below:
1305
Tutorials for Origin
1. Double click bottom axis to open Axis Dialog for layer 1, go to the Grids tab, hold Ctrl key to
multiple select Vertical and Horizontal icon and set the following:
1306
Graphing
2. Click OK to close dialog. Open the Axis Dialog for layer 2. Go to the Line and Ticks tab, make sure
Bottom axis icon is selected and clear the Show Line and Ticks check box to hide the bottom axis line.
Do the same for the axis line of Left in layer 3.
3. Open the Layer Management dialog box, highlight Layer2 then go to the Size/Position tab, select
Move and set Top to be -35. Click Apply.
1307
Tutorials for Origin
4. Set Left for Layer3 to be 102. Click Apply. Then click OK to close the dialog box.
6.11.6.1 Summary
All Origin graphs are created from a graph template. Templates serve to recall previous customizations but
they also serve as a starting point for new customizations. This tutorial will show you how to create the
following highly-customized box chart:
1308
Graphing
6.11.6.3 Steps
1. Open the Tutorial Data.opj and browse to folder Overlapped Box Chart.
2. Activate workbook Book1B and Sheet1. Highlight columns B through F, then click Plot>2D: Box: Box
Chart. A box chart is created.
3. Select and delete the legend object from the graph.
4. Double-click on any box in the plot to open the Plot Details dialog box. Go to the Group tab and set
the Increment for Border Color to None (other elements should already be set to None).
1309
Tutorials for Origin
6. Go to the Spacing tab and set Gap Between Boxes (in%) to be 40.
1310
Graphing
8. Go to Percentile tab and clear all symbols. Click OK to close the dialog.
1311
Tutorials for Origin
1. Right click the graph window title bar and select Duplicate. Repeat twice more. You should now have
four identical graph windows.
2. Double-click any box in Graph2 to open Plot Details. Go to the Box tab and set the Coef value to be
0.95, Box Width (%) to be 15 and no Whisker.
1312
Graphing
3. Repeat step2 for Graph3 with Coef = 0.75, Box Width (%) = 40 and no whiskers .
4. Repeat step2 for Graph4 with Coef = 0.5, Box Width (%) = 70 and no whiskers.
1313
Tutorials for Origin
5. Select Graph: Merge Graph Windows to open the merge_graph dialog box. Duplicate the settings
as shown below and click OK.
1314
Graphing
6. Select Graph: Layer Management from the menu to open the dialog box.
7. Select Layer2 and go to the Link tab. Duplicate settings as shown below and click Apply.
1315
Tutorials for Origin
1316
Graphing
9. Repeat Steps 7~8 for layer3 and Layer4. Click OK to close the dialog box.
1317
Tutorials for Origin
1. Double-click the Y axis to open Axis Dialog box. Go to the Scale tab and duplicate settings as shown
below for the Y axis (Vertical).
1318
Graphing
1319
Tutorials for Origin
1320
Graphing
4. Go to the Line and Ticks tab, hold Ctrl key to select both Bottom and Left icons, then select Use
Same Options for Bottom and Top, and change the line and ticks setting as below.
1321
Tutorials for Origin
5. Go to the Tick labels tab again. Duplicate settings as shown below for X axis, after this, click OK to
close the Axis dialog and apply all settings:
1322
Graphing
6. Right-click the Y axis title and select Properties.... Duplicate settings as shown below and click OK.
1323
Tutorials for Origin
7. Activate Layer1 by clicking on the layer icon at the upper-left corner of the graph window. Select Graph:
Exchange X-Y Axes.
8. Resize and/or reposition the graph layer as needed, so that everything fits comfortably within the graph
window.
6.11.7.1 Summary
1324
Graphing
Origin’s box chart is advanced and customizable, this tutorials shows how to create a two- level grouped box
chart from indexed data in Origin.
This tutorial is associated with <Origin EXE Folder>\Samples\Tutorial Data.opj, so you should open Tutorial
Data.opj and browse to the folder Two-Level Grouped Box Chart at first.
In the following steps, you can select the data you want to analyze by data filter:
2. Click the Add/Remove Data Filter button on the Worksheet Data toolbar to add empty data filter
to Column B.
3. Click the Filter icon on the column header of Column B, clear the check boxes before Select All, and
check CA, FL and TX again.
1325
Tutorials for Origin
In the following steps, you can convert data from the raw mode into index mode:
1. Highlight Column E to Column P (from January to December), and then select Worksheet: Stack
Columns from the main menu to open the Stack Columns dialog
2. Check the box before Include Other Column(s), click the Select from Worksheet button, and select
Column A and B in the worksheet.
3. Change the Group Column Long Name to ―Month‖ and Data Column Long Name to
―Temperature‖
1326
Graphing
5. Click the Lock icon on the column header, and select Recalculate Mode: None in the context menu.
1327
Tutorials for Origin
In the following steps, you can customize the order of values shown in the graph but not change the source
data:
1. Highlight Column B in Worksheet StackCols1, and then right click to select Set as Categorical.
2. Double click the Categories cell ―unsorted‖ of Column B to open the Categories dialog.
3. Uncheck the <auto> checkbox, and then specify the order of items into: CA-TX- FL by using Move
to Top button , Move up button , Move Down button and Move to Bottom
button .
1328
Graphing
4. Redo step2 and step3 in Column C to specify the order of items into: January to December.
1. Highlight Column D in Worksheet StackCols1, and then select Plot>2D: Group Plot: Grouped Box
Chart – Indexed Data… in the main menu.
2. In the open dialog Plotting: gboxindexed, click the triangle button at the top right corner in
Groupe Column(s) section, and then select C(Y): Month and B(Y): State in order in the context
menu item.
1329
Tutorials for Origin
1. Select the graph layer (click somewhere in the lower-middle portion of the layer seems to work best ), and
then drag the control handle to resize it as you want (put the cursor on the control handle, and drag it
1330
Graphing
2. Select Graph:Fit Page to Layers in the main menu to open the dialog, and then select Height Only in
the drop-down list of Adjust Direction to match the page width to that of the bounding box.
1331
Tutorials for Origin
3. Double click on any one of the boxes to open Plot Details dialog, go to Group tab. For both Border
Color and Boxed Color, set Increment to By One and Subgroup to With Subgroup, so each
subgroup has a different color. Click the color scale on the Details section, and select S01 Gray Scale in
1332
Graphing
the drop down list for both Border Color and Boxed Color.
1333
Tutorials for Origin
4. Go to Pattern tab, uncheck the checkbox Follow the line transparency and set transparency to 30%.
5. Go to Spacing tab to set the gap value between and within subgroup.
1334
Graphing
1335
Tutorials for Origin
7. Go to Percentile tab, clear the check box before the 99%, 1%, Max and Min, and then select the shape
and size of Mean marker.
1336
Graphing
8. Go to Line tab to customize the caps of whisker and uncheck the Median checkbox.
1337
Tutorials for Origin
o Go to Tick Labels tab, set the font size of Bottom1 with 14 in Format tab, and duplicate
settings as shown below in Table tab.
1338
Graphing
o Select Bottom2 on the left panel, uncheck the <Auto> checkbox and set the font size of
Bottom2 with 11 in Format tab, and duplicate settings as shown below in Table tab.
1339
Tutorials for Origin
o Go to Line and Tick tab, and change the style of major ticks into In.
1340
Graphing
2. For the Y Axis, change scale, title, font size of label tick and the style of ticks as shown below:
1341
Tutorials for Origin
1342
Graphing
1343
Tutorials for Origin
If you want to add a graphical symbol of to tell the meaning of each line in box, you can follow these steps:
1. Active Workbook US Mean Temperature, right click the label of worksheet below and select Add to add
a new worksheet into workbook.
1344
Graphing
3. Highlight Column A and then select Plot: Statistics: Box Chart to create a simple box chart.
1345
Tutorials for Origin
5. To object Graph2, set the width and height of page on Print/Dimension tab.
1346
Graphing
1347
Tutorials for Origin
8. Go to Percentile and Line tab, and select the same setting of grouped box chart Graph1.
9. Go to Box tab, check the box before Box Label, Whisker Label and Mean Value Label, and shown
them in Percentile, and then change the width of box into 20%, besides set the range of box and
1348
Graphing
whisker.
12. Press CTRL + C in Graph2, and then press CTRL + V in Graph1 to copy the graphical symbol into the box
chart.
13. Select the graphical symbol in Graph1, and then resize it and move it to a nice location.
1349
Tutorials for Origin
6.11.8.1 Summary
Origin can be used to create unbalanced grouped box plots from raw data with custom table axis.
1350
Graphing
6.11.8.3 Steps
1. Open Tutorial Data.opj and browse to the folder Unbalanced Grouped Box Chart.
2. Activate the workbook Book 3.
3. Highlight all the columns except col(A), select Plot>2D: GroupPlot: Grouped Box Charts - Raw
Data menu to open the Plotting: plotgboxraw dialog. In the dialog, set the Group Number to 2,
the 1st Group Row to Continents and the 2nd Group Row to Country. This will create a box chart
with the column data arranged in three groups, with X axis row names derived from the two selected
label rows on the worksheet:
4. Click the OK button. Select the legend and delete it and the grouped box chart from raw data is
created with two grouping levels as shown below:
1351
Tutorials for Origin
1. The color and sub-group gap need some work. So, begin by changing all boxes to gray. Select
Format: Plot Properties from the menu. In the Plot Details dialog box, click the Group tab. Set
Border Color Increment to None and Subgroup to None, so that box border color does not
increment by dataset.
1352
Graphing
1353
Tutorials for Origin
3. Go to the Spacing tab and set Gap Between Subgroups (in%) to 0 to remove the gap between
sub-groupings.
4. Click OK to apply the settings. Now our unbalanced grouped box chart is correctly drawn (we will
adjust the labels later).
1354
Graphing
We will now add an axis table top of the graph to display extra grouping information.
1. Open the Axis Dialog again (Format: Axes: X-Axis). Go to Tick Labels tab and click to highlight the
Bottom 1 icon only on the left panel.
1355
Tutorials for Origin
3. Click to select the newly added Bottom 3 icon on the left panel and go to Display tab to set the
Display list to Rank (note that this is another worksheet label row).
1356
Graphing
4. Click Apply to see the changes. A new table row is added to the bottom X axis. Next, we will move it
to the top of the graph.
1357
Tutorials for Origin
5. Right click the Bottom 3 icon on the left panel and select Move to Opposite.
1358
Graphing
1359
Tutorials for Origin
Now, let's do some further customization so that our graph looks like the one pictured in the introduction to
this tutorial.
1. Double click on the grouping table on the bottom of graph to bring up Axis Dialog, go to Tick Labels tab
and click to select Bottom 1 icon only again.
2. Go to Table tab, clear the Far Parallel Border check box for Bottom 1.
1360
Graphing
3. Click to highlight the Bottom 2 icon on left panel, uncheck Auto box and clear the Inside Border and
Outside Border check boxes.
4. Click to highlight the Top 1 icon on left panel and clear the Far Parallel Border, Inside Border and
Outside Border check boxes. Select the Tick at Beginning of Cell and Tick at End of Cell check
boxes.
1361
Tutorials for Origin
5. Click Apply and then go to Line and Ticks tab and set Style under Major Ticks node to be In &
Out.
1362
Graphing
6. Go to Grids tab and customize both major and minor grid lines settings as Color = Black, Style =
Dot and Thickness = 0.5.
1363
Tutorials for Origin
7. Click Apply and go to Scale tab, click Vertical icon on left panel and change scale Type to Log10,
and adjust the other settings as shown below.
1364
Graphing
8. Go to Tick Labels tab and enter a Suffix of % to apply this character to each of the Y axis labels.
1365
Tutorials for Origin
1366
Graphing
10. Click Format:Page Properties and set Width = 14.0 (you can leave the Height setting, as it is).
11. Double-click on the Country labels in the graph and set font Size = 14.
12. To add a graph title, click the Text tool, click somewhere in the heading of the graph and enter Female
Tertiary Education (ISCED 5 and 6) Enrollment, and change Y axis title to be Enrollment Rate.
6.11.9.1 Summary
In Origin, a grouped box chart can be created from either indexed data or raw data. The indexed data is
arranged as one data column and one or more group columns, while the raw data is arranged as multiple data
columns grouped according to the column label row(s).
Once a grouped box plot has been created there are many options to customize the box plots and the axes.
The customization options are the same for grouped box plots created from raw data as well as those created
using indexed data.
1367
Tutorials for Origin
6.11.9.3 Steps
This tutorial with the Grouped Box Plot and Axis Tick Table folder in the project <Origin EXE
Folder>\Samples\Tutorial Data.opj.
Note: You can also access this sample graph by double-clicking on its thumbnail under the Box Plots -
Grouped graph sample in the Learning Center dialog(select Help: Learning Center menu or press F11) .
1. Open the Tutorial Data project, browse to the folder Grouped Box Plot and Axis Tick Table and activate
the workbook Book4G-CC.MI-Index.
2. The data in the CC.MI-Index worksheet is indexed data. Column E is the data column and columns C and
D can be used as grouping columns.
3. Highlight column E and select Plot>2D:Group Plot:Grouped Box Charts - Indexed Data to open the
plot_gboxindexed dialog.
1368
Graphing
4. Beside Group Column(s), click the triangle button at the top right corner and click the context menu
item Select Columns. This opens the Column Browser for selecting grouping ranges.
5. In the column browser, highlight columns C and D simultaneously by holding down the Ctrl key while
selecting them. Click the Add button to add them to the bottom panel. Click OK to apply the selection and
close the column browser.
6. Make sure the dialog settings the same as the image below:
7. Click OK to create a grouped box plot, the plot will resemble the image below:
1369
Tutorials for Origin
For another short tutorial on creating grouped box plots from indexed data, see
Example 2.
In the previous section, when the grouped box plot was created, an Output Data worksheet was generated as
well. The data in this worksheet is arranged as raw data. A box plot graph will created from the raw data as
well.
1. Highlight all the columns in the worksheet Output Data. Select Plot:Statistics:Grouped Box Charts -
Raw Data from the main menu to open the plotgboxraw dialog.
2. We will use the labels in the SEG and Type label rows to group our data into 2 subgroups: Set Group
Number to 2, 1st Group Row to SEG and 2nd Row Group to Type.
3. Enable, Sort by Group Labels and accept the default Graph Theme.
1370
Graphing
4. Click OK to create another grouped box plot, the plot should resemble the image below:
1371
Tutorials for Origin
Both the graphs created in the previous two sections can be customized in the same manner. In the following
sections, the graph created from the indexed data will be used as an example for customization.
1. Activate the graph window created from the indexed data. Select and delete the legend object.
2. Select Format:Plot Properties to open the Plot Details dialog.
3. On the Box tab, check the Outliers box. Note that Outliers in Line will also be checked automatically.
Outlier points will be shown in the graph.Click Apply to apply settings first and the Symbol tab will
appear.
4. To customize Symbol style select the Symbol tab and set the following:
1372
Graphing
7. On the Percentile tab in order to set the Max/99%/1%/Min to none, select the last option in the
symbol map. Set the rest of the options as shown below:
1373
Tutorials for Origin
8. On the Group tab, for the Border Color row, set the Increment as By One and Subgroup as Within
Subgroup .
9. Next, click the ... button on the right end of the Details column to open the Increment Editor. Click
the first color to expand the color chooser, then click the last vacant color under Custom control to
open the Colors dialog. In the dialog that opens, you can define a custom color by entering the HSL
values (Hue=0, Sat=240, Lum=180). OK to close the dialog. Follow the same procedure for the
second color in the Increment Editor dialog with the settings Hue=160, Sat=240, Lum=164. OK out
of the Increment Editor:
10. In regard to the Box Color, select the first color list we just defined under the Details drop-down list,
and then select By One for Increment cell and Within Subgroup for Subgroup cell:
1374
Graphing
11. Click OK to apply all the previous settings and close the Plot Details dialog. The graph should
resemble the image below:
1375
Tutorials for Origin
1. Continue with the graph from the previous section. Select Format:Axes:X Axis to open the Axis dialog.
2. Go to the Tick Labels tab, right click on the Bottom 1 icon and select Move to Opposite to move it
to the top axis.
1376
Graphing
3. Now the previous Bottom 1 becomes Top 1, and Bottom 2 becomes Bottom 1.
4. Click the new Bottom 1 icon and set the tick label format and table layout as shown below:
1377
Tutorials for Origin
1378
Graphing
6. Click the Left icon (for Y axis) and change the display format for the Y tick labels:
7. To turn on major and minor grid lines, go to the Grids tab and set as following for X(Vertical) and
Y(Horizontal) grids respectively:
1379
Tutorials for Origin
8. Click OK to apply the settings and close the Axis dialog. The final graph should appear as shown
below:
1380
Graphing
You can click to select table labels and nudge them using the arrow keys on your
keyboard.
6.11.10.1 Summary
Origin's box plot is highly customizable. This tutorial shows how to create a notched box plot and control the
box width by another dataset.
1381
Tutorials for Origin
Also, you can refer to this graph in Origin Central. (Select Help: Origin Central menu or press F11 key ,
and then select Graph Sample tab, select Box Charts under the drop-down list)
1. Open the Tutorial Data.opj and browse to the Box Variable Width folder.
2. Activate workbook Book7, highlight columns A~F and then select Plot: Statistics: Box Chart. Next,
select and delete the legend object from the graph.
1382
Graphing
3. Double-click on one of the boxes to open the Plot Details dialog and go to the Box tab. Set Style to
Notched Box. Select the Box Width by Parameter box and then set Box Width (%) to Number
of Vehicles (in million) and enter 1.2 for Scaling Factor. Select the Outliers box. Outliers in
Line is automatically checked.
4. Click OK to close the dialog. Go to the Object Manager, which is docked to the right edge of Origin
workspace, uncheck the last plot. And the click on the Rescale button to rescale the graph.
1383
Tutorials for Origin
1. To use the same color for each box, double-click on any box to open the Plot Details dialog box. Go to
the Pattern tab. Set Border Color as Orange. Set Width as 1.5.
2. To fill the boxes with color, expand Fill Color drop down list, and in the Single tab choose a lighter
orange as below:
1384
Graphing
3. Note that checking Outliers checkbox in Box tab added a Symbol tab. Use controls on this tab to
customize the outlier symbol as shown below:
1385
Tutorials for Origin
4. To hide the 99% and 1% symbols, go to the Percentile tab and clear the symbol for both 99% and
1%. Select the 2nd symbol in the first row for Mean:
1386
Graphing
1. To show solid grid lines between each boxes, double click on the X axis to open the Axis dialog box.
Go to the Scale tab with Horizontal icon selected and set the Count of Minor Ticks to 1:
1387
Tutorials for Origin
2. Select the Grids tab and select the Vertical icon. Check Show under Minor Grid Lines branch and
set the Style as Solid.
1388
Graphing
3. Go to the Line and Ticks tab and set the tick styles for X axis (Bottom):
1389
Tutorials for Origin
4. Hold Ctrl key and multiple select the Top and Right icons. Check the Show Line and Ticks box to
also display line and ticks of top X and right Y axis, and set the tick style to None:
1390
Graphing
5. Go to the Scale tab again and select Vertical icon. Set the following:
1391
Tutorials for Origin
6. Go to the Tick Labels tab, make sure Left icon is selected and enter a prefix of $.
7. Go to the Title tab, make sure Left icon is selected and change the text of Y axis title to Gasoline Prices.
1392
Graphing
Now, we are going to add three reference lines at Y axis to show the national average and minimum-maximum
range of national gasoline price.
1. Double-click on Y axis to open the Axis dialog again. Go to Reference Lines tab, click Details... button to
open the Reference Lines dialog.
2. Click Add button at the bottom of Reference Lines dialog to add a reference line. Select this new line,
set Value Type to Statistics, and enter Mean(plotdata(6, Y)) in the At Axis Value box(You can click the
arrow at the end of this box to select a built-in pattern). Change the lint style to Royal and Dash, and
1393
Tutorials for Origin
3. Click Add button again to add second reference line. With this line selected at the Reference Lines at
panel, set Value Type to Statistics, and enter min(plotdata(6, Y)) in the At Axis Value box. Set Line
1394
Graphing
4. Click Add button again to add third reference line. With this line selected at the Reference Lines at
panel, set Value Type to Statistics, and enter max(plotdata(6, Y)) in the At Axis Value box. Set Line
Style to Royal and Solid.
5. Click OK button to close the dialog and add the reference lines to the line table.
1395
Tutorials for Origin
6. Enter National Average at the Label Text cell of first added line. And select the Fill To line for the
second and third reference line as below:
7. Click Apply button to add the reference lines to the graph. Click Details... button again to open the
Reference Lines dialog, select the second line at right panel, and then set Fill Color under Pattern node
to Cyan and Transparency to 90. Click OK button.
8. Click OK button again to close the dialog. Go back to the graph, right-click on the label of the mean line to
select Properties... from context menu to open the Text Object dialog. Enter the text below and do the
format settings:
National Average
$$(v, *3)
1396
Graphing
1397
Tutorials for Origin
9. Click OK button. At the end, you will get the final graph.
6.11.11.1 Summary
Dot chart is a statistical chart which consists of data points plotted on a simple scale. It is often used as a
substitute for the pie chart, as it allows for quantities to be compared easily. This tutorial will teach you how to
create a simple dot chart plot:
1398
Graphing
6.11.11.3 Steps
Start with the following data which represents various elements in a compound:
Element Content
C 36
Cl 2
H 28
1399
Tutorials for Origin
N 10
O 12
P 7
S 5
1. Create a new workbook using the New Workbook icon in the Standard toolbar, and input the data:
2. Highlight Col(A) and Col(B). Select the Plot: Symbol: Scatter menu item from the main menu to
create a scatter plot as shown below:
1400
Graphing
4. Double-click on the graph to bring up the Plot Details dialog, change the symbols and the symbol
color using the different tabs as shown below:
1401
Tutorials for Origin
1402
Graphing
5. Click the OK button to save the changes and close the dialog. The graph should appear as shown
below:
6. The next step is to reset the X and Y Axes. Double-click the horizontal axis to open the Axis dialog.
On the Scale page, set From as 0 and To as 40. Set the Increment as 10.
1403
Tutorials for Origin
7. Go to the Line and Ticks page, select the Left icon in the left panel, and set both Major Ticks and
Minor Ticks to None. Click OK to save the changes.
1404
Graphing
1405
Tutorials for Origin
6.11.12.1 Summary
A Dot Chart is a statistical chart which consists of data points plotted on a simple scale. It is often used as a
substitute for the pie chart because it can make comparing quantities easy. This tutorial will teach you how to
create the Multi-Data Dot Chart.
1406
Graphing
6.11.12.3 Steps
The following data concerning the element content of several areas at different times can be used to create a
multi-data dot chart:
1407
Tutorials for Origin
1. Create a new workbook using the New Workbook icon on the Standard toolbar and input the data.
2. Hover the cursor over the very first cell of the col(B) till it turns into a downward arrow. Left-clicking
highlights col(B) and dragging highlights col(C). Select Plot: Symbol: Scatter from the main menu to
create a graph, and select Graph: Exchange X-Y Axis. An alternate way of creating scatter graphs is
using the scatter icon in the 2D Graphs toolbar.
3. Repeat step 2 twice to create two more graphs with col(D) and col(E), as well as col(F) and col(G).
4. To Merge the three graphs, select Graph: Merge Graph Windows: Open dialog. In the dialog box
that opens expand Arrange Settings, set the Number of Rows as 3 and the Number of Columns
as 1. The Preview window on the right shows how the three graphs will be arranged and which layers
they will be on. Click the OK button to save . This creates a new graph which contains three layers
each containing a separate graph.
1408
Graphing
5. To clean up the graph, delete the legends and axis titles in the graphs by selecting them and pressing
the Delete key.
6. Select Graph: Layer Management from the main menu. Select Layer 2 on the left. In the right
panel Link tab set Link to as 1. This links the Y axis of the second layer containing the second graph
to the first layer containing the first graph. Set the Y Axis Link as Straight (1 to 1), this will ensure
that the axis for the two graphs is the same. Click the Apply button. Check the When dragged to
reposition, also reposition parent layer box. This setting will ensure that when one axis is moved,
the other follows accordingly.
1409
Tutorials for Origin
7. Select Layer 3 on the left and repeat the previous step. Click the OK button to save changes.
8. In order to reset the X and Y Axes, make sure Layer 1 is the active layer by clicking on 1 at the top
left corner of the graph. Double-click on the horizontal axis of the graph layer. On the Scale page
when Horizontal icon is selected, set the values shown below (since the layer axes were linked in the
last step, these changes are applied to all three axes):
1410
Graphing
9. Go to the Line and Ticks page, select Top icon in the left panel, check the Show Line and Ticks
check box to show the top Y axis. And then set Major Ticks as Out and Minor Ticks as None.
10. Select Bottom icon in the left panel, in the Line and Ticks page, set Major Ticks and Minor Ticks
as None to remove the ticks.
1411
Tutorials for Origin
11. Go to Tick Labels page in the right panel, select Top icon in the left panel, check Show check box.
1412
Graphing
12. Go to the Special Ticks page, select Top icon in the left panel, choose Hide for both Axis Begin and
Axis End.
1413
Tutorials for Origin
13. Go the Tick Labels page, select Top icon in the left panel, clear the Show check box.
1414
Graphing
14. Go the Tick Labels page, select Bottom icon in the left panel, clear the Show check box.
1415
Tutorials for Origin
15. Go to the Line and Ticks page, select Left icon in the left panel, check Use Same Options for Left
and Right check box. And then set both Major Ticks and Minor Ticks as None:
1416
Graphing
16. Go to the Grids page and select Horizontal in the left panel, check Show check under the Major
Grid Lines branch.
1417
Tutorials for Origin
17. Click the OK button to apply the settings and close the Axis dialog. The graph should now appear as
shown below:
1418
Graphing
18. Right click on Layer 1 and choose Copy Format:All Style Formats. Right click on the graph page
and choose Paste Format to copy and paste the style from Layer 1 to the whole page.
1419
Tutorials for Origin
19. Double click on the top axis in Layer 2, go to the Line and Ticks page, select Top icon in the left panel,
set Major Ticks and Minor Ticks as None. Do the same for the top axis of Layer 3.
20. In the Axis dialog of Layer 3, go to the Line and Ticks page, select Bottom icon in the left panel, set
Major Ticks to Out.
21. On the Tick Labels page, select Bottom icon in the left panel, check Show check box.
22. Go to the Special Ticks page, select Bottom in the left panel, and choose the Hide option for both
Axis Begin and Axis End. Click OK.
1420
Graphing
24. Double-click the graph to bring up the Plot Details dialog. Change the settings as shown below.
Setting the Edit Mode as Independent ensures that the symbols can be customized separately for
each data set on one layer. For Symbol shape, uncheck the Custom Construction check box, click
the down arrow button to select different symbol shape. For symbol color, in the Symbol tab click on
the Symbol Color option and select Individual Color to set one color to all the symbols as in this
tutorial:
1421
Tutorials for Origin
1422
Graphing
1423
Tutorials for Origin
25. Repeat the previous step (step 24) for the Layer 2 and Layer 3. Click the OK button and the graph
will appear as shown below:
1424
Graphing
26. Select in the Tools toolbar to draw three rectangles on the graphs. For each rectangle:
1. Double-click on the rectangle to bring up the Object Properties dialog.
2. In the Fill tab, set the desired Fill Color which will designate the color of the rectangle:
1425
Tutorials for Origin
3. In the Dimensions tab, adjust the size and position of the rectangle:
1426
Graphing
27. Select the Text Tool in the Tools toolbar and click inside the rectangles to add the desired text.
28. To create a legend for the symbols, select Graph: Legend: Data Plots from the main menu. Move
the legend to a suitable place, right-click on it and select Properties. Change the settings as below:
1427
Tutorials for Origin
The complete multi-data dot chart graph should appear as shown below:
1428
Graphing
6.11.13.1 Summary
Origin allows you to fit the peaks from the result of frequency count. Also, fitted curves can added into the new
layer in the Histogram.
1429
Tutorials for Origin
6.11.13.3 Steps
Copy and paste the sample data into Origin and set the column as Y (Highlight the column and choose
Column: Set As: Y from the Origin menu). Plot this data as a Histogram by clicking Plot: 2D: Histogram:
Histogram from the menu.
1. Highlight the sample data, then open the Frequency Count dialog by selecting Statistics: Descriptive
Statistcs: Frequency Count.
2. Click OK to finish. A new result sheet will be generated.
1. Select Col(Counts) in FreqCounts1 sheet and then open the Multiple Peak Fit dialog from Analysis:
Peak and Baseline: Multiple Peak Fit.
2. In the dialog that opens, choose Gaussian for Peak Function and click OK.
3. A graph window is generated automatically for you to pick peaks from the graph. Double click at the peak
center to pick up a peak. Pick two peaks one by one this way.
1430
Graphing
Note: you can single click at the peak center and then use Left and Right arrow keys on the keyboard to
slightly adjust the center. Once done, press Enter key to confirm.
4. We need to fix the baseline at Y = 0. To do this, click Open NLFit button to open Nonlinear Curve Fit
dialog. Go to Parameters tab. Set Value of parameter y0 to 0 and check Fixed cehckbox. Click Fit button
to perform the fitting.
If your baseline is complicated, or if you would like Origin to auto find peaks
by specified method, please use Peak Analyzer (open from Analysis: Peaks
and Baseline: Peak Analyzer). Note that Peak Analyzer provides powerful
controls appropriate not just in two cases mentioned.
5. Two sheets nlfitpeaks1 and nlfitpeaksCurve1 are added to the source workbook containing the fitting
report and the fitted curve data.
1. Activate the Histogram graph and add a layer by selecting Graph: New Layer(Axes): Right-Y from the
main menu.
2. Double click the Layer2 icon to open the Layer Content dialog.
3. Hold Ctrl key to select col("Fit Peak 1") and col("Fit Peak 2") in sheet nlfitpeaksCurve1 in the left panel,
click the triangle button next to A button and select Line from the fly-out menu, and then click -> button
to add it to the right panel.
4. Click OK. Two fitted curves had been added to the Histogram.
5. Double-click the graph to open the Plot Details dialog. Select RightY from the left panel, then open the
Link Axes Scales tab in the right panel and select Straight(1 to 1) for both X Axis Link and Y axis
Link. Click OK to close the dialog.
1431
Tutorials for Origin
6. The fitted curves are added into the Histogram with the proper scale. The following is the result graph,
with the right Y-axis removed.
0.631
0.642
0.652
0.662
0.669
0.676
0.677
0.69
1432
Graphing
0.691
0.696
0.697
0.699
0.699
0.7
0.7
0.708
0.712
0.718
0.731
0.744
0.749
0.751
0.752
0.753
0.758
0.758
1433
Tutorials for Origin
0.759
0.761
0.761
0.763
0.763
0.763
0.765
0.767
0.768
0.768
0.769
0.769
0.77
0.771
0.771
0.772
0.774
0.775
1434
Graphing
0.775
0.776
0.776
0.776
0.777
0.778
0.779
0.78
0.78
0.781
0.784
0.784
0.785
0.785
0.789
0.789
0.791
0.794
1435
Tutorials for Origin
0.795
0.796
0.798
0.798
0.803
0.82
0.831
6.11.14.1 Summary
The probability plot shows a graph with observed cumulative percentage on X axis and expected cumulative
percentage on Y axis. The Weibull probability plot is used to test whether or not a dataset follows Weibull
distribution. And its X scale type and Y scale type are Log10 and Double Log Reciprocal respectively. If all the
scatter points are close to the reference line, we can say that the dataset follows the Weibull distribution.
1436
Graphing
6.11.14.3 Steps
You can refer to this graph in Learning Center. (Select Help: Learning Center menu or press F11 key , and
then open Graph Sample: Statistical Graphs)
1437
Tutorials for Origin
1. Download the data from here. Highlight column A and right-click to select Set As: Y from the context
menu.
2. Keep this column highlighted, select Plot: 2D: Probability from the Origin main menu to open the
plot_prob dialog. In this dialog, change Distribution to Weibull and then click the OK button to create
1438
Graphing
3. Double-click on the Lower Percentiles line to open the Plot Details dialog. Go to the Line tab, set Color
to Red, Transparency to 80%, then check Fill Area Under Curve check box and select Fill to next
1439
Tutorials for Origin
4. Go to Pattern tab, set Fill Color to Red. And make sure the Follow line transparency is checked.
1440
Graphing
5. Go to the Line tab of Upper Percentiles line set Color to Red, Transparency to 80%. Click OK to apply
the setting and close the dialog.
1441
Tutorials for Origin
6. Double click on the X axis on the graph to open the Axis dialog. Go to Scale tab for Horizontal axis,
change scale from 10 to 100, and set the increment value of Major Ticks to 20.
7. Go to Scale tab for Vertical axis, change scale from 1 to 99.99. Click OK to apply the setting and close
the dialog.
1442
Graphing
1443
Tutorials for Origin
6.11.15.1 Summary
The Q-Q plot is a graphic method that tests whether or not a dataset follows a given distribution. The Q-Q plot
has independent values on the X axis, and dependent values on the Y axis. If all the plotted points are close to
the reference line, then we conclude that the dataset follows the given distribution.
1444
Graphing
How to mask a suspected outlier in the source data and recalculate the Q-Q plot
You can refer to this graph in Learning Center. (Select Help: Learning Center menu or press F11 key , and
then open Graph Sample: Statistical Graphs)
1. Click the button to import the Q-Q plot.dat file under <Origin EXE folder>\Samples\Graphing\ path.
2. In the QQplot workbook, activate the Q-Q plot worksheet, highlight column B, right click, and from the
context menu, select Plot: Statistics: Q-Q Plot.... In the Plotting:plot_prob dialog, make sure that the
1445
Tutorials for Origin
3. Double-click on the Lower Percentiles line to open the Plot Details dialog. Go to the Line tab, set Color
to Red, Transparency to 80%, then check Fill Area Under Curve check box and select Fill to next
1446
Graphing
4. Go to Pattern tab, set Fill Color to Red. And make sure the Follow line transparency is checked.
1447
Tutorials for Origin
5. Go to the Line tab of Upper Percentiles line set Color to Red, Transparency to 80%. Click OK to apply
the setting and close the dialog.
1448
Graphing
1. Click on the green lock icon to make sure the Recalculate Mode is Auto.
2. Click on the Data Reader tool and click to select the suspected data point in the Q-Q Plot.
1449
Tutorials for Origin
The Data Info window shows the value of the outlier point.
1450
Graphing
4. From the Menu Bar, click on Window:Command Window and at the prompt, enter the script shown
below.
The outlier point will be shown in red in the Q-Q plot worksheet, and it will not be included in the
graph.
1451
Tutorials for Origin
1452
Graphing
6.11.16.1 Summary
A scatter matrix consists of several pair-wise scatter plots of variables presented in a matrix format. It can be
used to determine whether the variables are correlated and whether the correlation is positive or negative.
This tutorial will show you how to create a Scatter Matrix plot.
6.11.16.3 Steps
1. Start with an empty worksheet, select File: Import: Single ASCII... to open the Import Single ASCII
dialog, browse to the \Samples\Statistics subfolder of the Origin program folder, and import the file
Fisher's Iris Data.dat.
1453
Tutorials for Origin
2. Highlight columns (A) to (D) but not col(E), and select Plot > 2D: Scatter Matrix from the main menu.
3. In the dialog, select Histogram from the Show in Diagonal Cells drop-down list, and select Alternate
from Show Tick and Label drop-down list.
4. Click OK to close the dialog. The PlotData1 sheet for the scatter matrix plot is generated in the same
workbook as the original data. It contains the data for the different graphs in the scatter matrix and can
be accessed by clicking on the second tab labelled PlotData1 at the bottom of the workbook. The graph
1454
Graphing
There are multiple layers in the Scatter Matrix graph. This section will explain how to customize the
background color, the type and color of the data plots and the axis tick labels of the scatter matrix. Starting
with Origin 2016, by default, if you change the plot style or axis setting of one layer, all other layers will follow
(for independent editing, see the tip at the end of this section).
1. Double click on the scatter data to open the Plot Details dialog. To change the symbol color click on the
Symbol Color drop-down menu and select a color from the Individual Color option. Specify the type
and color of the symbol as shown in the following image, and click OK.
1455
Tutorials for Origin
This change will be applied to all scatter data plots in this graph.
2. To change the background color of the entire window, select Format: Page Properties to open the Plot
Details dialog. This dialog can also be accessed by double-clicking inside the Scatter Matrix window. In
1456
Graphing
the Display tab, click on the Color drop-down and click on an empty color well beneath Custom. This
opens the Colors dialog box where you can define custom colors.
3. In the Colors dialog, specify the color as Red=235, Green=235, Blue=255 and click OK.
4. To change the background color of the scatter plot layers without changing the background color of the
histograms or the rest of the graph, double-click on a scatter plot to open the Plot Details dialog. Click the
Background tab, and set Color to White.
1457
Tutorials for Origin
Then click OK in the dialog. This change will be applied to all layers with scatter data plots.
1458
Graphing
5. Double-click on any tick label in the graph to open the Axis dialog for that layer. Go to the Tick Labels
tab, then the Format tab, specify Size to 36 for the Top axis. Click Apply.
6. Click the Apply To... button to open the Apply To dialog, set the following to apply the previous
customization of tick label size to all the other axes in this window. Click OK, then OK to close the Plot
1459
Tutorials for Origin
1460
Graphing
Currently, our scatter plots show pair-wise comparisons of variables Sepal Length, Sepal Width, etc. What is
not apparent from our scatter plots is that measurements were made on three species of iris. Since all scatter
points look the same, we cannot distinguish between species. What we will do is to use the Species column in
our original worksheet -- the column that we left out when making the graph -- to color each scatter point so
that we can see the effect of species in our pairwise comparisons.
1. To add species information to our plot, click on the green lock icon on the upper-left corner of the graph
window. Select Change Parameters to bring up the Plotting: plot_matrix dialog.
2. Click the triangular button beside Grouping Range and choose E(Y): Species, then click OK.
3. Click the OK button in the Plotting: plot_matrix dialog. The graph will appear as shown below:
1461
Tutorials for Origin
4.
One Scatter Matrix display option is to hide half of the scatter plots (since they merely repeat the same
information shown by the other half of the scatter plots).
1. To hide the layers below the diagonal in the Scatter Matrix graph, click on the green lock icon on the
upper-left corner. Select Change Parameters to bring up the Plotting: plot_matrix dialog.
2. Under the Matrix Profile branch of the dialog:
o Select Upper Triangular from the Matrix Display drop-down list
o Select All from Show Tick and Label drop-down list
o Enter 2 in the Gap (in % of Page Dimension) text box
1462
Graphing
1463
Tutorials for Origin
6.11.17.1 Summary
After you plot a Histogram, Origin allows you to overlay a distribution curve on the binned data by selecting
Normal, Lognormal, Poisson, Exponential, Laplace, or Lorentz from the Type drop-down list in the Data
tab of the Plot Details dialog.
6.11.17.3 Steps
1. From the Main Menu, select File: Import: Single ASCII...: Sample: Graphing: Histogram2.dat.
1464
Graphing
2. Highlight column B, and from the Main Menu select Plot: Statistics: Histogram.
3. From the Main Menu, select Format: Plot Properties.... From the Plot Details - Plot Properties dialog
box select the Data tab.
4. From the Distribution Curve: Type list, select Normal and click Apply. Select the Add Distribution
Curves check box and click Go. The Plot Details - Plot Properties dialog box closes and a worksheet of
binned data (Histogram2_B Bins) is added to the workbook.
1465
Tutorials for Origin
5. In the Histogram2_B Bins worksheet, the box at the intersection of row Comments and column B(Y2)
shows the Mean and SD values for the data. Right-click on the box, and from the drop down menu select
Copy.
6. Right click within the histogram plot frame (but not directly on the plot) and from the context menu select
Add Text.... Right click within the Text Box and select Paste. Click inside the Text Box, select all numbers
to the right of the tenths place for Mean and for SD, and hit the Delete key. Place your cursor after
Mean= 60.7 and hit the Enter key. The final graph should appear as below.
Note : If data fit the chosen distribution well, the overlay curve will also approximately agree with
the histogram well.
1466
Graphing
7.
6.12 Polar
6.12.1 Polar
Polar Contour
Polar Plot with Error Bar
Polar Crop
6.12.2.1 Summary
This tutorial will show you how to create a Polar Contour graph from both XYZ worksheet data and matrix
data.
1467
Tutorials for Origin
Create a Polar Contour graph from both XYZ data and matrix data
6.12.2.3 Steps
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
You can refer to this graph in Learning Center. (Select Help: Learning Center menu or press F11 key , and
then open Graph Sample: Polar Charts)
1. Open the Tutorial Data project and browse to folder Polar Contour in Project Explorer.
2. Activate Book2BA containing the temperature and location data and select column C. Select Plot > 2D:
Polar: Polar Contour theta(X) r(Y) from the menu to create a polar contour graph. The graph should
look like this:
3. Next, we will customize the contour graph using the Plot Details dialog box. Double-click on the contour
plot to bring up the Plot Details dialog then select the Color Map/Contours tab and click the Fill
1468
Graphing
4. Click the Contouring Info tab and select the Layer Boundary radio button.
1469
Tutorials for Origin
o Go toScale tab and make sure Angular is chosen in the left panel. Under the Major Ticks tree
node, set the Type to By Increment and Value to 60.
o Go to Tick Labels tab and select Angular - Outer in the left panel. In the right panel, go to
Display tab, select Tick-indexed dataset in Type drop-down list and then select
[Book3B]Sheet1!B"Longitude" from the Dataset Name drop-down list.
1470
Graphing
o Go to Scale tab, and select Radial in the left panel. In the right panel set From and To to 0 and
7. Also under the Major Ticks tree node, set the Type to By Increment and Value to 2 .
1471
Tutorials for Origin
o Go to Tick Labels tab. Pressing Ctrl key and select both Radial - Outer 1 and Radial - Outer 2
in the left panel. In the right panel, go to Display tab, select Tick-indexed datasetin Type
drop-down list, then select [Book3B]Sheet1!A"Latitude" from the Dataset Name drop-down
list.
1472
Graphing
o Go to Grids tab, and make sure Radial is selected in the left panel. Edit the dialog box settings
as in the following image. Click OK to close the Axis dialog box.
1473
Tutorials for Origin
6. Double-click on the Color Scale to open the Color Scale Control dialog box and edit settings as follows
o In the Labels page, set font size to 20.
1474
Graphing
o In the Layout page, uncheck Reverse Order check box, and set Color Bar Thickness to 100.
1475
Tutorials for Origin
o In the Title page, enter (\+(o)F) in the Title, which is supposed to be displayed as (oF) as the
unit for temperature. And set the Position to Bottom.
o In the Line and Ticks page, uncheck Show Line and Ticks on Right and Show Border check
box. Then Click OK to save the setting and close the dialog.
Note: The text used for Title is (\+(o)F), which is supposed to be displayed as (oF) as the unit for
temperature.
1476
Graphing
7. Add the graph title Temperature Contour Map, axis title Latitude to the graph. The graph should look
like this:
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
You can refer to this graph in Learning Center. (Select Help: Learning Center menu or press F11 key , and
then open Graph Sample: Contour)
1. Open the Tutorial Data project and browse to folder Contour from Matrix in Project Explorer.
1477
Tutorials for Origin
2. Activate MBook1. Select Plot > 2D: Polar: Polar Contour theta(X) r(Y) from the menu or click the
Polar Contour theta(X) r(Y) button on the 3D And Contour Graphs toolbar.
3. Double click the axes to open the Axis dialog, we also can customize the Radial Axes for this polar
graph.
o Click on the Radial Axes Configuration button on the right-top of this dialog to open the
dialog. In the dialog, choose 0 under the Angles List drop-down list.
1478
Graphing
o Go to Show tab, and choose Radial - Inner Axis 1 in the left panel. From the Angle At drop-
down list, select End Angle and set Flow Direction to Negative.
1479
Tutorials for Origin
o Choose Angular - Outer in the left panel. On the Show tab, in the Axes Start at (deg.) box,
enter -30. Click OK to save settings and close the dialog.
1480
Graphing
4. Double click on the graph to open Plot Details dialog. Go to Colormap / Contours tab, click on the
Level header to open the Set Levels dialog. Set levels as in the following image and click OK:
1481
Tutorials for Origin
1482
Graphing
Click on the Fill header to open the Fill dialog. Make sure colors as in the following image:
5. Select the Layer1 icon in the left panel of Plot Details and click on the Size/Speed tab. Set the Layer
Area as the following image:
1483
Tutorials for Origin
o In the Layout page, uncheck Reverse Order and set Color Bar Thickness to 400.
1484
Graphing
o In the Line and Ticks page, uncheck Show Line and Ticks on Right and Show Border. Click
OK to save settings and close the dialog.
1485
Tutorials for Origin
7. Click on the Color Scale object and use the anchor points to resize it from vertical direction. The resulting
graph should look like this:
Polar contour graphs from matrix data support filling color to contour lines or to the
matrix grid. For more information, see these two topics:
1486
Graphing
6.12.3.1 Summary
This tutorial will demonstrate how to create a Polar graph with error bars:
Customize the graph using the Plot Details and Axis dialogs
6.12.3.3 Steps
1. Import the data file PolarPlotwithErrorBar.dat under <Origin EXE Folder>\Samples\Graphing\ path
(Minimum Origin Version: 2015 SR0), or you can download this data file directly and import into Origin.
2. Hover your cursor over col(C) till it appears as a downward pointing arrow and click to highlight column C.
Right-clicking produces a menu where this column can be set as Y error.
3. In order to plot the Polar graph of the data with error bars highlight all the columns. In the main
menu select Plot: 2D > Polar: Polar theta(X) r(Y) or click the Polar theta(X) r(Y) button on
the 2D Graphs toolbar.
1487
Tutorials for Origin
4. Double-click inside the plot to open the Plot Details dialog. In the Error Bar tab change the Color to
Magenta and remove the negative error bars by deselecting the Minus box as shown below:
5. If the left panel of Plot Details is hidden, click the button with the two arrows on the bottom left of
the dialog box. The left panel presents a tree-view display of the layer and data the user is modifying.
It also displays a Plot Type list at the bottom. Use the Plot Type list to change the plot from Line to
1488
Graphing
Scatter. This will change the tabs on the right panel and add a Symbol tab. In the Symbol tab,
change the symbol style, color, and transparency as shown below. To select the symbol color, use the
Individual Color option in the Symbol Color button. Click OK to close the dialog.
6. The next step is to modify the radial axes grid lines. These are the circular grid lines between the
inner and outer angular axes. Double-click the vertical axis on the left side of the graph, (i.e. the
Radial Axis) to open the Axis dialog. In the Grids page, choose Radial on the left panel. Change the
Major Grids Line Style to Dash, and then clear the Minor Grids Show check box as shown below:
1489
Tutorials for Origin
7. Use the same procedure to modify the angular axes grid lines, the grid lines that radiate out from
near the center of the plot to the edges. In the Grids page, choose Angular on the left panel.
Change the Major Grids Line Style to Dash, set Start at to Radial Start, and then clear the Minor
Grids Show check box. OK to save changes.
1490
Graphing
1491
Tutorials for Origin
6.12.4.1 Summary
1492
Graphing
6.12.4.3 Steps to Create the Polar Graph and Customize the Axes
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
You can refer to this graph in Learning Center. (Select Help: Learning Center menu or press F11 key , and
then open Graph Sample: Polar Graphs)
1. Open the Tutorial Data project, and browse to the folder Polar Crop in Project Explorer. Open the
workbook Book1AK.
2. Highlight all the columns and choose Plot:Specialized:Polar theta(X)r(Y) from the main menu to
create a polar graph:
1493
Tutorials for Origin
1494
Graphing
o To change the orientation of the plot, go to Show tab and make sure the Angular - Outer is
selected in the left panel. Set Direction to Counter Clock-Wise and the Axis Start at(deg) to
270 as shown below:
1495
Tutorials for Origin
1496
Graphing
1497
Tutorials for Origin
o To add tick labels on Inner Axis 1, go to Tick Label tab, under Display subtab and select Tick-
indexed string from the Type drop-down. Type 0A " " Lv1 " " Lv2 " " Lv3 " " Lv4 in the Display
edit box (Spaces within the double quotation marks are to indicate no text label at this tick, so
that only every second tick is labelled). Set the Formatting options as shown below:
1498
Graphing
o Go to the Format subtab and change the tick label format as below:
1499
Tutorials for Origin
o Go to Special Ticks set Axis Begin and Axis End to Hide. Click OK to close the dialog and
these settings should create an axis as shown below:
1500
Graphing
o Go Special Ticks tab, set the Axis Begin option to Hide for Radial - Outer 1axis.
1501
Tutorials for Origin
o Repeat the above two steps for Radial - Outer 2 and click OK to exit the dialog box.
The crop tool allows you to magnify and emphasize any particular section of the polar plot.
1. Double click on any axis to open the Axis Dialog again. Click on the Crop... button to open the
Miscellaneous dialog. Check the Enable box and set the values shown in the image below. Click OK
to exit the dialog box.
1502
Graphing
1503
Tutorials for Origin
3. In order to change the layer size to match the sample project select Format: Layer Properties from
the main menu to open the Plot Details dialog. In the Size/Speed tab, set the following values:
4. Expand Layer1 and select the first data set. Use the Plot Type drop-down on the bottom left of the
dialog to change the plot to scatter. Customize the symbol shape and color to resemble the final image
(symbol color = Navy, symbol shape = filled circle, error bar color = red).
5. To remove the negative error bars as in the sample, select the second dataset under Layer1. In the
Error Bar tab on the right, clear the Minus box as shown below. The error bar color and thickness
can also be adjusted here. OK to exit the dialog box.
1504
Graphing
6. The final graph should appear as shown below. Delete any unwanted legends and the axis title by
selecting them and pressing the Delete key:
6.12.5.1 Summary
Origin's polar axis dialog allows for flexible customization of both angular and radial axes.
1505
Tutorials for Origin
6.12.5.3 Steps
1. Open the Tutorial Data.opj file and browse to the Custom Radial Axis folder and activate workbook
Book1E.
2. Highlight column B and select Plot>2D:Polar: Polar theta(X) r(Y) to generate a polar graph.
1506
Graphing
4. To hide the Outer axis (the outer circle) of the polar graph, double-click on any axis to open the Axis
dialog. Go to Show tab, select Angular -Outer in the left panel, and clear Show check box.
5. To hide all angular grid lines, go to Grids tab and make sure Angular is selected in the left panel.
Clear the Show check boxes under Major Grid Lines and Minor Grid Lines section.
1507
Tutorials for Origin
6. Go to Scale tab and select Radial in the left panel. Set the axis scale as shown below:
1508
Graphing
1509
Tutorials for Origin
1. To show radial axis on each major tick position of angular axis, click the 'Radial Axes Configuration
button to open the dialog. In the dialog, check the Major Ticks option under the Axes Inside Polar
section.
1510
Graphing
2. To hide axis titles, go to Title tab and choose Radial - Major Axes in the left panel. Uncheck the
Show check box. Click Apply button.
1511
Tutorials for Origin
3. There are 4 0's show in center of polar. To hide them, go to the Special Ticks tab. Select Hide from
the Axis Begin drop-down list.
When radial axis is set to show on each major ticks, if you go to Scale tab of Radial and change major
ticks, the radial axis will show in new major tick positions.
1512
Graphing
Origin supports two kinds of radial axes. One is the frame border kind of axis around the polar graph.
The other is inner axis from center of polar outwards.
1. Continue with the graph from the previous section, click on the Radial Axes Configuration
button on the top of left panel. In Radial Axes Configuration dialog, under Axes Inside
Polar branch, set Angles List as below, and click OK to close dialog.
2. Click Apply button. Four four radial inner axes show in the left panel.
3. Go to Title tab, select Radial - Inner Axis1 in the left panel. Then check Use Same
Options for All Radial Axes check box and clear the Show check box to hide all the titles.
Then this setting will be applied to four radial axes.
1513
Tutorials for Origin
4. Go to Tick labels node and check Use Same Options for All Radial Axes. Under Format
subtab, set Rotate(dge.) to be 0.
1514
Graphing
5. Go to the Special Ticks tab, and click Use Same Options for All Radial Axes check box. Set
Axis Begin to Hide.
6. Go to Show tab, press Shift key to select Radial - Inner Axis 3 and Radial - Inner Axis
4 two axes, change Flow Direction to Negative under Axis Position section.
1515
Tutorials for Origin
7. Go to Tick labels tab, enter a minus sign(-) in the Prefix edit box under the Display
subtab.
1516
Graphing
8. Click OK button.
1517
Tutorials for Origin
9. To change the line plot color to red and a little thicker, select the line plot and on Style
toolbar, set Line/Boder Color as red, and set Line/Border Width to 1.5.
10. To add an equation to this graph as graph title, right-click on the graph and select Add/Modify
Layer Title, then enter r=exp(q*cot(79.5p/180)) into the edit box.
11. Origin supports rich text. So highlight q in the text and click button on Style toolbar to
turn it into . Also turn p into . The text will look as below.
12. To add shadow to the text and make the font bigger, right-click on the title and click
Properties... to open the Object Properties dialog. In the Text tab, set font size to 26, and go
to Frame tab to change Frame to Shadow. Click OK to save the setting.
13. Drag the equation to the desired position. The graph should look like the one in Summary.
6.12.6.1 Summary
The multi-layered graph allows the placement of several polar plots with different ranges on one graph page.
This graph is generated by first creating 3 independent polar graphs, and then using the merge graph function
to combine the three graph pages into one three-layer polar graph.
1518
Graphing
6.12.6.3 Steps
This tutorial is associated with the Tutorial Data.opj file under the <Origin EXE Folder>\Samples\ path.
1. Open the Tutorial Data.opj file and browse to the folder Polar Graph with Multiple Layers. Double-click the
workbook Book26 to open the workbook window.
1519
Tutorials for Origin
2. Highlight Column A and Column B and select Plot: Specialized: Polar theta(X) r(Y) from the main
menu to create the polar graph.
3. Right-click on any tick label of the Angular axis to open the dialog. Go to the Scale tab for Angular
axis. Set the Scale of the Angular Axes as From 60 To 150. Set the Value for increments under
Major Ticks as 30. Click the Apply button to see the changes on the graph.
1520
Graphing
4. Go to Tick Labels tab and make sure Angular - Outer is selected in the left panel. Under Display
subtab, type \(176) in the Suffix text box to add the degree symbol to the Angular tick labels. For
more details of supported text formatting commands, please refer to the escape sequences page.
1521
Tutorials for Origin
5. Click the New Configuration... button to open the Radial Axes Configuration dialog.
o Check the Axes Inside Polar box and configure it as shown below:
1. Set the Angles List as Custom.
2. Set the Value text box as 60 150 to place an axis at 60 degrees and one at 150
degrees.
o Set the Axes Outside Polar options as shown below:
1. Select Upper from the Right option drop-down to place an axis at the upper right of the
layer frame.
2. Set %s of Radius as 0.
1522
Graphing
7. Go to Scale tab, and select Radial in the left panel. Set radial axis From as 2 and To as 6. Change
the increment Value for the Major Ticks to 1.
1523
Tutorials for Origin
8. Go to Tick Labels tab and select Radial - Inner 2 in the left panel. Uncheck Show check box to
hide the tick labels for this axis.
1524
Graphing
9. Go to Title tab and select Radial - Outer 1 in the left panel. Uncheck Show check box to hide the
title of the outside polar axis. Click the OK button.
1525
Tutorials for Origin
10. Double-click the plot to open the Plot Details dialog. In the left panel of the Plot Details dialog, click the
Graphn page to go to the page level of this dialog. In the Legends/Titles tab, deselect the check box
Indicate Active Dataset, so that the red box around the legend symbol will be hidden.
11. Expand the Layer node on the left panel and select the graph under it. On the Line tab in the right
panel, change Width to 4 and Color to Blue.
12. Click the OK button to apply customizations to the first polar graph.
1526
Graphing
1. Right-click the header of the polar graph to open the shortcut menu. Select Duplicate (Batch
Plotting): Duplicate with New Columns... to open the Select Column dialog. Select the column
C:Calculated and click OK to duplicate a polar graph with data from Column C.
1527
Tutorials for Origin
2. Since the data range in Column C is quite different from Column B, the Reminder Message window will
pop up, asking whether to rescale the axes of the new graph to show all data. Leave the Yes radio button
selected and click OK.
3. Follow steps 3 from the last section to set the scale of the Angular Axes. Set From as 240 and To as 360
and the increment of the Major Ticks to 15.
4. On the Scale tab, choose Radial in the left panel and then set From as 2 and To as 6 and the increment
of the Major Ticks as 1.
5. Go to Show tab
o Choose Radial - Inner 1 in the left panel. Under Axis Position section, set the Value
(Degrees) as 240 to move the first inside polar axis to 240 degrees.
o Choose Radial - Inner 2 in the left panel. Set the Value (Degrees) as 360.
o Choose Radial - Outer 3 in the left panel. Select Left-Lower in Axis at drop-down list to move
the outside axis to the lower left of the layer frame.
6. Double click the plot to open the Plot Details dialog. Change the line Color to Red and Width to 4
in the Line tab. Click OK.
1528
Graphing
2. Select Column D and click the Polar theta(X) r(Y) button in the 2D Toolbar to create an empty
polar graph.
3. Repeat steps 3 in the Create the Polar graph for the Measured data section to set the scale of the Angular
Axes as From 0 To 360 and the increment Value of the Major Ticks as 30.
4. Go to Show tab, select Angular - Outer on the left panel and uncheck show box. Then select Angular -
Inner on the left panel and check Show box.
5. Go to Tick Labels tab, select Angular - Inner in the left panel, and uncheck the Show check box to hide
the tick labels of the inner Angular axis.
6. Go to Grids tab, make sure Angular is selected in the left panel. Uncheck the Show option in the Major
Grid Lines and the Minor Grid Lines sections.
7. Go to Scale tab, select Radial in the left panel, and change the scale From 2 To 6 and set the increment
Value of the Major Ticks as 1.
8. Go to Show tab, select Radial - Outer 1, and check Use Same Options for All Radial Axes. This will
apply the settings on this page to Radial - Outer 2 axis as well. And then uncheck Show check box. Click
the OK button.
1. With a graph window activated, select Graph: Merge Graph Window from the main menu.
2. Set the Merge option as Specified and make sure only Graph1, Graph2 and Graph3 (the three new
graphs just created) are selected in the Graphs text box.
1529
Tutorials for Origin
3. In the Arrange Settings section set both Number of Rows and Number of Columns to 1 to overlay
the three graphs.
4. Check the box next to Link Source Graphs.
5. In the Page Setup section, set both Width and Height to 15.
12. Set the Auto Legend Translation Mode as @LA: Long Name to use the Long Name data for the
legend. Click OK.
1530
Graphing
13. Right-click on the new legend and select Properties... to open the dialog.
14. Delete the first line in the lower text box.
15. On the Frame tab, set Frame to None. Click OK.
16. Drag the legend to the center of the inner Angular axis.
17. Use the Font Size text box to change the size of the fonts on this graph. Drag the tick labels to
move them to an appropriate position.
18. Right-click one of the inner radial axis titles (Calculated or Measured) and select Properties... from the
shortcut menu.
19. In the Object Properties dialog that opens, in the Frame tab, choose the None from Frame drop-down
list. This clears the grid lines and other background from behind the axis title making it easier to read.
Click OK.
20. Repeat the same operation for the other inner radial axis title.
1531
Tutorials for Origin
6.12.7.1 Summary
By default, Origin polar graphs are line plots. Note, however, that you can convert an existing polar line plot to
column/bars. Further, a grouped column plot in polar coordinate system can be stacked.
1532
Graphing
6.12.7.3 Steps
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
You can refer to this graph in Learning Center. (Select Help: Learning Center menu or press F11 key , and
then open Graph Sample: Polar Graphs)
1. Open the Tutorial Data project and browse to the folder Column and Stack Column and activate Book18.
2. Highlight column B and select Plot:Specialized:Polar theta(X) r(Y) to create a line plot in the polar
coordinate system. Click on the legend object and delete it from the graph.
3. Double-click on the line plot to open the Plot Details dialog box. Make sure the left panel is expanded
and set Plot Type to Column/Bar. This will change the line plot to a column plot.
4. In the Pattern tab, under the Fill section, set Color to Color Mapping:Col(D). This will map column
colors in the plot using the row value in column D of the worksheet (note that a Colormap tab is added
to Plot Details. Click on this tab to see how values are mapped to fill color).
1533
Tutorials for Origin
6. Go to the Spacing tab, select Col(C):"Size" from the Width(in %) drop-down menu and type in 8
as Scaling Factor. This causes values in column C to determine the width of the columns in the plot.
1534
Graphing
7. Go to Colormap tab, click Level head. Set the level from 0 to 1 and Increment to 0.2 in the Set
Levels dialog,
1535
Tutorials for Origin
8. Go to Size/ Speed tab under Layer1 level, and set Layer Area as following:
1536
Graphing
o Click on the Radial Axes Configuration button on the right-top of this dialog to open the
dialog. In the dialog, choose 0 90 180 270 under the Angles List drop-down list.
1537
Tutorials for Origin
o Go to the Scale tab under the Radial tree node. Set scale from 0 to 1.
o Go to the Format tab under Tick Labels tab, and then
select the Radial - Inner1, change Size to 12, check Bold box, and set Rotate (deg.)
to 0.
select the Radial - Inner2, change Size to 12, and check Bold box.
select both Radial - Inner3 and Radial - Inner4, then uncheck Show.
o Go to the Display tab under Tick Labels tab of Radial - Inner1 tree node. Choose Custom in
Display drop-down list, and enter .2* in Custom Format text box.
o Go to the Title tab and highlight all radial axes node. Uncheck Show check box.
o Go to the Grids tab under Radial tree node. Uncheck Show check box under Minor Grid Lines.
Click OK to save the setting and close the dialog.
o Go to Line and Ticks tab, select all radial axes. Change Thickness of Line to 1.5. And set
Style to In & Out, Length to 5 for both Major Ticks and Minor Ticks.
1538
Graphing
o Go to Special Ticks tab of Radial - Inner 1, then set Axis Begin value to Show, Axis End
value to Hide. Choose Radial-Inner 2, set both Axis Begin and Axis End value to Hide. Click
OK to apply the setting and close the dialog.
11. Select Graph: New Color Scale to add the color scale legend. To customize the color scale legend,
double click on the color scale to open the dialog.
o In the Color Scale Control dialog, go to Level page, and check the Hide Head and Tail Levels
o Go to Lables page, check Set Decimal Places check box and enter 1 in the Decimal Places
text box.
o Go to Layout page, select Separated in the Layout drop-down list. Click OK to apply the
setting and close the dialog.
12. Click on the Enable/Disable Anti-Aliasing button . This polar column plot should look something
like this:
1539
Tutorials for Origin
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
1540
Graphing
1. Open the Tutorial Data project and browse to folder Column and Stack Column and activate Book3F.
2. Highlight columns B through D and select Plot:Specialized:Polar theta(X) r(Y) to create a grouped line
plot in the polar coordinate system.
3. Double-click on the line plot to open the Plot Details dialog box. Make sure the left panel is expanded
and set Plot Type to Column/Bar and click Apply to change the plot to a grouped column plot.
4. On the Group tab, click the ... button to the right of Fill Color. This opens the Increment Editor.
Right-click on the first Background Color, black, and delete it from the increment list:
5. Click OK to apply the new increment list and close the Increment Editor.
6. Go to the Spacing tab and set Gap Between Bars (in %) to 30.
7. In the left panel of the Plot Details dialog, click Layer 1 (take care not to clear the check box) to
see the Layer Properties. Go to the Stack tab and recreate the following settings so that the
columns will be stacked and normalized to 100%:
1541
Tutorials for Origin
8. Go to the Display tab and select the check box Grid on Top of Data to draw grid lines on top of
data plot. Clear the X Axes check box under Show Elements to hide the Angular axis and its
associated grid lines in the graph:
1542
Graphing
9. Click OK to apply the settings and close the Plot Details dialog box.
10. Click the button in the Graph toolbar to rescale the radial axis of the graph from 0-1 to 0-100 (Or you
can press CTRL+R).
11. We have created a 100% Stack Column graph in polar coordinate system, and now we will customize
its axes. Double-click on any axis to open the Axis dialog. Click on the Radial Axes Configuration
button to open the dialog box. Recreate the following settings to display only one Radial axis at 120
degrees on the polar graph. Click OK.
1543
Tutorials for Origin
12. Go to Show tab and you will see the Radial - Inner 1 in the left panel. Select it, and change the
Flow Direction to Negative so that the tick label will be displayed outside the data plot.
1544
Graphing
13. Go to the Scale tab and make sure Radial is selected in the left panel. Set From: 10 and To: 100.
Under Major Ticks section, choose By Custom Positon in the Type drop-down list, and enter 40 80
in the 'Postion text box. Set Count to 0 for minor ticks
1545
Tutorials for Origin
14. Go to the Grids tab. For Radial Axes, set the major grid lines as following image:
1546
Graphing
15. Go to the Tick Labels tab, add a % suffix under Display subtab. Add set a horizontal offset under
Format subtab.
1547
Tutorials for Origin
1548
Graphing
16. Go to the Title page and clear the Show check box to hide the axis title.
17. Click OK to close the Axis dialog box. Your graph should look something like this:
1549
Tutorials for Origin
6.12.8.1 Summary
Normally, the polar angular axis unit reads in degrees, radians or gradians. However, Origin's polar graph also
supports use of custom units.
1550
Graphing
6.12.8.3 Steps
You can refer to this graph in Learning Center. (Select Help: Learning Center menu or press F11 key , and
then open Graph Sample: Polar Graphs)
1. Highlight column B and select Plot:Polar:Symbol theta r to create a symbol plot in polar coordinate
system.
2. Double-click on any axis to open the Axis dialog. Go to the Scale tab and select Angular in the left
panel. In this right panel, expand Units Definition node, and choose Radians as Units. Make sure the
1551
Tutorials for Origin
1552
Graphing
3. Go to the Show tab for Angular-Outer axis, then change the Direction to Clockwise and set Rotate
(deg.) to 90.
1553
Tutorials for Origin
4. Go to the Scale tab and select 'Radial in the left panel. Then set the scale from 0 to 1.2, and change the
Value of increment to 0.4.
5. Go to Tick Lables tab for the Angular- Outer axis. Open Display subtab, set Display to Custom and
enter # #/4 as Custom Format to show the tick labels as fractions.
6. Select Radial- Outer 1 axis. Choose Format subpage, and check the Bold check box. Then click the
Apply To... button. In the pop-up dialog, make sure Apply From is Outer 1 and Apply to is All Axes,
then check the Bold under the Tick Labels. Click OK.
1554
Graphing
In Axis dialog, click OK to apply settings and close the Axis dialog.
7. Double-click on the line plot to open the Plot Details dialog, in the Symbol tab, recreate the following
settings, in the sequence shown in the screenshot:
1555
Tutorials for Origin
Click OK to apply the settings and close the Plot Details dialog.
8. Select New Bubble Scale in the Graph main menu to add a bubble scale in this graph.
9. Right-click on the bubble scale, and choose Propertise... to open the control dialog. Go to the Levels
page, set the level from 0 to 1, and change the Value of increment to 0.25.
1556
Graphing
10. Go to Labels page, check the Set Decimal Places check box and enter 1 in the Decimal Places text
box.
11. Go to Layout page, choose Nested in Layout drop-down list. Select Black Edge and No Fill as Bubble
style and change the Label Offset from Symbol Center to 150. Check the Show Leader Line check
box, then expand the node to check the Auto Reoisition to Avoid Overlapping check box. Click OK to
apply the setting and close the dialog.
1557
Tutorials for Origin
Manually move the legend object and Radial axis, and click the Enable\Disable Anti-Aliasing button
1558
Graphing
to smooth the graph. The final graph should look like this:
6.13 3D Graphs
6.13.1 3D Graphs
3D Pie Chart
3D Vector
1559
Tutorials for Origin
6.13.2.1 Summary
Origin's 3D Pie Chart gives you complete control over the look of the plot. Set the thickness of the pie slice,
displacement, view angle, and size and rotation of the chart. You can even choose to explode the view of one
or more pie slices.
1560
Graphing
Label pie slices, add leader lines and drag to re-position labels.
6.13.2.3 Steps
You can refer to this graph in Learning Center. (Select Help: Learning Center menu or press F11 key , and
then open Graph Sample: Statistical Graphs)
1. Import the data \Samples\Graphing\3D Pie Chart.dat into worksheet, and rename the column long name
as Demographic and Percent.
2. Highlight the 2nd column and create a 3D Pie Chart by clicking Plot > 2D: Pie: 3D Color Pie Chart.
3. Double-click the pie chart to bring up the Plot Details dialog. On the Pattern tab, in the Fill group,
click the Color drop-down and then on the By Points tab of the Color Chooser, click on the Color
List drop-down.
4. Choose the System Color List, then move the Increment from slider to the right one color
position, then click Apply.
5. Click the Pie Geometry tab and duplicate the following settings:
1561
Tutorials for Origin
6. Click on the Labels tab and in the Position group, clear the Associate with Wedge check box.
Enable Show Leader Line if Offset Exceeds (%) and enter an offset of 2.
1562
Graphing
7. Click OK to close Plot Details. Drag the graph legend to the left side of the pie. Drag wedge labels to
reposition them, noting that the leader line follows the label. Your graph should now look something like
this:
6.13.3 3D Vector
6.13.3.1 Summary
Origin can plot 3D Vectors from two different data structures: XYZ XYZ and XYZ dXdYdZ.
XYZ dXdYdZ defines the tail and head data for the vector, while XYZ dXdYdZ provides the vector's tail data and
the distance between tail and head projections on X, Y, and Z axes.
6.13.3.3 Steps
1. Open Tutorial Data.opj and browse to the 3D Vector folder in Project Explorer (PE).
2. Select workbook Book2. Click in the upper left corner of the worksheet to select all data.
1563
Tutorials for Origin
3. On the main menu, select Plot, then point to 3D Symbol/Bar/Vector, and then click 3D Vector
XYZ dXdYdZ. This will create a 3D Vector graph with our built-in template.
4. Double-click on the vector plot to open the Plot Details dialog box. Ensure that the Original vector plot
has been selected in the left panel of the dialog box. Select the 3D Vector tab.
o In the 3D Vector tab of Plot Details dialog box, set the parameters as shown in the following
graph. Click the Color button and select Dark Green from the menu.
1564
Graphing
5. Go to Lighting tab in Format: Layer Properties dialog, Set the lighting attribute follows graph
below:
1565
Tutorials for Origin
6. Rotate the graph to a proper perspective. The final graph should look something like this:
1566
Graphing
6.13.4.1 Summary
This tutorial will demonstrate how to create a 3D scatter plot and show the projections of the plots.
1567
Tutorials for Origin
6.13.4.2 Steps
This tutorial is associated with the Tutorial Data.opj file under <Origin EXE Folder>\Samples\.
1. Open the Tutorial Data.opj file and browse to the folder 3D Scatter with Line Projections, activate the
workbook 3DScatterPlot.
2. Activate the The_First_Curve_of_3D_Scatter worksheet. The column designation for the three columns
is already set as XYZ so you could directly create a 3D scatter plot. Highlight column C and select Plot:
3D Symbol/Bar/Vector: 3D Scatter to create the plot.
3. Activate The Second Curve of 3D Scatter worksheet. Highlight column C. Move the mouse cursor
to the right edge of the selection area until the shape of the cursor changes to . Hold down the
left mouse button and drag the highlighted data into the newly created graph window. The resulting
graph should appear as shown below:
1568
Graphing
4. Double-click on the Z axis to open the Axis dialog, go to the Scale tab with Z icon on left panel
selected and reverse the Z axis by exchanging From and To values.
1569
Tutorials for Origin
5. Click OK to close dialog. Select Format: Layer Properties from the main menu to open the Plot
Details dialog. Alternatively you can double-click on the plot to bring up the dialog. If the left panel is
not visible, use the button on the bottom left of the dialog box to open it up. Expand the
Layer1 node. Choose the first plot and select All Together from the Edit Dependencies page. This
applies the same settings to the original data and all the projections.
6. Expand the first plot node and select Original and XY/XY/YZ Projection check box.
7. Set the dialog options to those shown in the screenshot below. To set the color, click on the Color
button and choose the desired option from the Individual Color drop down. Since the All Together
radio button was selected in the previous step, these settings automatically apply to the projections
as well.
1570
Graphing
9. In a similar fashion, select the second plot and set the dialog options to match those in the
screenshots below:
1571
Tutorials for Origin
6.13.5.1 Summary
This graph is a combination of a 3D bar plot showing the changes in HPI (Home Price Index) and a 3D scatter
plot showing the Unemployment Rate. The data is of several Census Divisions during different years.
Colormapping is introduced to both plots based on the Z values.
1572
Graphing
6.13.5.3 Steps
1. Open the Home Price Index Changes & Unemployment Rate.opj file by selecting File: Open and
navigate to <origin exe folder> \Samples\Graphing
1573
Tutorials for Origin
2. Activate book Home Price Index Changes & Unemployment Rate, highlight columns A(X), B(Y), and
C(Z), and then select Plot:3D Symbol/Bar/Vector:3D Bars to plot a 3D bar graph.
3. Right-click on the layer icon and choose Plot Setup from the context menu. In the Plot Setup dialog, set
columns A, B, and G1 as X, Y, and Z respectively. Then click the Add button to add this plot to the current
1574
Graphing
layer. After that, click the OK button to close the Plot Setup dialog.
4. Double-click on the plot to open the Plot Details dialog. In this dialog, select the second plot in the left
panel and set the Plot Type as 3D Scatter/Trajectory/Vector.
1575
Tutorials for Origin
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
5. Select Original in the left panel, then go to the Symbol tab in the right panel, select Col("Unemployment
rate") for both Size and Color, and set the Scaling Factor of size as 2.
1576
Graphing
1577
Tutorials for Origin
7. Go to the Label tab, check the Enable check box, set Label From as Col(F) and Position as above.
1578
Graphing
9. Select Layer1 in the left panel. In the right panel, go to the Planes tab, uncheck YZ and ZX, select At
Position= for the Position dropdown list and enter 0 for the Percent/Value blank box.
1579
Tutorials for Origin
11. Select the first plot under Layer1 in the left panel, go to the Pattern tab, use Col("Changes in HPI") as
the colormapping for both bar border and shape fill.
1580
Graphing
13. Go to the Numeric Format tab, select Decimal Places and set it to 0.
14. Go to the Colormap tab, click Level... header to open the Set Levels dialog. Do settings as below.
1581
Tutorials for Origin
15. Click OK button to close the Set Levels dialog. Click Fill... and select the Pumpkin Patch as the palette.
Click OK to close the Fill dialog.
18. Click OK button to close the Color Scale Control dialog. Then right-click the layer icon to activate the
other plot from the context menu, then select Graph: New Color Scale from the main menu to add
1582
Graphing
another color scale. Double-click on this color scale to open the Color Scale Control dialog. In this
dialog, do the settings as the previous step does.
19. Add titles Changes in HPI and Unemployment Rate for these two color scales. Finally, you will get the
graph given below.
1. In the following steps, we want to customize the order of values shown in the graph but not change
the source data. Right click on window title of source data book, select View: Categories, a new
column label named Categories will be added to the head of the worksheet. Double click the
"unsorted" to open the Categories dialog:
1583
Tutorials for Origin
2. Uncheck the <auto> checkbox, then you can specify the order of the items by using
3. Double click the Categories cell of column B,"Unsorted", to open the Categories dialog. Select
Ascending in the Sort list, click OK to close the dialog.
1584
Graphing
4. The 3D bar graph will be updated automatically with the new order of Categorical data.
1585
Tutorials for Origin
6.13.6.1 Summary
In this tutorial, a 3D color map surface graph as shown below will be created from a matrix with missing
values. It will also demonstrate how gridlines can be skipped by customization.
6.13.6.3 Steps
1. Start with a new worksheet and import the file \Samples\Graphing\Surface With Missing Values.dat.
Hover the cursor over the cell in the top left corner of the worksheet till it appears as a slanting black
arrow and click to highlight. Select Plot: 3D Surface: Color Map Surface from the Origin main
menu to create a graph. This is a virtual matrix so the plotvm dialog (plot virtual matrix dialog) will
appear. Use the system default settings as below:
1586
Graphing
1587
Tutorials for Origin
3. Double click on the graph to pull up the Plot Details dialog. If the left panel is not expanded use the
button on the bottom left of the dialog to open it. Expand the tree node on the left panel to
make sure that the box under Layer1 is selected. The next few steps will customize the graph using
the settings in the Plot Details dialog. Activate the Colormap / Contours tab on the right panel.
Click the Level heading to open the Set Levels dialog and set the dialog as shown in the following
image.:
1588
Graphing
4. Click on the Fill heading to open the Fill dialog. In this dialog, choose the Load Palette radio button
and then click the Select Palette button to choose the Reef palette. Ensure the Link to Palette
check box has been enabled. Click the OK button to return to the Plot Details dialog.
1589
Tutorials for Origin
5. Click on the Line heading to open the Contour Lines dialog. Check Color check box under Apply to
All, and set Color to LT Gray. Click the OK button to return to the Plot Details dialog.
1590
Graphing
6. Activate the Mesh tab on the right panel. Deselect the box before Enable as the following screenshot
shows. Click Apply. This will remove the mesh lines on the graph:
7. Click on the Layer1 on the left panel, and select Lighting tab on the right panel. Select Direction in
Mode. Click OK to save the setting and close the dialog.
8. Double click on the axis title object(s) to modify them to X and Y for X and Y axis respectively.
9. Click the layer spacer to active the 3D transform control toolbar, then select the Rotate button to
rotate the 3D graph to a desired orientation:
1591
Tutorials for Origin
1592
Graphing
6.13.7.1 Summary
Many plot types, such as 3D Surface, 3D Bars, and Contour, can be created from data contained in a matrix
object or from data arranged in a block of cells in a worksheet. The latter arrangement is referred to as a
Virtual Matrix. Whereas a typical matrix object only supports a linear mapping of X and Y coordinates, a
virtual matrix supports nonlinear mapping as well. In this tutorial, we show you how to create intersecting
color map surface plots from virtual matrix data.
Create a Color Map Surface plot using virtual matrix data from a worksheet
Set transparency
6.13.7.3 Steps
This section will demonstrate how to create surface plots from data in a worksheet.
1593
Tutorials for Origin
1594
Graphing
6. In the impASC dialog, modify the settings according to the following image, so that the two data files will
be imported as two worksheets with name VSurface1 and VSurface2 in one workbook:
1595
Tutorials for Origin
The data has X coordinate values in the top row and Y coordinate values in the first column. Note that the
X coordinates have nonlinear spacing.
8. With the "VSurface 1" sheet active, hover the cursor over the cell in the top left corner of the worksheet
till it appears as a slanting black arrow and click to highlight. .
9. Select the menu item Plot>3D:Surface:3D Colormap Surface to open the plotvm dialog.
10. Note:This dialog opens every time a 3D or Contour plot menu item is invoked with a group of worksheet
cells selected. The dialog allows you to define where the X and the Y coordinate values are located.
1596
Graphing
11. In this dialog, adjust the settings as shown in the image below:
1597
Tutorials for Origin
12. Click OK to generate a Color Map Surface plot and a virtual matrix as shown below:
1598
Graphing
13. Repeat the last step to plot another Color Map Surface plot using data from the VSurface 2 worksheet.
This time VSurface 2 will be automatically used as Z title in the plotvm dialog.
This section will demonstrate how to add a surface plot to a graph layer that already contains another surface
plot.
1. Activate Graph1, right-click on the Layer 1 icon on the top left corner of the graph and select Layer
Contents from the context menu.
2. In the Layer Contents dialog that opens, select VSurface2 from the Available Data panel on the left and
add it to the Layer Contents box on the right using the arrow that points to the right in the center of the
dialog box (The arrow below it can be used to shift selected items from Layer Contents to Available Data).
1599
Tutorials for Origin
3. Click OK to add the second surface, the graph will now appear as shown below:
The next step is to set the transparency of the second surface so that parts of the first surface are visible in
this intersection plot.
1. Double click on the second colormap surface to open the Plot Details dialog.
1600
Graphing
2. In the Surface tab, move the Transparency slider to 40% and click Apply, then OK.
The completed graph should appear as the the image shown below:
1601
Tutorials for Origin
6.13.8.1 Summary
6.13.8.3 Steps
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
1. Open the Tutorial Data project and browse to folder Intersecting Surfaces in Project Explorer.
2. Active the MBook36 matrix. Note that the matrix displays two thumbnail images above the data, one for
each matrix object in the matrix.
3. Select either thumbnail image. From the main menu, select Plot, then point to 3D Surface, and then
click Multiple Colormap Surfaces. This will generate an intersecting surface plot of every matrix object
in the matrix sheet.
4. Open the Layer Properties dialog by double-clicking on the graph layer, or by selecting Format:Layer
Properties... from the main menu. Go to the Lighting tab, and change the Mode to Directional to turn
on the lighting effect.
1602
Graphing
Click on Apply button, you can find the graph showing as this:
1603
Tutorials for Origin
5. Expand the Layer 1 branch in the left panel, select [MBook36]MSheet1!_1(Z)[1*:400*] to open the
Plot Properties dialog. In the right panel, go to the Colormap/Contour tab, uncheck the Enable
Contours check box to turn off contour lines
6. Click the Fill... column header to open the Fill dialog box. Click the default Rainbow palette to open the
palette menu. On the palette menu, select Pastel. Click OK to close the Fill dialog box.
7. Select [MBook36]MSheet1!_2(Z)[1*:400*] in the left panel. Uncheck the Enable Contours check
box. And click Apply to see the modifications so far. Do the same for
[MBook36]MSheet1!_1(Z)[1*:400*].
8. Keep [MBook36]MSheet1!_2(Z)[1*:400*] selected, and go to the Mesh tab and clear the check box
before Enable to turn off the mesh lines. Do the same for [MBook36]MSheet1!_1(Z)[1*:400*].
Click OK to close the Plot Details dialog box and update the graph.
9. Now we will construct the an additional color scale for the second surface, change that plot to be active by
click Data:2 [MBook36]MSheet1!_2(Z)[1*:400*], then click Graph:New Color Scale to create color
scale for this plot.
10. Double click on the newly added color scale object to open the Color Scale Control, change the settings
according to the screenshots below, then drag and put the color scale object to a desired place on the
layer:
1604
Graphing
1605
Tutorials for Origin
11. You can use the 3D rotation button to rotate the graph and gain an overhead perspective. This
button is a part of the 3D annotation toolbar which can be brought out by clicking the graph layer once
1606
Graphing
6.13.9.1 Summary
Origin supports transparency in most graph types. This feature permits the visibility of parts of a graph that
would otherwise be obscured by overlapping plots. In this tutorial, we will add a fitted surface to a scatter plot,
set transparency to make data points "behind" the surface visible, and add drop lines and error bars for data
points.
1607
Tutorials for Origin
Surface with Symbols and Droplines Surface with Symbols and Error Bar
Create a 3D scatter plot from worksheet data and add a color fill surface to it.
6.13.9.3 Steps
1. Open the Tutorial Data.opj and browse to the folder Surface with symbols and droplines.
2. Active the worksheet XYZRandomGauA, highlight the XYZ to plot a 3D scatter by selecting Plot: 3D
Symbol/Bar/Vector: 3D Scatter from the main menu.
1608
Graphing
3. Now we will add a 3D Color Fill Surface plot to this 3D scatter graph. In the top left corner of the graph
window, double-click the layer 1 icon to open the Layer Contents dialog.
4. In the Layer Contents dialog box, select Matrices in Folder from the dropdown menu in the upper
left. In the left panel, select MBook 3, Click the triangle button next to A and select 3D - Surface.
1609
Tutorials for Origin
5. Click OK button to apply the change and close the Layer Contents dialog. Double-click the graph to
open the Plot Details dialog box. In the left panel of this dialog, expand all items and select Original
(or choose Plot Properties from the Format menu). In the right panel, on the Symbol page set
Size as 9 and Color as Olive from Individual Color fly-out menu and click Apply.
6. In the left panel, select the surface plot, and then go to the Fill tab in the right panel, change the Fill
piece by piece as Red. Set Transparency to 60 and click Apply.
1610
Graphing
7. Go to the Mesh tab, set the Line Width as 1 and Set Total Number of Majors as X=9 and Y=9,
and Major Line Color as Black and click Apply.
1611
Tutorials for Origin
8. Now we will draw the drop lines. In the left panel, select the scatter plot (Original). In the right panel,
select the Drop Lines tab. Select the Parallel to Z Axis check box, change the drop line Width to 2
and set the Drop to to Surface.
1612
Graphing
9. Click OK to close the dialog and delete the legend. Your final graph should look like this:
1613
Tutorials for Origin
1. Follow steps 1 through 8 above and click OK to create a 3D surface graph with a scatter plot.
2. Add a new column in the worksheet "XYZRandomGauA". Select the column and right-click. In the Fill
Column with context menu, click Uniform Random Numbers.
3. Double click on the newly created graph to open the Plot Details dialog. Expand the node to select
the plot (Original) in the left panel. On the Error Bar tab, select the Enable check box, and select
Col(D) from the Error Data dropdown menu.
4. Click OK to close the dialog and delete the legend. Your final graph should look like this:
1614
Graphing
6.13.10.1 Summary
Origin can represent four-dimensional data by color-mapping a surface plot using a second matrix.
1615
Tutorials for Origin
6.13.10.3 Steps
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
1. Open the Tutorial Data project and browse to folder Surface with Colormap from Another Matrix in
Project Explorer.
2. Active the MBook1D matrix, You should see two image thumbnails above the matrix data, just under the
title bar. (If you do not see image thumbnails, right-click on the matrix title bar and select Show Image
Thumbnails.) Select image thumbnail 1."
3. On the main menu, click Plot, point to 3D Surface, then click Color Fill Surface to generate a
surface plot.
1616
Graphing
4. Double click on the plot to open the Plot Details dialog. In the left panel, select
(MBook1D)MSheet1. In the right panel, select the Fill tab. Choose Coutour Fill from Matrix. and
select Mat(2) for front surface.
5. Go to Colormap/Contours tab, click the Level... title to open the Set Levels dialog. In this dialog,
click Find Min/Max button and set the #Major Levels and #Minor Levels as 10 and 9.Click OK
button to close the dialog.
1617
Tutorials for Origin
6. Click the Fill... title to open the Fill dialog. select Load Palette and then click Select Palette button
to select Rainbow palette.Click OK button to close this dialog.
7. Check the Enable Contours check box. And then click Line... to open the Contour Lines dialog. In
this dialog, check the Show on Major Levels Only check box and set the Line Properties as below.
Click OK button to close the dialog.
1618
Graphing
8. Go to the Mesh tab,uncheck the Enable box to disable the mesh lines.
9. Select Layer1 in the left panel, go to Lighting tab in the right panel. Select Directional under
Mode. Set Horizontal and Vertical as 124 and 40 , and change the color of Diffuse as LT Gray and
Specular as Gray. Then set the Shininess as 37.
1619
Tutorials for Origin
10. Go to the Planes tab, set the color as Gray and select Front Corner for the Cube drop-down menu.
11. Go to Axis tab and do settings as below. Click OK button to close this dialog.
1620
Graphing
12. Keep the graph window active. Select Graph: New Color Scale to add a new color scale in the graph
window.
13. Double-click anywhere on the color scale to open the Color Scale Control dialog box. Select Layout
in the left panel, change Color bar thickness to 150 and check the Reverse Order check box.
1621
Tutorials for Origin
14. Select Labels in the left panel, set the Font Size to 14 in the right panel as below:
1622
Graphing
15. Double-click the X, Y and Z axis title and enter "X distance", "Y distance" and "Height". Add a text object
"Pressure(psi)" above the color scale.
6.13.11.1 Summary
This tutorial will show you how to create a 3D color map surface.
1623
Tutorials for Origin
6.13.11.3 Steps
1. Download the project by clicking the Download Project link at the top of this page.
2. Open the project in the zipped file. Highlight HFT data matrix and select Plot: 3D Surface: Colormap
Surface with Projection to create a 3D graph.
1624
Graphing
3. Choose Format: Plot Properties to go to the plot level of the Plot Details dialog.
4. Select the surface plot, go to the Mesh tab, uncheck the Enable box to turn off the mesh lines. Go to
Colormap/Contours tab, click Line title to open the Contour Lines dialog. In this dialog, uncheck Show
on Major Levels Only and select Hide All to hide all contour lines.
1625
Tutorials for Origin
5. Select the projection plot in the left panel, go to Surface tab, Enter 0 as the following image shows to put
the projection to the bottom of the graph.
6. Go to the Mesh tab, uncheck the Enable box to disable the mesh lines. Go to Colormap/Contours tab,
hide all contour lines like the step4 does.
7. Click Layer 1 in the left panel, and then in the right panel select the Lighting tab. Change the setting as
following to enable lighting effect:
1626
Graphing
8. Finally, change axis titles and add a graph title as the following graph.
6.13.12.1 Summary
This tutorial demonstrates how to create a 3D sphere using the data from three matrices. It also shows how
the surface is filled to display the surface temperature contour using the data from a different matrix.
1627
Tutorials for Origin
6.13.12.3 Steps
1. Open Tutorial Data.opj and browse to the Parametric Surface with Colormap from Data folder in
Project Explorer (PE).
2. Activate the matrix FUNCA:1/4, and highlight the data. Click the button on the 3D and Contour
Graph toolbar to create a colormap surface as shown below. You can also create this colormap
surface by selecting Plot: 3D Surface: Color Map Surface in the main menu.
1628
Graphing
3. Double click on the plot to bring up the Plot Details dialog. In the Surface tab check the
Parametric Surface box and set X Matrix, Y Matrix as Mat(2), Mat(3) respectively.
1629
Tutorials for Origin
4. In order to display the complete colormap surface in the axes area use the rescale button in the
Graph toolbar. The colormap surface should appear as shown below:
5. Double click on the plot to open Plot Details dialog. This dialog box is used to customize the surface.
In the Fill tab Front Surface section deselect the box before Self and set Contour fill from matrix
as Mat(4). Click Apply.
1630
Graphing
6. Activate the Colormap / Contours tab. Click the Level heading to open the Set Levels dialog. Click
Find Min/Max and set Major Levels, Minor Levels as 16, 8 respectively. Click OK.
7. Click Fill to open the Fill dialog. This dialog is used to customize the color scale. The Load Palette
option allows the user to select from a list of possible palettes. Set Load Palette as Temperature.
Click OK.
1631
Tutorials for Origin
8. Click on the Mesh tab. Set Line Width as 0.05 by clicking on the font box and typing the value
instead of using the drop down menu. Set Line Color in the Front section as LT Gray. Click Apply.
1632
Graphing
9. In the Numeric Formats tab choose the Decimal Places radio button and set its value as 0.
Click OK to apply the settings and close the Plot Details dialog. The graph should appear as shown
below:
10. The next step is to modify the axes. Double click on the Z axis to open the Axis Dialog. Go to the
Scale tab, select Z icon. Set the value of From and To as -400 and 400 respectively.
1633
Tutorials for Origin
11. Go to the Title tab, hold Ctrl key and click to select X, Y and Z together. Deselect the Show check
box to hide the axis title for all axes and click OK to close the dialog.
12. Double click on the XY Plane to open Plot Details - Layer Properties. In order to hide the axes, in
the Display tab, deselect the X Axes, Y Axes, Z Axes boxes under the Show Elements section.
1634
Graphing
13. To hide the YZ and ZX planes, click on the Planes tab, and deselect the boxes before YZ, ZX. Set the
Color of the remaining XY plane as LT Gray. Click OK to close the dialog.
1635
Tutorials for Origin
14. The next step is to customize the color scale. Double click on it to open the Color Scale Control
dialog, go to the Labels node and set the Font as Verdana.
15. Go to the Line and Ticks node and hide the border and ticks:
16. Click OK to apply the setting and close the dialog. Select and drag to move the color scale object to the
desired location.
1636
Graphing
17. Right click on the white area of the graph layer to bring up a context menu and choose Add/Modify
Layer Title. Click else where to deselect the text box, then right-click on it and select Properties...
from the shortcut menu to open the Object Properties dialog. Set the font as Verdana and type
Surface Temperature (\+(o)C) in the content table. Click OK.
18. Click on the graph layer within the 3D frame (not the data plot), and click the Rotate button as
shown in the image below, to activate the rotation mode. Other ways to rotate the 3D plot include
using the red rotate button in the Tools toolbar, the various buttons in the 3D Rotation toolbar or by
selecting in the plot, pressing the R key and using the cursor.
1637
Tutorials for Origin
Rotate the plot to get a better view. The graph should resemble the image shown below:
1638
Graphing
6.13.13.1 Summary
This tutorial shows how to create stacked 3D colormap surfaces from different matrix objects. The surfaces in
the plot display the topology before and after volcanic eruption:
6.13.13.3 Steps
1. Open Tutorial Data.opj and browse to the Stacked 3D Surface Plots folder in Project Explorer (PE).
1639
Tutorials for Origin
2. Activate the matrix book Mbook1 which contains two matrix objects, then click Plot: 3D Surface:
Multiple Colormap Surfaces to create two 3D surfaces from these two matrix objects as shown
below:
3. Double click on the plot to open the Plot Details dialog. If the left panel is not open the use the
arrow button on the bottom left of the dialogue. There are two surfaces under the Layer1 node on
the left panel. To shift the "After eruption" surface in Z axis, activate the second plot under Layer1
on the left panel, and in the right panel, select the Surface tab. Check the Shift in Z by percent of
scale range box, and enter 70 in the text box.
4. In the Fill tab Front Surface section, deselect the Self box to fill contour by the same matrix object
(Mat "Before") as the other surface used.
1640
Graphing
5. Select the Colormap / Contours tab. Click Level.. to bring up the Set Levels dialog. Set the
parameters as shown in the following graph and click OK.
Then uncheck the Enable Contours checkbox to hide the contour lines. Click OK.
1641
Tutorials for Origin
6. In the Mesh tab deselect the Enable box to disable the mesh line.
7. Repeat steps 5 to 6 for the first plot under the Layer1 node.
8. In this project the two surfaces use the same matrix as contour fill, so they can share one color scale.
To set the numeric format of the color scale, activate the first plot on the left panel of the Plot
Details dialog. Select the Numeric Formats tab on the right panel. Select Scientific: 10^3 from
the drop down list next to the Format, and set Significant Digits as 2. Click OK.
1642
Graphing
To customize the color scale, double click on the color scale to open the Color Scale Control
dialog. Check the Reverse Order box and set Color bar thickness as 100. Click OK.
The next step is to change the the axes scale and tick labels' format in the Axes dialog. To open this dialog,
select Format: Axes: X Axis...
1643
Tutorials for Origin
1. Double click on the blank space outside the plots or click Format: Layer Properties... from the menu to
open the Plot Details - Layer Properties dialog.
2. Activate the Miscellaneous tab on the right panel. Check the box before Enable in the Clipping
section, which will clip the image outside the axes area according to the settings in the Clipping
section.
3. In the Planes tab set Color as LT Gray for all planes. Select Front Corner from the drop-down list
in the Cube section to show the cube's border.
1644
Graphing
4. Select the Lighting tab. In the Mode section, choose Directional to enable lighting mode. Set Light
Color as shown in the following graph. Click OK.
1. Click on the cube (not the data plot) to activate the 3D toolbar. Click the Resize button , a 3D
Cartesian coordinate will show up. Place the cursor on Y axis, which will then be highlighted, at this
moment drag-and drop the Y axis to stretch the plot in Y axis direction. Do the same to X direction and Z
direction.
1645
Tutorials for Origin
2. Click the rotate button to activate rotation mode. A sphere will be displayed at the center of the plot.
Rotate the plot to get a better view.
The 3D toolbar allows you to resize and rotate the plot freely. However, you can also achieve the
same view as Graph1 in this sample project by setting the value in the Axis tab of the Layer
Properties dialog as shown in the following graph.
6.13.14.1 Summary
The four stacked surfaces shown below were created from the same matrix. The first layer from the top is a
wire frame, the second layer is a flattened contour line plot, the third layer is a color filled surface with lighting
effect, and the bottom layer is a flattened color filled contour plot.
1646
Graphing
6.13.14.3 Steps
1. Open Tutorial Data.opj and browse to the Multiple Surfaces in Same Layer folder in Project
Explorer (PE).
2. Select the MBook8 worksheet and highlight all that data. From the Main Menu select Plot: 3D
Surface: Colormap Surface. The graph window should appear as shown below:
1647
Tutorials for Origin
3. With the new graph window active choose Graph: Layer Contents.... In the Layer Contents -
Layer 1 dialog box, select the MBook8 matrix in the left panel and click the Add plot button (the
right-pointing arrow in the center of the dialog) three times. Click OK. This will add the same MBook8
data to the graph layer four times. Note that at this point there only a single plot, the following steps
will change that.
4. Double-click on the plot to open the Plot Details - Plot Properties dialog box. Select the first plot in
the left-hand panel and in the Surface tab check the Flat box, check Shift in Z by percent... and
enter 0 in the accompanying text box. Select the second plot, leave Flat unchecked, check Shift in
1648
Graphing
Z... and enter 23. Select the third plot, check Flat, check Shift in Z... enter 65. Select the fourth
plot, leave Flat unchecked, check Shift in Z... and enter 82. Click OK.
5. Double-click on the Z axis, and in the Axes Dialog box, go to the Scale tab, make sure Z axis icon is
selected and set From to 0 , and To to 900.
6. Go to the Tick Labels tab, hold Ctrl key to select X and Y icons together. In the Display tab, for
Divide by Factor, enter 100000.
1649
Tutorials for Origin
7. Go to the Title tab, select the X icon and enter X Coordinate/ 10\+(5) meter as the text for X
title. Select the Y icon and enter Y Coordinate/ 10\+(5) meter as title text.
1650
Graphing
8. Go to the Grids tab, hold Ctrl key to select X, Y and Z icons together. Under Major Grid Lines clear
the Show check box to hide the grid lines for all axes.
9. Click the OK button. The graph should now display four separate surfaces as shown below:
1651
Tutorials for Origin
1. Double-click on "Surface 1" to open the Plot Details dialog. Select the Colormap/Contours tab and
click on the Fill... header to open the Fill dialog. In the Fill dialog, select Load Palette then click
Select Palette and select the Reef palette. Click OK to close the Fill dialog.
1652
Graphing
3. Select the Mesh tab and clear the Enable check box.
1. Select the second data set (do not clear the accompanying check box), click the Fill tab, select Fill
piece by piece and choose Dark Yellow from the drop-down.
1653
Tutorials for Origin
2. Select the Colormap/Contours tab and clear the Enable Contours check box.
3. Select the Mesh tab and clear the Enable check box.
1. Select the third data set, click the Fill tab and clear the Enable check box.
1654
Graphing
2. Select the Colormap/Contours tab click on the Line... header to open the Contour Lines dialog. In
this dialog, select the Link Line to Colormap Color checkbox. Click OK to close the Contour Lines
dialog.
3. Select the Mesh tab and set the Line Width to 1. In the Major Minor Lines section, choose the
settings shown below and in the Line Color section select the Use Colormap check box .
1655
Tutorials for Origin
1. Select the fourth data set, click the Fill tab and clear the Enable check box.
2. Select the Colormap/Contours tab and clear the Enable Contours check box.
1656
Graphing
3. Select the Mesh tab and set the Line Width to 1. In the Major Minor Lines section, choose the
settings shown below and in the Line Color section set Major Line Color to Black .
4. Select Layer1 in the left panel. In the Lighting tab choose Directional for Mode and set the
Direction group controls as shown below:
1657
Tutorials for Origin
5. Select the Planes tab. Specify the colors of the YZ and ZX planes as shown below (a custom color
approximating "eggshell" for YZ and LT Gray for ZX works well).
7. Rotate the 3D graph if you want to. Your graph should resemble the image shown below.
1658
Graphing
6.13.15.1 Summary
This tutorial will demonstrate how to create a 3D scatter plot with Z colormap from XYZ data in a worksheet,
set scatter size proportional to the data in a specified column, and create projections of the data on all three
axis planes.
1659
Tutorials for Origin
6.13.15.3 Steps
1. Open Tutorial Data.opj and browse to the 3D Scatter with Colormap folder in Project Explorer (PE).
2. Activate the workbook A3DScatter, and highlight col(C). Select Plot > 3D: Line & Symbol: 3D Scatter
to generate a scatter plot.
1660
Graphing
3. A Reminder Message window like the one shown below will pop up, stating that the graph might not
be correctly displayed if the OpenGL version is less than 2.1. The OpenGL version of your video card
is listed on the Reminder Message window. Click OK to close the window.
Note: Speed Mode might be turned on if the OpenGL version is too low.
4. Double click on the plot to open the Plot Detail dialog. If the left panel is not expanded use the
button on the bottom left of the dialog to expand it. Expand the Layer1 option and select the
Original level, this contains the original data. This dialog box is where the 3D scatter is customized.
5. In the Symbol tab, set Shape as Sphere. In order to use the sphere sizes to show the differences of
Engine Displacement, select Size as Col(E): "Engine Displacement"), and set Scaling Factor as
0.005. Type manually into the edit box instead of using the drop down menu. For Color, click the
drop-down menu, then choose the By Points tab of the Color Chooser. Click on Color Mapping and
choose Col(C): "Power" to introduce a Z-value colormap. Set Transparency to 25%.
1661
Tutorials for Origin
6. Select the Colormap tab. Click the Level... title to open the Set Levels dialog. Set From as 30.
Select Increment, and set it as 15. Set # Minor Levels as 9. Click OK.
7. Click the Fill... title to open the Fill dialog. Select Limited Mixing. Click the default color of From
and then click the square box under Custom section in the color setting panel to open the Colors
dialog. In the Colors dialog, set the Red, Green and Blue option in the bottom right as 74, 74, 255.
Do the same thing for To color and set the Red, Green and Blue option as 255, 100, 255. Click OK.
1662
Graphing
1663
Tutorials for Origin
8. Click on the fill color of <30 level to open the Fill dialog. Set Fill Color as None. Click OK. Repeat
the this step to set fill color of >168 level as None. This will ensure that there is no color for levels
above and below the specified range.
9. The next step is to add the data projections. In the left panel of the Plot Details dialog, select the option
above Original, and select the Fully Independent radio button. This will ensure that when the
projections have been enabled, each can be customized separately. Check the boxes for XY Projection,
ZX Projection and YZ Projection to enable the scatter projections on all three planes.
10. To customize the colors of the projections, in the XY Projection level Symbol tab, set its color as
Olive(the 12th common color). Set the symbol color of ZX Projection and YZ Projection as Red
(the second common color) and Orange (the 15th common color) respectively. Click OK.
1664
Graphing
11. In order to remove the grid lines, double click on the X axis to open the Axes dialog. Select the Grids
tab on the right panel, hold the CTRL key and select Y and Z axes to customize the settings together,
then deselect the Show box under Major Grid Lines to hide the major grid lines of all axes.
1665
Tutorials for Origin
12. The next step is to change the scale for the axes. On the Scale tab for each axis set the following; for X
Axis, change the From, To value and the increment Value of major ticks to 5, 30, 5 respectively, and
then check the Reverse check box; for Y Axis, to 5, 40 and 10, and then check the Reverse check box;
And for Z Axis, to 20, 180 and 20. Click OK.
13. To designate the color for the background of the entire window, open the Plot Details dialog again.
In the left panel, select the Graph level above the Layer1 option. Select the Display tab. Set Color
as LT Gray. Click OK.
14. Delete the legend object created by default, we are going to add a color scale legend instead.
15. In order to add a color scale legend, click the Add Color Scale button in the Add Object to
Graph toolbar. Double click on the color scale to bring up the Color Scale Control dialog. Set the
color scale format according to the screenshots below:
1666
Graphing
1667
Tutorials for Origin
16. Right click on the page layer to bring out the context menu. Select Add/Modify Layer Title and type
Symbol Size proportional to Engine Displacement in the text box that appears as the layer title.
17. The graph should appear as shown below. Rotate to explore all sides:
This graph consists of a flat surface and an XYZ scatter with labels. The US Map is a matrix with 1's and 0's,
displayed as a flat surface. The population data is an XYZ scatter plot with droplines.
1668
Graphing
6.13.16.2 Steps
1. Open Tutorial Data.opj and browse to the 3D Scatter with Droplines folder in Project Explorer (PE).
2. Activate MBook1B, select Plot:3D Surface:Colormap Surface from the main menu. A graph
window will be generated.
1669
Tutorials for Origin
3. Double-click on the plot to open the Plot Details dialog. In the Surface tab, check the Flat check
box.
4. Go to the Colormap/Contours tab, click the Fill... header to open the Fill dialog. In this dialog,
select Limited Mixing and set the From and To colors as shown below.
1670
Graphing
6. Click the Level... header to bring up the Set Levels dialog. Set the levels as given below.
1671
Tutorials for Origin
9. Click the OK button to close the dialog. On the graph window, right-click on the layer icon to select
Layer Contents... from the context menu to open the Layer Contents dialog. In this dialog, select
Worksheet in Folder from the top-left drop-down list, select col(D) in the left panel and select 3D
Scatter/Trajectory/Vector as plot type, check the Rescale on Apply check box, and then click the
arrow to add col(D) to the right panel as a 3D scatter plot.
10. Click OK button to close the Layer Contents dialog. The population data will be added to the graph
as shown below.
1672
Graphing
11. Double-click on the 3D scatter plot to open the Plot Details dialog. Go to the Symbol tab, set the
Size as 18 and set the color as colormap defined by col(Population).
12. Go to the Colormap tab, click on the Level... header to open the Level dialog. Set the level as given
below.
1673
Tutorials for Origin
13. Click OK to close the Set Levels dialog. Click on the Fill... header to open the Fill dialog. In the Fill
dialog, select Load Palette and then click the Select Palette button to select the Watermelon
palette. Click OK to close the Fill dialog.
1674
Graphing
15. Select Layer1 in the left panel and then go to the Size/Speed tab in the right panel. Uncheck the
check boxes under Speed Mode, Skip Points if needed.
16. Select Graph level in the left panel and then go to the Display tab, set the Color as LT Gray.
1675
Tutorials for Origin
17. Click OK to close the Plot Details dialog. Finally, you will get the graph given below.
1676
Graphing
This graph shows the topography of Lake Ontario. It is a combination of a 3D surface and a transparent plane.
6.13.17.2 Steps
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
1. Open the Tutorial Data project and browse to folder Surface With Transparent Plane in Project
Explorer.
2. Activate MBook3L, and highlight all data. Select Plot:3D Surface:Colormap Surface from the main
menu. A graph window will be generated as shown below:
1677
Tutorials for Origin
3. Right click on the layer icon 1 at the top right of the graph and select Layer Contents..., add
MBook2 as a 3D surface into this layer by shifting it from the left panel to the right panel using the
arrow button in the center of the dialog as shown below. Then click OK to close dialog.
4. Double-click on the graph to open the Plot Details dialog. If the left panel is not expanded use the
button. This dialog is where the 3D plot will be customized. Select Layer1 in the left panel, and
in the Axis tab in the right panel apply the settings shown below:
1678
Graphing
5. Select the first plot in the left panel under the Layer1 option and in the Colormap/Coutours tab,
click on the Level... header to open the Set Levels dialog. In this dialog, apply the settings below:
1679
Tutorials for Origin
6. Use the OK button to close the Set Levels dialog. Click on the Fill... header to open the Fill dialog.
In the Fill dialog, select Load Palette and click the Select Palette button to select the Watermelon
palette. Click OK to close the Fill dialog.
7. To remove contours, in the Colormap/Coutours tab deselect the Enable Contours check box as
shown below:
1680
Graphing
8. To remove the mesh, in the Mesh tab, deselect the Enable check box as shown below:
9. In the Side Walls tab, check the Enable box and set the X and Y side walls as shown below:
11. Select the second plot in the left panel and in the Surface tab, set the Transparency as 48:
1681
Tutorials for Origin
12. Open the Fill tab of the Plot Details dialog, select Fill piece by piece and set the color as Blue.
Click Apply to review changes.
13. The next step is to set the lighting effect. Select Layer1 in the left panel and in the Lighting tab,
apply the settings shown below:
14. In the Planes tab, deselect the XY, YZ and ZX plane boxes. Click the OK button to close the Plot
Details dialog.
1682
Graphing
15. The next step is to add a title. Right-click on the blank area of the graph window and select
Add/Modify Layer Title from the menu that appears, enter Lake Ontario as the layer title. Right-
click on the title and select Properties... from the menu to open the Object Properties dialog. In
the Texttab, set font size to 31, then go to Frame tab and set Frame to Shadow.
1683
Tutorials for Origin
16. To customize the color scale, double-click on the color scale to open the Color Scale Control dialog.
Select Line and Ticks on the left panel, on the right panel, deselect Show Line and Ticks on the
Right and Show Border to hide the line, ticks and border.
17. Select Layout on the left panel, modify Color Bar Thickness as 150 to change the width of the color
scale, set Label Offset from Bar Edge as 0 to move the label closer to the color scale.
1684
Graphing
18. Select Title on the left panel, on the right select Show to display the title, and add (m) at the end of
the Title text box to display the title as Elevation(m) for the color scale. Change Size under the Font
branch as 18. Click OK to apply the settings and close the dialog.
1685
Tutorials for Origin
19. You can double click the color scale title to activate the in-place edit mode, place the cursor after
%(?R,@LA) and press ENTER on the keyboard to start a new line for (m). The complete graph should
appear as shown below:
1686
Graphing
This graph is a combination of a flattened 3D surface of US Map with state divisions and 3D bars representing
the city populations, the bars locate the longitude and latitude of the cities.
1687
Tutorials for Origin
6.13.18.2 Steps
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
1. Open the Tutorial Data project and browse to folder 3D Bar on Flat Surface in Project Explorer.
2. Activate MBook1E, select Plot>3D:Surface:3D Colormap Surface from the main menu. A graph
window will be generated.
3. Double-click on the graph to open the Plot Details dialog. In the Surface tab, check Flat and Shift in Z,
set the Z offset to 0 and the Transparency to 50.
1688
Graphing
4. Go to the Colormap/Contours tab, click on the Level... header to open the Set Levels dialog. In this
dialog, set the Major Levels to 8, Minor Levels to 0.
5. Click the OK button to close this dialog. Click on the Fill... header to open the Fill dialog. In the Fill
dialog, select Load Palette, click Select Palette button to select Thermometer palette and uncheck the
Link to Palette check box.
1689
Tutorials for Origin
6. Click OK button to close the Fill dialog. Click the fill cell of last level and set its color as White.
1690
Graphing
9. Select Layer1 in the left panel, go to the Planes tab in the right panel. Uncheck the XY, YZ, and ZX
check boxes.
1691
Tutorials for Origin
10. Click OK to close the Plot Details dialog. Right-click on the layer icon and choose Plot Setup from the
menu. In the Plot Setup dialog, choose Worksheets in Folder for Available Data, 3D-Bars as Plot Type
and USMetropolitan as the data source sheet. Set Longitude, Latitude, and Population as X, Y, Z
respectively. Click Add to add the 3D bar graph to the current layer.
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
11. Click OK to close the Plot Setup dialog. Select Graph: Rescale to Show All to rescale the graph.
1692
Graphing
12. Double-click on the 3D bar graph to open the Plot Details dialog. In the Pattern tab, set the color of
Border and Fill as red, and set Gradient Fill as shown below.
13. Click OK to close the Plot Details dialog. On the graph window, right-click on the layer icon and select
Layer Contents... from the context menu to open the Layer Content dialog. In this dialog, select
Worksheets in Folder for the top-left drop-down list, add col(C) and Col(D) in Sheet Label as a 3D bar
graph and a 3D scatter respectively to the current layer.
1693
Tutorials for Origin
14. Click OK to close the Layer Content dialog. Double-click on the 3D bar graph to open the Plot Details
dialog. Select the third plot in the left panel, and go to the Pattern tab, apply the settings given below.
16. Select the forth plot in the left panel, go to the Label tab and apply the settings below.
1694
Graphing
6.13.19.1 Summary
This tutorial will demonstrate how to add a 3D Scatter to a 3D Surface and include labels as shown below:
1695
Tutorials for Origin
6.13.19.3 Steps
1. Open Tutorial Data.opj and browse to the 3D Surface with Point Label folder in Project Explorer
(PE).
2. Activate MBook4, and highlight everything. Select Plot:3D Surface: Color Map Surface from the main
menu. A 3D Colormap graph will be generated as shown below:
1696
Graphing
3. Select Format: Axes: Z Axis... in the menu to open the Axes dialog. (Or double-click one of the axes on
the graph). Set Z axis scale From: -500 and To: 8000. Click OK.
1697
Tutorials for Origin
4. Select Format: Plot Properties in the menu to open the Plot Details dialog. (Or double click anywhere
on the graph). If the left panel is not expanded use the button on the bottom left of the dialog to
expand it and select the first option under Layer1. In order to create and customize side walls, in the
Side Walls tab, check the Enable box. Change the color of X and Y side walls to Gray and LT Gray.
1698
Graphing
5. To adjust the color scale, in the Colormap/Contour tab, click on the Fill column header to open the
dialog. Select the Limited Mixing option, and set From: Blue and To: Green as shown below. Click the
OK button to close the Fill dialog.
1699
Tutorials for Origin
1700
Graphing
6. In the Mesh tab, select color of Major Minor Lines as Black and select apply Apply.
7. The next step is to add and customize the lighting effect. In the same Plot Details dialog, expand the left
panel and select Layer 1. In the Lighting tab, choose the Directional Mode, enter 279 and -3 in the
Horizontal and Vertical boxes respectively. Set the Ambient color to LT Yellow.
1701
Tutorials for Origin
8. To adjust the planes, in the Planes tab deselect the YZ and ZX boxes to hide the two planes in the graph.
Click the OK button.
1702
Graphing
1. In order to add symbols in the desired position on the 3D graph, select Graph: Layer Contents from the
main menu to open the Layer Contents dialog (Or double click on the layer icon 1 on the top left of the
graph). In the dialog that appears, select Worksheet in Folder from the drop-down on the top left.
1703
Tutorials for Origin
2. Click on the Plot Type button shown below to specify 3D Scatter/ Trajectory/ Vector as the plot type:
3. To shift components from the left panel to the right panel, holding down the Ctrl key, select two Height
columns in the left panel and click on the Add plot button . This will add the two columns to Layer1.
Click the OK button.
Use the Rotate Tool button on the Tools toolbar or hold down the R key and use the mouse to
rotate the graph. You can find two red symbols are added to the 3D surface and the graph will appear as
shown below:
1704
Graphing
4. To add labels and leader lines to the two symbols, double click on either one to open the Plot Details
dialog. Make sure the left panel of the Plot Details dialog box is expanded and displaying Original under
the Position1 plot-level. In the Label tab check the Enable box. In the Label From drop-down list, select
col("Label") as the label source. Specify the Offset, Position and Leader Line for the label as shown in
the image below:
1705
Tutorials for Origin
5. In the left panel, click on Original under the Position2 plot-level. In the Label tab repeat the above step
making the selections given below.
1706
Graphing
Click on the OK Button. Labels and Lead Lines should now appear on the graph.
6.13.20.1 Summary
This tutorial will show you how to create 3D Scatter plots and combine them with 3D Parametric Surfaces.
1707
Tutorials for Origin
6.13.20.3 Steps
You can refer to this graph in Learning Center. (Select Help: Learning Center menu or press F11 key , and
then open Graph Sample: 3D Symbol Bar and Wall)
1. Import the file <Origin EXE Path>\Statistics\Fisher's Iris Data.dat into a new workbook.
2. Select Plot > Templates: System Template Library from the main menu. In the System Templates
dialog, expand the Graph Template -> 3D Symbols & Bars & Vectors node, then select gl3d. Click
the Plot Setup... button at the bottom left corner of the dialog.
3. In the Plot Setup dialog, set column C, D, and A as the X, Y, and Z columns, respectively. Click the
Show Plot List button (double downward-pointing arrows in the lower right corner of Plot Setup) to
1708
Graphing
expand the dialog (if it is not already expanded) and select the Add button, then click OK.
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
1709
Tutorials for Origin
4. Select Format: Plot Properties in the menu to open the Plot Details dialog. In the Symbol tab, set
Color as Index: Col(Species).
1710
Graphing
5. Go to Color List tab, check the Use custom increment list check box, and custom the color list as the
following image. Click OK.
6. Right-click on the graph legend and select Legend: Reconstruct Legend in the context menu.
7. Right-click on the graph legend and select Properties... to open the dialog. Set the font size to 22, and
custom the text as following image:
1711
Tutorials for Origin
1712
Graphing
8. To ensure that the legend is not overwritten during the next steps, select Format: Page Properties in
the menu to open the Plot Details dialog. Go to Legends/ Titles tab and choose None from the
1713
Tutorials for Origin
1. Download 3D Confidence Ellipsoid app in this file exchange page: 3D Confidence Ellipsoid
2. Drag- and-drop the app into Origin program to install it, then the 3D Confidential Ellipsoid icon will be
listed in the Apps Gallery
3. Active the graph and click this 3D Confidential Ellipsoid button in the Apps Gallery. This will open the
Plot 3D Confidence Ellipsoid dialog. Accept the default settings and click OK. Three ellipsoid are added
to the graph, each envelops the group of data with the same color.
1714
Graphing
6.13.21 Convert Data from Spherical Coordinate to XYZ and Make a 3D Plot
6.13.21.1 Summary
In this tutorial, we will look at what is involved in creating the 3D graph with spherical coordinate data, as well
as using X-Function sph2cart to convert data in a workbook or matrix from spherical coordinate to Cartesian
coordinates.
It is important to go over the Converting Algorithm for sph2cart, and notice that Origin use as the elevation
and as the azimuth in the transform formula.
1715
Tutorials for Origin
Convert data in a worksheet (virtual matrix) from spherical coordinate to Cartesian coordinates and make
a 3D surface plot.
Convert data in a matrix object from spherical coordinate to Cartesian coordinates and make a 3D surface
plot.
Convert data in three matrix objects from spherical coordinate to Cartesian coordinate and make a
discrete 3D surface plot.
Convert data in a worksheet(XYZ) from spherical coordinate to Cartesian coordinate(XYZ) and make a 3D
space curve.
6.13.21.3 Steps
Origin can create surface plot with data in virtual matrix (spherical coordinate) and add colormap for it. The
following steps introduce the plot of a ellipsoid with colormap surface.
1. Open the Tutorial Data.opj and browse to the folder: Spherical Coordinates.
2. Open the virtual matrix data spheriPlot in tutorial data, the structure of the virtual matrix is shown in
graph below:
1716
Graphing
In this example, the azimuth is from 0 to 360, and the elevation is from -90 to 90. The unit used for
angle is degree.
sph2cart -d;
Setting the sph2cart dialog follows graph below, then click OK. Three new matrix objects will be created
which are corresponded to XYZ.
1717
Tutorials for Origin
4. Then add an extra matrix object after the matrix Z in Matrix Layer to act as the colormap.
1718
Graphing
5. Copy the data in colormap matrix in Spherical Coordinates folder, paste the data to the new added
matrix object.
6. Now, you will plot the Matrix into a 3D surface, active the matrix object Z, click Plot: 3D Surface:
Colormap Surface
1719
Tutorials for Origin
Double click the surface to open the Plot Properties dialog. Set the Parametric Surface in dialog follows
graph below, and click OK to apply the settings.
1720
Graphing
7. Click CTRL+R to rescale the axis, double click the axis to open the Axis dialog, change to scale for
XYZ axis from -1.2 to 1.2, click OK to close the dialog.
1721
Tutorials for Origin
1722
Graphing
8. Next we will apply the colormap to the ellipsoid, double click the surface to open the Plot Details
dialog, go to the Fill tab, change the Contour fill from matrix into Mat(4).
1723
Tutorials for Origin
9. Go to the Colormap/Contours tab, you can click the table head to open the Set Levels, Fill and
Contour Lines dialog. Set the Level by Find Min/Max, click OK to apply, and set Fill by load palette
"Maple", click OK, then select "Hide All" to hide all lines, click Apply to apply the settings.
Go to the Mesh tab, deselect the Enable checkbox to close the mesh line, click OK to close the dialog.
1724
Graphing
1. Origin can construct a surface function under spherical coordinates. The azimuth, elevation and
radius are placed in the same matrix. Before set matrix values form a spherical coordinates equation, you
can refer to sph2cart for the transforming relations and definition of azimuth and elevation in our system.
2. Create a new a matrix, and select Matrix: Set Dimension and Labels in main menu. Set the
In this example, the azimuth is from 0 to , and the elevation is from to . The unit used for
angle is radian.
1725
Tutorials for Origin
3. Select Matrix: Set Values in main menu. The formula entered in the Set Values dialog should be
abs(sqrt(0.5)*0.25*(15/pi)^0.5*sin(pi/2-y)*sin(pi/2-y)*(sin(2*x)-cos(2*x)))
We set the matrix values by using spherical harmonics, is specific set of spherical harmonics, and
the linear combinations of is corresponded to the d-orbitals of the hydrogen atom (i.e. ).
1726
Graphing
4. Next you can convert the matrix from spherical coordinates to Cartesian by using X-Function
sph2cart. Select Window: Script Window in main menu, then enter the script below and click Enter
to execute:
sph2cart -d
Set the sp2cart dialog follows graph below, the single matrix object is used as input data:
1727
Tutorials for Origin
After clicking OK, the results well be created in a new Matrix Sheet (MSheet2).
5. Now, you will plot the Matrix into a 3D surface. With Matrix object Z in MSheet2 active,
6. Double click the surface to open the Plot Details dialog, set the parametric surface follows graph
below, and click OK.
1728
Graphing
7. Click CTRL+R to rescale the axis, double click the axis to open the Axis dialog, change to scale for
XYZ axis from -0.5 to 0.5, set the vvalue for Major Ticks to 0.2, click OK to close the dialog.
1729
Tutorials for Origin
1730
Graphing
9. Double click the surface to open the Plot Properties. Go to the Colormap/Contours tab, click the
Level/Fill/Line button and set the dialogs separately.
1731
Tutorials for Origin
Then go to the Mesh tab, deselect the Auto checkbox for Transparency and change the value to about
70%.
1732
Graphing
You can refer to Parametric Surface tutorial for details about colormap setting. The finished Graph are
shown below:
6.13.21.3.3 Convert data in three matrix objects and make a 3D surface plot
Origin can construct a surface function under spherical coordinates. The azimuth, elevation and
radius are placed in the different matrix. The following steps shows how to construct multiple surfaces by using
three matrix and use sph2cart to convert them into XYZ space.
1. Create a new matrix. Set the Matrix Dimension in Matrix Dimension and Labels dialog, then
click OK.
2. Click the D button on the right corner of the matrix and click Add to add another two matrix objects
in MatrixBook.
1733
Tutorials for Origin
3. The azimuth will be put into the first matrix object. With the first matrix object active (Click the D
button and switch between 1/2/3), click Matrix: Set Values in main menu. The matrix values for
azimuth will be set in this way:
(j==33||j==66)?1/0:(pi/32*j*(j<33)+pi/32*(j-33)*(j>33&&j<66)+pi/32*(j-
66)*(j>66))
The value from 0 to loop 3 times, and the Column (33),Column (66) should be missing values.
1734
Graphing
5. The elevation will be put into the second matrix object (select matrix 2 in graph in step 2). Set the
values for elevation by using expression:
pi/32*(i-17)
6. The radius (expression below) will be put into the third matrix object.
The way for setting the values for radius is also piecewise, you can refer to the step 3, 4, 5 and use the
set value code below:
1*(j<33)+0.7*(j>33&&j<66)+0.4*(j>66)
7. After setting values for three matrix, you can convert the data to XYZ space by using sph2cart. Open
the Script Window,type in code below and run:
sph2cart -d;
Setting the sph2cart dialog follows graph below, then click OK. Three new matrix for XYZ will be
created.
1735
Tutorials for Origin
8. Create 3D surface graph by using XYZ matrix object created in new matrix layer. The steps are very
similar to steps 5,6,7,8 in above section Convert data in a matrix object and make a 3D surface
plot.
1736
Graphing
Origin can create 3D space curve with unevenly spaced data in XYZ column (spherical coordinates). The
following steps introduce the plot of a non-isometric spiral with a sphere shape.
1. Create a new workbook with three columns X, Y and Z. Set values from to for X column by
Fill Column With: A set of Numbers
1737
Tutorials for Origin
Set value for Z column by Set Column Values and set as constant value "4"
sph2cart -d;
Setting the sph2cart dialog follows graph below, then click OK. Three new columns for XYZ will be
created.
1738
Graphing
3. Plot the new XYZ with Plot: 3D Symbol/Bar/Vector: 3D Scatter. Set Symbol size to 0 and connect
Symbols with line,click OK.
1739
Tutorials for Origin
4. Further adjust the scales and the perspective view, the finished graph is similar to graph below:
1740
Graphing
5. a 3D surface can be created with new created XYZ data as well by selecting Plot: 3D Surface: Color Map
Surface with XYZ columns highlighted.
6.13.22.1 Summary
1741
Tutorials for Origin
This tutorial will show you how to plot a stacked flattened colormap surface with Z offset.
6.13.22.3 Steps
1. Create a new a matrix and select File: Import : Image to Matrix to import myocyte1~myocyte8
under the \Sample\Image Processing and Analysis folder. In the ImpImage dialog, keep Mulit-File
(except 1st) Import Mode as Start New Objects.
1742
Graphing
1743
Tutorials for Origin
3. Select Plot: 3D Surface: Multiple Colormap Surfaces from the main menu to plot a surface graph.
4. Select Format: Plot properties from the main menu to open the Plot Details dialog.
5. Select the first plot, check Flat and Shift in Z by percent of scale range, and set the shift value as
0. And go to the Mesh tab, uncheck the Enable check box to not show the grid lines.
1744
Graphing
6. Select the 2nd-8th plot in order, check Flat and Shift in Z by percent of scale range, and set the
shift value as 14, 29, 42, 57, 71, 85 and 100. And go to the Mesh tab, uncheck the Enable check
box to not show the grid lines. Click the OK button to close the dialog.
1745
Tutorials for Origin
1746
Graphing
6.13.23.1 Summary
In this tutorial, a 3D ternary surface with Z colormap and its projection with contour lines are generated from
XYZZ worksheet data.
6.13.23.3 Steps
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
1. Open the Tutorial Data project and browse to folder 3D Ternary Surface.
2. Activate the worksheet Ternary Surface in Book1F ,and highlight col(C) and col(D). Select Plot: 3D
Surface:3D Ternary Colormap Surface to generate a colormap surface.
1747
Tutorials for Origin
3. We will modify the plot to show the edges of the 3D prism. Double-click on the plot to open the Plot
Details dialog box. Highlight Layer1 in the left panel (take care not to clear the check mark beside
the Layer1 icon). Go to the Plane tab, set Prism to Whole Prism and enable Plane Border.
4. Expand the Layer1 node, highlight the dataplot icon and click the Fill tab. Check Enable box and
select Colormap. Check the box beside Fill back surface and set color as LT Gray.
5. Click the Colormap / Contours tab. Click the Level heading and in the Set Level dialog box, set
controls as follows, then click OK to close the dialog box.
1748
Graphing
6. To add contour lines on the ternary surface, check the box next to Enable Contours.
7. To customize the contour lines, click the Line heading to open the Contour Lines dialog. Under Line
Properties, check the box before Color and Style and set the Color as Dark Gray and Style as Short
Dash, then click OK.
1749
Tutorials for Origin
8. Go to the Mesh tab, clear the Enable box, then click the OK button.
9. To customize the scale and the major ticks of the X/Y/Z axes, click on a graph axis to open the Axis
Dialog box. Expand the X, Y and Z nodes, then press CTRL while selecting Scale for the X ,Y and Z
axes. Set Major Ticks > Value to 0.2.
1750
Graphing
10. Expand the Zh axis node and select Scale. Duplicate the scale range and the Major Ticks > Value
settings as shown below.
1751
Tutorials for Origin
1. With the graph page active, select Graph: Layer Contents from the main menu to open the Layer
Contents dialog. Select Worksheets in Folder from the drop-down.
2. To add another ternary surface to the graph, press CTRL and in the left panel, select the datasets XC
and CRC299 of sheet "Ternary Surface", then click the Add plot button to add them to the right
panel. Click OK.
3. Double-click on the plot to bring up the Plot Details dialog box. Under Layer1, click on the second
plot, then click on the Surface tab. Under Display, choose Flat and Shift in Z by percent of scale
range, 0 = bottom, 100 = top.
4. On the Colormap / Contours tab, select Enable Contours. Click the Line heading and edit the
Contours Lines dialog box settings as in the following image and then click OK.
1752
Graphing
5. On the Colormap / Contours tab, click the Level heading and in the Set Level dialog box, set # Major
Levels to 20 and # of Minor Levels to 5. Click OK to close the dialog box.
7. On the Mesh tab, clear the Enable box. Click OK to close the dialog box.
8. To change the grid lines on the axis planes dashed lines, double click the axis to bring up the Axis
Dialog box. In the left panel, expand the X node and select Grids. Press Select Others to choose
grids for all the axis planes. Customize the Major Grid Lines section as follows:
1753
Tutorials for Origin
9. Rotate the plot by dragging a hotspot (hint: click once inside the graph frame - but not on the plot -- to
activate the move/resize/rotate functions). Alternately, you can use the tools on the 3D Rotation toolbar.
1754
Graphing
6.14.1 Summary
Origin can plot functions. It also can plot functions with parameters defined in a worksheet. The function graph
can be updated automatically as the parameters in the worksheet change.
1755
Tutorials for Origin
6.14.3 Steps
1. Set up a worksheet with three parameters p0, p1, p2 stored in Column A, Column B, Column C as
shown below.
1756
Graphing
2. Click on the Add New Columns button on the Standard toolbar to add a new column to the
worksheet.
3. Highlight Column D and then select Column: Set Column Values. Select Auto from the
Recalculate drop-down. Type the script shown below to define the parameters in the Before
Formula Scripts edit box. Click the OK button to close the dialog box.
1757
Tutorials for Origin
Note that there is a green lock icon on the top right corner of Column D which indicates that the
Recalculate Mode is Auto.
4. Click on the New Function button on the Standard toolbar(If there is not New Function button,
select View: Toolbar to open the Customize dialog, and then go to Button Groups tab, select
Standard group, and then drog the New Function button to Standard toolbar. ). The Plot Details
dialog opens.
5. In the Plot Details dialog, set the options as follows and click the OK button to close the dialog box.
1758
Graphing
Click on the Rescale button on the Graph toolbar to adjust the graph's scales.
1759
Tutorials for Origin
6. The function graph can be updated automatically when the parameters in the first row of the
worksheet change. Change the value in the first row of Column 2 from 2 to 3. Click outside this cell to
finish editing.
1760
Graphing
6.14.4 Scripts
The script used in the Before Formula Scripts edit box of the Set Values dialog box is:
The function in the F1(x) edit box of the Plot Details dialog box is as follows:
p0+p1*x+p2*x^2
6.15.1 Summary
1761
Tutorials for Origin
Windrose graphs are used to present wind speed data and wind direction data collected over time at a
particular location. This tutorial will demonstrate how to create windrose graphs from both raw and indexed
data:
6.15.3 Steps
1. Open Tutorial Data.opj and browse to the Wind Rose folder in Project Explorer (PE).
(If you don't have the project file, please import the sample data from here).
2. Activate the Book6E workbook. Highlight all worksheet columns and click the Wind Rose - Binned Data
button on the 2D Graphs toolbar as shown below or select Plot: Specialized: Wind Rose-Binned Data
from the main menu.
1762
Graphing
The wind rose graph should look like the following image:
3. To change the wind direction to show only N,E,S,W double-click on the angular axis (the outermost ring)
to open the Axis dialog box. Go to Scale tab and choose Angular axis in the left panel. Under Major
Ticks section, set Type to By Increment and Value to 90
1763
Tutorials for Origin
4. Go to Tick Labels tab, make sure the Angular - Outer axis is selected in the left panel, and duplicate
the following settings:
1764
Graphing
1765
Tutorials for Origin
6. Click on the Text Tool button to add a Text object as graph title. And enter Sample of Wind Rose
(Binned Data) in that Text object.
1. Go to the project folder Statistical and Specialized Graphs: Specialized: Wind Rose and activate the
Book7E workbook, Raw Data worksheet. (If you don't have the project file, please import the sample
data from here).
2. Highlight columns A & B. Click the Wind Rose - Raw Data button on the 2D Graphs toolbar as shown
below or select Plot: Specialized: WindRose - Raw Data from the main menu.
1766
Graphing
1767
Tutorials for Origin
To import Binned Data to a worksheet, copy the Binned Data 1 (including the heading) and select File:
Import Wizard. Select the Clipboard checkbox in the DataSource group and click the Finish button to
import the data into Origin.
1768
Graphing
45 0 3.125 3.125 0 0
67.5 0 6.25 0 0 0
90 0 0 0 0 3.125
112.5 0 0 0 0 0
202.5 0 0 0 0 0
225 0 0 3.125 0 0
270 0 0 0 0 3.125
337.5 0 0 0 0 0
360 0 6.25 0 0 0
382.5 0 0 0 0 0
1769
Tutorials for Origin
To import Raw Data to worksheet, you can copy the Raw Data (including the heading) and then select File:
Import Wizard. Select the Clipboard checkbox in DataSource group and then click Finish button to import
the data into Origin.
Direction Speed
311.5 12.75
142.7 11.18
161.6 5.9
277.3 8.24
155.3 13.46
40.8 8.57
43.4 4.38
1.3 10.91
78.8 18.72
237.8 16.22
114.6 0.88
2.1 12.05
1770
Graphing
290.5 4.6
174.1 3.29
267.6 16.64
8 5.6
213.9 8.04
134.8 17.26
137.6 11.87
46.1 5.48
4.5 13.47
311.2 10.17
154.4 11.17
176.2 18.91
348.1 4.11
225.2 6.65
236.4 12.87
11.7 1.07
278.9 4.36
356.5 5.01
1771
Tutorials for Origin
58.9 7.3
161.8 15.6
6.16.1 Summary
A vector plot is a multidimensional graph used in industries such as meteorology, aviation, research, and
construction that illustrate flow patterns (e.g. of wind, water, magnetic fields, etc.). Both direction and
magnitude are represented in a vector graph. Origin includes two types of vector plots:
1. Vector XYAM - takes a starting XY location for the vector tail (by default), an angle and a magnitude.
2. Vector XYXY - takes two XY positions and connects them with a vector.
6.16.3 Steps
1772
Graphing
To create a vector plot, you need four data columns, and to organize your data into two modes:
XYAM stands for X, Y, Angle and Magnitude. Vectors will start from point (X, Y), and rotate a specified angle.
The following example uses XYAM data mode to create a vector graph.
1. Open Tutorial Data.opj and browse to the 2D Vector folder in Project Explorer (PE).
2. Activate the data worksheet Book8E. Without highlighting any columns, select Plot: Specialized: Vector
XYAM from the main menu to open the Plot Setup dialog. Assign columns A, B, D, C to X, Y, A, M as
shown below, then click OK to plot the graph.
In order to show all three panels in Plot Setup dialog, please expand Plot
again.
1773
Tutorials for Origin
3. Select Format:Plot Properties... to pull up the plot level of the Plot Details dialog. In the Vector tab
change the Magnitude Multiplier drop-down list to 75. Click the OK button to close Plot Details dialog.
4. Double-click the X or Y axis to open the Axis dialog. Go to the Line and Ticks tab, in the left panel, hold
Ctrl key to select both Bottom and Left icons, check the Use Same Options for Bottom and Top check
box. This will apply the settings in bottom X to top X, and those in left Y to right Y.
5. Go to the Tick Labels tab, hold Ctrl key to select both the Top and Right icons in the left panel, check
Show check box. Click OK to apply the setting and close the Axis dialog.
6. Right click on the legend box to bring up the context menu. Select Properties... to open the Object
Properties dialog. Type \l(1) Field Strength in the text box and click OK.
7. Add a layer title: Spot Write Effectiveness.
Another data organizing mode is XYXY; where the first X, Y is the vector starting point, while the last X, Y is
the ending point.
To create such a vector graph, activate workbook Book9E under the 2D Vector folder, highlight all of the four
data columns in it, and select Plot: Specialized: Vector XYXY from the main menu. Delete the axis titles if
necessary.
6.17.1 Summary
Piper diagram (or Trilinear diagram) is used as an effective graphical representation of chemistry in water
samples in hydro-geological studies. The percentage values of six ion groups are considered in the plot, they
are calcium, magnesium and sodium plus potassium cations, and sulfate, chloride and carbonate plus
hydrogen carbonate anions.
The cations and anions are shown by two separate ternary plots and both are then projected onto a rhomb. In
Origin they are plotted as a three layer graph.
1774
Graphing
6.17.3 Steps
1. Start a new workbook and click the button to import the file Piper.dat under <Origin EXE
Folder>\Samples\Graphing path.
2. In the imported worksheet, column A is the Sample ID. Column B through G are the percentage
values for the six ion groups in the order of Ca, Mg, Na+K, Cl, SO4, and CO3+HCO3. column H is
1775
Tutorials for Origin
the amount of total dissolved solids in water. The percentage for cation groups is relative to the total
amount of cations and that of anion groups is calculated by the same manner.
Note: We have some built-in workbook templates to help you convert data from different units
(MEq/mgL/PPM) to percentage (open from File:New:From Template:). For details, please refer to this
help file.
3. Highlight column B through G and select Plot:Specialized:Piper from the top menu to open the
plotpiper dialog.
4. Select column A for Sample ID and column H for Total Dissolved Solids.
Note: You can select an existing piper diagram as the Output Graph and add the selected new data
into this piper diagram.
1776
Graphing
Sample ID and TDS are optional when plotting piper diagram. If Sample ID is specified, symbol color
and shape will be controlled by it. If TDS is specified, open circle in the rhomb (Layer 1) will show and
the size will be controlled by it. Also Piper diagram shows each sample in legend.
The following steps can further customize the graph to be exactly the same as the image in Summary.
1. To change the gap between the ternary plots and the rhomb, double click the bottom left ternary to
open the Plot Details dialog. On the left panel, select Layer 2. On Size/Speed tab, change the Left
value to be 130, so that the distance between the top vertex of rhomb and the top vertex of the
ternary in Layer 2 will be 130% of the side length of rhomb. Click Apply button.
1777
Tutorials for Origin
2. To change the symbol color or shape increment list, select the data plot under Layer 1 node on the
left panel. Then go to the Color List or Shape List tab to customize them.
3. To add Sample ID as data label in the rhomb, Select 1st data plot under Layer 1 node on the left
panel. Go to Label tab and set as follows:
1778
Graphing
To add data labels to two ternaries in the graph, please select plot under Layer2 and Layer3 nodes in
the Plot Details dialog and do the same.
4. The 2nd data plot under Layer1 node in the Plot Details dialog is the open circle for TDS. Select the data
plot on left panel and select the Symbol tab. You can see the Size of the open circle is controlled by
Col(H). The Scaling Factor is auto determined to get a proper display. Change the Scaling Factor to 0.03
to see the change.
5. By default Sample ID shows in legend. To show sampling location's information in legend, right click
on the legend and select Legend:Point by Point... to open the Update Legend Point by Point
dialog. Select Custom for the Label Form drop-down list and then select wcol(1): wcol(9) from
the menu. wcol(9) refers to the 9th's column in worksheet, which is the Sampling Location column.
6.18 Waterfall
6.18.1 Waterfall
2D Waterfall
3D Waterfall
6.18.2 2D Waterfall
6.18.2.1 Summary
Origin's Waterfall plot uses a dataset stored in a parameter row to set the Z offset and create a color map
with Y or Z values.
1779
Tutorials for Origin
6.18.2.3 Steps
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
1. Open the Tutorial Data project and browse to folder Waterfall in Project Explorer. Select the Book4G
window to activate it. Click in the upper left corner of the worksheet to select all data.
2. Right-click and select Plot from the menu, point to Y-offset/Waterfall, and select Waterfall
Y:Color Mapping to create a Waterfall with Y color mapping. (Alternatively, select the Waterfall
Y:Color Mapping button from the 2D Graphs toolbar.) A graph resembling the image below will
appear:
Note that the values stored in the user-defined parameter row Frequency (Hz) have been automatically
picked up as the Z Value Source. Confirm this by double-clicking the plot to open the Plot Details
dialog box and selecting Layer1 in the left panel. Select the Waterfall tab and observe that the Z Value
Source is set to Frequency (Hz).
1780
Graphing
3. With the Plot Details dialog box still open, in the left panel, select the first line plot under Layer1.
Select the Colormap tab in the right panel. Click on the Level… column header to open the Set
Levels dialog box. Set levels as shown below:
4. Click on the Fill… column header to open the Fill dialog box. Select Load Palette, and choose the
Rainbow palette from the palette list. Click OK button to close the Fill dialog box.
1781
Tutorials for Origin
Click OK to apply these settings and close the Plot Details dialog box.
5. Double-click the plot's Z axis to open the Axis dialog box. Go to the Scale tab and set the major tick
Value to 50.
1782
Graphing
6. Go to the Grid tab. Press the Ctrl key to select the X and Y axes in the left panel, and the clear the
Minor Grids check box.
1783
Tutorials for Origin
Click OK to apply changes and close the dialog box. The final graph should look like this:
1784
Graphing
1. In the Project Explorer (usually at the left of the screen), browse to \2D and Coutour
Graphs\Waterfall. Select the Book4G window to activate. Click in the upper left corner of the
worksheet to select all data.
2. On the main menu, click Plot, then point to Y-offset/Waterfall, and then select Waterfall Z:Color
Mapping to create a Waterfall with Z color mapping. (Alternatively, select the Waterfall Z:Color
Mapping button from the 2D Graphs toolbar.)
1785
Tutorials for Origin
3. Double-click the plot to open the Plot Details dialog box. In the left panel, select the first line plot
under Layer1. Select the Colormap tab in the right panel. Click the Level… column header to open
the Set Levels dialog box. Set Major Levels to 10.
1786
Graphing
4. Click the Fill… column header to open the Fill dialog box. Select Limited Mixing and set the From
color to red and the To color to blue. Click OK to apply these settings and close the dialog box. Click
OK to close the Plot Details dialog box.
5. Double-click the Y axis to open the Axis dialog box. Set the vertical Increment to 50. Select the
Grid Lines tab. Select Horizontal from the Selection box, and clear the Minor Grids check box.
Select Vertical from the Selection box and clear the Minor Grids check box. Click OK to close the
Axis dialog box.
1787
Tutorials for Origin
6.18.3 3D Waterfall
6.18.3.1 Summary
Origin features an OpenGL-supported 3D waterfall graph. The 3D waterfall is a specific type of 3D wall graph
with a wall width = 0. You can rotate, resize, stretch and skew the graph as with other Origin 3D graphs.
1788
Graphing
6.18.3.3 Steps
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
2. Activate workbook Book4I by locating it in Project Explorer and double-clicking to show the window.
Highlight all columns. Select Plot: 3D XYY: 3D Waterfall from the main menu to plot a 3D waterfall
graph.
1789
Tutorials for Origin
3. Select Format:Layer Properties from the menu to open the Plot Details dialog box. Go to the
Planes tab, check the box to add an XY plane to the graph , uncheck the Enable check box in the
Plane Border group, then set the remaining controls as shown in the following image:
1790
Graphing
4. Click the arrow icon to the left of Layer1 to show all plots in the layer. Select the first plot in the
layer (take care not to clear the check box next to the dataset icon), then click the Pattern tab and
set the Fill Color as LT Gray.
5. Click OK to close the dialog box. Double-click on a graph axis to open the Axis dialog box. Clear the
Use Only One Axis For Each Direction check box. Go to the Scale tab and select Z axis icon in the
left panel and set From and To to 0.8 and 3.2, and set the increment value of Major Ticks to 0.2.
1791
Tutorials for Origin
o Go to the Tick Labels tab, make sure Top - Z icon is selected and clear the Show check box to
hide the tick labels on top Z axis.
1792
Graphing
6. Go to the Line and Ticks tab, make sure Top - Z icon is selected and set Major Ticks and Minor
Ticks to None.
7. Click OK to close the dialog. Click on the cube to activate the five red graphical editing icons. Click on
the fourth button - the Skew button - and drag the X/Y hotspots to skew the graph in X/Y direction
so that it looks approximately like this:
1793
Tutorials for Origin
6.19.1 Summary
This tutorial will show you how to create a stock chart to display open, high, low, and close prices, along with
trading volume.
1794
Graphing
Create a stock chart with open, high, low, and close prices, and trading volume
Categorize the volume columns according to their weekday by filling differnt colors
Create the Legend to annotate the columns with different fill color
6.19.3 Steps
You can refer to this graph in Origin Central. (Select Help: Origin Central menu or press F11 key , and then
open Graph Sample: Financial Plots)
1. Highlight Col(C)~Col(G) in the worksheet, and then choose Plot: Stock: OHLC-Volume to create a
graph.
1795
Tutorials for Origin
2. Double click on the bottom X axis of Layer2 to open the X Axis dialog. Switch to the Scale tab. You can
see the Type is set to Discrete by default. This is why the X axis skips all weekends and holidays
automatically.
3.
4. Change the axis rang From 3/3/2001 To 5/7/2001. Under the Major Ticks branch, make sure Type is set
to By Increment. Type 1week for Value. Under the Minor Ticks branch, make sure Type is set to By
Counts. Type 5 for Count. Click Apply button. You can see weekend and holidays are skipped
1796
Graphing
clearer.</br>
5. To show bottom axis label as multiple lines, switch to the Tick Label tab. Activate the Dsiplay sub-tab.
Select Custom Display for Display drop-down list. Enter the text below in Custom Display text box.
1797
Tutorials for Origin
Go to Format sub-tab, set Font Size to 10 and check Wrap Text check box.
1798
Graphing
6. Go back to Scale tab, select Vertical icon at the left panel, then set From and To to 0 and 120M. Click
Apply button.
7. Select 1 under the Layer drop-down list which locates at the left-bottom corner of the dialog to switch to
Layer 1. Then with Vertical icon still chose, set From and To to 12 and 22. Click OK button to close the
1799
Tutorials for Origin
dialog.
8. Double-click on the column plot at Layer 2 to open the Plot Details dialog. In the Pattern tab, expand the
Fill Color drop-down list, go to By Points sub-tab, under the Index list, select Col(B) : "Week Day",
1800
Graphing
then select D01 Pumpkin Patch under Color List. Click OK button to close this dialog.
9. With Layer 2 activated, select Graph: Legend : Categorical Values menu. In the dialog opened, keep
the default settings, click OK button. A legend will be added onto graph. Select the legend to show up the
legend border, press the Ctrl key to drag the legend border to make the legend items arranged in one
line.
10. Resize and re-position the legend box. The Final graph should appear as shown below:
1801
Tutorials for Origin
11.
1802
7 Data Management
7.2.1 Summary
Origin workbooks are similar to spreadsheets and can have multiple worksheets. Multi-sheet workbooks allow
for better organization and higher information density.
Handle metadata.
7.2.3 Steps
1803
Tutorials for Origin
7. Select Window: Tile Vertically to arrange the workbooks side by side as shown below:
8. Drag 2nd Test to the second workbook. This will move the 2nd Test sheet from the original workbook to
the new workbook as shown below:
9. Click the Save button . The Save As dialog will open since the project is yet to be saved. Save this in
the User Files Folder as Multi-Sheet Workbooks.opj
Note: It is also possible to drag and drop sheets within the workbook to change the order. Right-click on
any sheet name and note these additional options: Duplicate Without Data, Duplicate, Delete and
1804
Data Management
Navigate.
3. On the View tab, click the Edit Column Label Rows button. The Column Label Rows dialog opens.
4. Right-click on the table and select Add User-Defined Parameter. Scroll down to note that a
UserDefined label has been added. The Show box is checked by default.
1805
Tutorials for Origin
5. Double-click on the UserDefined text (or single-click and press F2), and change the UserDefined text to
Wavelength (nm).
6. Click in the box to the left of Wavelength (nm) and drag it to the top of the list, dropping it above Long
Name. This will change the order of the rows as shown below:
1806
Data Management
10. Highlight the Comments row and click the Merge Cells button on the Style Toolbar to create a row
with one cell.
11. Enter the values shown below in the Columns A and B header region (Wavelength to Comments).
(Note: Once the Rich Text box is checked for specified cells, double-clicking in the cells to edit them will
activate the format buttons . These can be used to apply rich text formatting as
shown below):
1807
Tutorials for Origin
5. Expand the Imported Files branch and view the stored metadata.
1. Point the cursor to the bottom right of the sheet at the end of the vertical scroll bar (for a horizontal
Divider) or at the right end of the horizontal scroll bar (for a vertical Divider) as shown below:
2. When the pointer changes to a split pointer, drag it to the desired position. A horizontal or vertical
Divider will be created.
1808
Data Management
7.3.1 Summary
Both worksheet header rows and data cells can contain embedded objects, linked objects as well as formatted
text. In addition, floating graphs can be added to the worksheet like Excel.
Note: Beginning with Origin 2018, any inserted graph, whether it be a an editable graph, a graph inserted as
a linked or static picture, an image inserted from file, or a sparkline, will generate a pop-up preview
when you hover on the containing worksheet cell.
1809
Tutorials for Origin
7.3.3 Steps
4. Return to the workbook and select the Column: Add New Columns... from the menu or click on the Add
7. Select cell E1, and then click the Bold button on the Format Toolbar.
8. Click the Font Color button on the Format Toolbar and pick Yellow as the color.
9. Click the Fill Color button on the Style Toolbar and pick Blue as the color.
10. Select the range E1 to F1, click the Merge cells button .
11. Right-click on cell G1 and choose Insert Arrow: Left from the context menu to insert a arrow to the cell.
12. Select the range E2 to G12, click the Merge cells button .
13. Right-click on the cell and choose Insert Graph.
1810
Data Management
14. In the InsertGraph dialog, type Graph1 in the large Graphs box or click on the Browse button to
select Graph1.
17. Click the Browse button and change the Files of Type to Bitmap (*.bmp).
18. In the Origin User File Folder, select the Userdef.BMP, click Add File(s) button and then click OK
button.
19. Click OK button to close the InserImg dialog.
20. Right-click on cell F13 to choose Insert Notes.
21. Double-click on cell F13. Modify the text and then close the Notes window. A note wil be saved in the
cell.
22. Right-click in E14 and choose Insert Sparklines to open the InsertSparklines dialog.
23. In the dialog, click the Data Columns fly-out button to choose C(Y). Uncheck Long Name in 1st
Column check box.
1811
Tutorials for Origin
24. Click OK to close the dialog. A sparkline will appear in the cell.
25. Click on cell E15 and type: http://www.originlab.com and press Enter.
26. Click on the text in E15 which opens your web browser to the OriginLab web site.
27. Click on cell E16 to choose Insert Variables from the context menu. The Insert Variable dialog opens.
28. with the worksheet Book1 is selected in the right panel, go to the Info tab, expand the
USER.VARIABLES branch, select SAMPLE and then click on the Insert button. A variable will be
inserted to the cell.
1812
Data Management
29. Double-click on the cell E16, the text will change to a variable string.
1813
Tutorials for Origin
The Graph, Notes and Sparklines in the above lesson are all examples of embedded objects (the Insert Graph
could be either Embedded or Linked.) Embedded objects present a visual of a hidden external object that can
be opened by double-clicking. Changes to the object can be made and then the object window can be closed
and the source worksheet cell is updated.
1. Continue the above project. Highlight Col(D) in Book1 to plot a line graph.
2. In Book1, right-click the empty area or title of the book to select Add Graph:Graph1 from the context
menu. The graph is added to the sheet. Note: Origin pre-loads the last-created graph to the Add Graph
shortcut command. If you only see the shortcut Add Graph (no named graph following the shortcut
command), clicking Add Graph will open the Graph Browser. In the Graph Browser, select your graph
and click OK to insert the graph and return to the worksheet.
3. Left-click and hold down the mouse button on the graph and drag it to reposition it on the worksheet.
1814
Data Management
1815
8 Data Exploration
8.2.1 Summary
The Data Reader is an exploratory tool that uses the Data Info window to display information about a
selected data point in a graph. Essentially anything that is contained in the worksheet, in association with a
plotted data point, can be shown in the Data Info window. This includes coordinate values, column headers,
or even cell-embedded images. In addition, you can customize the window to display numeric values using a
custom format (e.g. date-time, Lat/Lon, etc.), or to change window background color, add a window title, etc.
Beginning with Origin 2019, you can read data point coordinates in a 2D graph by
hovering on the data point. This Data Point Tooltip is highly customizable, mimicking
Data Info window functionality. For more information, see Data Point Tooltips.
1817
Tutorials for Origin
Use the Data Info window to view information for a selected data point in the graph.
Customize Data Info window content, to include the display of images (Tutorial 1).
Customize Data Info window content, to display numeric data using custom formatting (Tutorial 2).
1. Select File: Open... to open the Alkanes.opj in the <Origin Folder>\Samples\Data Exploration folder.
2. Highlight Column D in Book1 Sheet1, and select Plot > 2D: Scatter: Scatter to create a new graph.
3. Click the Data Reader button from the Tools toolbar, and click on the Isobutane data point on the
new graph.
The Data Info window showing the X and Y coordinates of the data point selected will appear.
4. Right-click on the Data Info window, and select Preferences from the context menu to open the Data
Info Report Settings dialog.
1818
Data Exploration
5. To remove the book and sheet name from the Data Info window, set the Report Title drop-down to
None.
6. In the center portion of the dialog, remove the X coordinate by clicking on <X>, then clicking the Remove
button. Do the same for the Y coordinate (<Y>).
7. In the upper-left corner of the dialog, click the X Data button, then the Y Data button
to add the X and Y data source. Note the use of dataset Long Names in the Preview.
8. All source worksheet columns that can be added to the Data Info window are listed in the left panel.
Highlight the B, C, E, G, and H columns and add them to the center panel by clicking the Select button.
Note that at this point, the Preview shows that our window has two columns.
9. Click the Add Column button to add a third column to our table. Click the pencil icon above the third
column and in the Column Settings dialog, set Type = Single Cell and Source = J "Ball and stick
model". Set Column Width = 20 and click OK. Click the pencil icon above the first and second columns
1819
Tutorials for Origin
10. Click the Font button to open the Tooltip Font dialog. Set Minimum Font Size and Maximum Font Size
to 10 and 16 respectively. This will for text to automatically resize as the Data Info window is resized.
Note that this limits the resizing of the Data Info table, as well. Set the Font Color to Royal and click
OK. Click the Background button, set Background = White and click OK.
11. Click on the Theme button and select Save to <Graph> in the fly-out menu. This ensures that your
Data Info dialog settings will be saved to the active graph, then click OK to close the Data Info Report
Settings dialog.
1820
Data Exploration
12. Resize the Data Info window by dragging a window corner. Note that the font size range that we
specified previously, set limits on window resizing.
In this tutorial, we'll learn how to apply a custom display format to numeric data shown in the Data Info
window.
1. Press F11 to open the Learning Center, click the Graph Samples tab and search on the phrase "Google
Map Temperature". Double click on the sample to open this project file containing the following map of the
continental US with a contour plot overlay of mean January temperatures.
2.
1821
Tutorials for Origin
3. Double-click on the map + contour plot to open the Plot Details dialog box. Click on the
Colormap/Contours tab and enable Show Data Points and click OK. What you are now seeing are the
US cities where the January temperature data in the map overlay, were recorded. Enlarge the size of the
window so that you can get a comfortable view of all scatter points.
4. Pick the Data Reader tool from the Tools toolbar (hint: it is on a split button with the Data
Cursor and the Data Highlighter ), then click on one of the scatter points on the map. The
Data Info window should open and look something like the following image.
The information, as reported, is not very user-friendly so we will customize the Data Info window to
report more useful information.
5. Double-click on the Data Info window to open the Data Info Report Settings dialog box. Under the
Name column in the center panel, click on and remove -- one by one -- the <X>, <Y> and <Z>
6. Now click the , and buttons in the upper-left corner of the dialog to move
the X, Y and Z source data, labeled with the column Long Name, to the center panel. You can see
the result by looking at the Preview to the right side of the dialog box.
Currently, our Data Info displays two columns, one with column Long Names (Longitude, Latitude,
January) and a second column with the numeric data associated with Longitude, Latitude, January. What
1822
Data Exploration
we will do is to apply formatting to these numbers so that they do not simply display as generic decimal
numbers.
7. Click the Add Column button to add a third column to the Data Info table, then click the pencil icon in the
newly-added column to open the Column Settings dialog box. Set the Type drop-down list to Numeric
Display Format and click OK.
8.
9. Click into the first cell below the Numeric Display Format heading and you will see a list control that you
can click to show a list of custom formatting options. Firstly, note that this list is not exhaustive but
contains suggestions for custom formats. Secondly, you can type directly into this box to specify a custom
format.
1823
Tutorials for Origin
10.
11. In the first row list control, type the following (degrees-minutes east-west, with units before):
DM EWB
12. In the second row list control, type the following (degrees-minutes north-south, with units before):
DM NSB
13. In the third row list control, type the following (one decimal place + suffix string "deg F"):
1824
Data Exploration
.1 "deg F"
14. Click the Add Column button to add a column to the Data Info table, then click the pencil icon in the
newly-added column to open the Column Settings dialog box. Set the Type drop-down list to Single
Cell, Source to A "City", Column Width to 30 and click OK.
15. Click the Save Theme button and choose Save to <Graph> to save the current Data Info window
configuration to the graph window. Click OK to close the dialog box.
16.
8.3 Use Data Cursor to Show the Difference between the Data
8.3.1 Summary
In Origin, the Cursor tool is used to measure the X and Y distance between two points. You can place cursor
objects on the same curve or on different curves, then use the Data Info window to display the relative
positions of the cursor objects.
8.3.3 Steps
2. Select File: Import: Multiple ASCII from the main menu. Go to the folder
\Samples\Spectroscopy\Chromatography, select GPC Single Channel Chromatogram 1.dat and GPC
Single Channel Chromatogram 3.dat. Click Add Files, make sure that Show Options Dialog is
1825
Tutorials for Origin
selected, and click OK. This opens the ImpASC dialog box. In this dialog, set the Multi-File Import
Mode to Start New Columns, check the Append Filename to Column Comment check box and
uncheck the Include File Path when Appending Filename check box in the Re(Naming)
Worksheet and Workbook branch. Click OK to import these two files into a worksheet.
3. Highlight all columns and right-click to select Set As: XY XY from the context menu. With all columns
highlighted, choose Plot:Line:Line.
1826
Data Exploration
4. Press and hold the Data Reader button and select the Data Cursor from the list.
6. Right-click on the Data Info window and select Preferences... from the shortcut menu. This opens the
Data Info Report Settings dialog box.
1827
Tutorials for Origin
7. In the center panel, under Name, click on and remove it from the table. Repeat this for .
8. Click to add the source X data to the table. Repeat this for .
9. Click the Add Column button three times to add a total of three columns to the Preview table.
10. Click the pencil icon above the first added column and change Source to Data (Cursor 1) and set
Column Width = 30. Click OK.
11. Click the pencil icon above the second added column and change Source to Data (Cursor 2) and set
Column Width = 30. Click OK.
12. Click the pencil icon above the third added column and change Source to Relative (Cursor 2 -
Cursor 1) and set Column Width = 40. Click OK.
13. Click OK to close this dialog. The Data Info window will display three new columns.
11. Double-click on a data point in the graph to add the first cursor. Select the Data Cursor button again
and add another cursor to the graph by double-clicking on the desired data point.
1828
Data Exploration
Note: After you add all the columns in the Data Info Report Settings dialog, you can save the
settings as a Theme by clicking the Save Theme button and choosing an option from the
popup menu. Note that you can save settings to the graph (maximum portability) or to a named
Theme file (and subsequently applied to any graph window).
12. The Data Info window will be updated with the values of the two points and their relative values.
13. Right-click the Data Info window and select Copy All from the shortcut menu, then paste the table
into a clean worksheet as shown below.
1829
Tutorials for Origin
14.
You can promote any worksheet row to the column label rows (header) area
by right-clicking on the row and choosing one of the Set As... or Append
To... options.
1830
9 Importing Data
9.1.1 ASCII
Importing Data
Single ASCII
Import Wizard
9.1.2 Database
9.1.3 Digitizer
Digitizer Tool
Enhanced Digitizer
9.2 ASCII
9.2.1 ASCII
Importing Data
Single ASCII
Import Wizard
1831
Tutorials for Origin
9.2.2.1 Summary
Origin provides flexible ways of importing data including simply dragging and dropping data files, using the
ASCII import dialog to customize settings, using the Import Wizard for advanced customization and for
extracting variables from header lines, and supporting custom file formats for many third-party files. This
tutorial will highlight some of these features.
Note: This tutorial requires you to drag-and-drop data files onto Origin, so please make sure you are not
running Origin as administrator.
1. Start with an empty worksheet. Open Windows Explorer to the \Samples\Curve Fitting subfolder of
your Origin installation folder. Drag and drop the file sensor01.dat from the Windows Explorer
window into the empty Origin worksheet.
1832
Importing Data
2. Data comes into the sheet. Now select two files: sensor02.dat and sensor03.dat and drop into the
same worksheet. You will see that the first file replaces the data already in the worksheet, and the others
create new workbooks, as the default setting is to create new books for the 2nd file.
The default setting when dragging and dropping is to replace existing data. If you have
some other data already in the sheet, you can drop the file onto the gray area outside
of any window, or into a graph window, and Origin will create a new book and import
the data.
ASCII import and custom-file-format import both provide an options dialog where a user can customize import
settings and then save settings for later use on similar files.
1. Start with a new book and click the Import Multiple ASCII button on standard toolbar.
2. Select the files sensor01.dat, sensor02.dat from \Samples\Curve Fitting and add to lower panel
of the file dialog. Click the file name column header in lower panel to sort the files by name. Keep the
Show Options Dialog box checked and click OK. This will open a dialog for import settings.
1833
Tutorials for Origin
3. Change import mode to Start New Sheets. Expand (Re)Naming Worksheet and Workbook node
and change settings so that only sheet gets renamed.
1834
Importing Data
4. Click on right arrow button at the top of the dialog and select Save As, then give it a name such as
My Multifile Import and click OK. This saves your settings to a theme file on disk.
5. Click OK and the 1st file gets imported into the current sheet, and a new sheet is created for the 2nd
file. File names are used as sheet names.
1835
Tutorials for Origin
6. Now start a new book and invoke the menu File: Recent Imports: impASC: My Multifile Import. In
the file dialog pick the three files: step01.dat, step02.dat, step03.dat from \Samples\Curve Fitting.
Click the file name column header in lower panel to sort the files by name. Click OK. The settings from the
theme you saved and selected here are used to perform the importing.
When doing serial import of files to new sheets (Start New Sheets), note that the
workbook can contain a maximum of 255 sheets (prior to Origin 2018) or 1024 sheets
(Origin 2018 and later). When the maximum number of sheets is reached, a new book
is created.
Custom ASCII import settings is by default saved into the worksheet itself. It can also be saved as a theme file
to disk. Please note that settings saved in this way can only be reused when import with the impASC dialog. If
you want to use the settings when drag-n-drop to import a data file, you will need to use Save Settings for
Drag and Drop menu.
1. Start with new book and invoke File: Import: Single ASCII from menu, and select the file
sensor01.dat from \Samples\Curve Fitting subfolder, and keep the Show Options Dialog checked
and click OK.
2. In the ImpASC dialog, unfold Import Options branch, select No with the Add Sparklines drop-down list.
Expand (Re)Naming Worksheet and Workbook node and change settings so that only sheet gets
renamed by file name, not book.
3. Click on Top Arrow icon and select Save Settings for Drag and Drop and click OK. Then your custom
settings get saved to the sheet and data is imported.
4. Select File: Save Template As from the main menu. Enter SensorImport as the template name. Click
OK to save the workbook template. This template contains both the import settings and the worksheet
properties settings.
1836
Importing Data
5. Now we create a new workbook from this template. Click the Open Template button on the Standard
toolbar. Select SensorImport.otw under your User Files Folder and then click Open. A workbook is created
from the template.
6. With this book active, drag and drop the file sensor02.dat. The data gets imported and only sheet name
changes to the new file name. The sparklines were not turned on.
When saving custom settings to a worksheet, it is useful to then save the sheet, along
with other desired analysis operations, as an Analysis Template for repeat analysis of
similar data from multiple files. See the Batch Processing tutorial for details.
The Import Wizard allows you to step through your data file, customize settings including how to parse header
lines to create variables, and then save all of your custom settings as an import filter (.OIF) file for repeat use.
The filter file can reside in the data folder, in the \Filters sub folder of your User Files Folder, or even saved
to the worksheet itself for use with Analysis Templates. The Wizard is typically useful when the file has
header lines that need to be parsed, or the file needs custom settings such as fixed width, or for executing
LabTalk script at the end of the import for post processing.
1. Start with a new book. Click on the Import Wizard button in the Standard toolbar to launch the
wizard.
2. Select the file \Samples\Import and Export\S15-125-03.dat.
3. Note that the Import Filter for Current Data Type drop-down changes to show Data Folder:
VarsFromFileNameAndHeader, this is a filter already created for this file and shipped with Origin,
and is automatically picked up from the same folder as the data file you chose. Then change Import
Mode to Replace Existing Data.
1837
Tutorials for Origin
4. Click Next and walk through the pages. Notice controls on Header Lines pages that allows flexible
definition of where the header lines end, where the sub header lines are located, and what gets assigned
to long name and units etc.
5. For this file the Variables Extraction and Variables Extraction by Delimiter page define how to parse
the header lines to extract values from them.
6. Click Next until you get to the Save Filters page. Check the Save filter box and change the radio
button to In the Window. This will save the filter in the active worksheet.
1838
Importing Data
7. Now check the Specify advanced filter options. It brings you to a last page where script (to run at the
end of the import) can be specified. In Script after Each File Imported edit box enter:
col(E)=col(2)-273.15;
col(E)[u]$=(\+(0)C);
col(E)[l]$=Delta Temperature;
1839
Tutorials for Origin
8. Click Finish, the file gets imported and the import filter is now saved in your worksheet. The fifth column
is a column added by the script. It is the Delta Temperature data in Degree Celsius.
9. With the worksheet active, click Import Wizard button again and pick file \S21-235-07.dat. Note
that the Import Filter for Current Data Type drop-down shows <use filter in active window>,
so Origin picks up the filter settings that were saved in the worksheet.
1840
Importing Data
10. Click Finish and the file gets imported and the script gets executed (the values in column 5 is updated).
You can save the import settings to the worksheet, perform analysis on the imported
data, and save the workbook as an analysis template for repeat processing of similar
data files. See the tutorial on batch processing for more information.
9.2.3.1 Summary
The File: Import: Single ASCII menu allows you to automatically import a single ASCII file where the data
columns are delimited orderly and it consists of few header lines (maybe just a short description for the file
and then names and units for the columns).
9.2.3.3 Steps
1841
Tutorials for Origin
Using Windows Explorer, browse to the \Samples\Import and Export subfolder of the Origin program folder (by
default installed in the Program Files folder). Open the file S15-125-03.dat in Windows Notepad. You can see
that this file includes header lines and data lines. For Single ASCII files, Origin can auto detect file
header/subheader and extract this information to the worksheet headers, such as Long Name, Units, etc.
Note: Header lines are lines of text that are not part of the data and do not share the same delimiter
formatting as the data. Subheader lines also are not part of the data, but share the same delimiter formatting
and therefore correspond to particular columns of data.
1. Select File: Import: Single ASCII from the menu to open the File Import dialog. Browse to the
\Samples\Import and Export subfolder of the Origin program folder. Highlight the file S15-125-03.dat.
2. If you double-click this file or click the Open button, Origin will import the file automatically. To view the
settings for how Origin will import the file, check the Show Options Dialog checkbox at the bottom of
the dialog and then click Open. This will bring up the impASC X-Function dialog.
1842
Importing Data
By default, Origin auto detects the subheader, and data will be imported from subheader. In this example,
Origin automatically set the first line,
Time Delta Temperature Magnetic Field Position
as the worksheet column Long Name and the second line,
(sec) (K) (Oe) (mm)
as Units.
9.2.4.1 Summary
The Import Wizard allows you to preview your ASCII file. This is especially helpful when you are importing a
file with many lines of header, and want to extract variables from both the file name and file headers for use in
annotating a graph.
1843
Tutorials for Origin
This tutorial will show you how to use the Import Wizard.
9.2.4.3 Steps
The Import Wizard allows you to import complicated ASCII files, extract variables from the import file name
and header (for reuse in Origin), specify custom delimiters and date formats, or handle post-processing of
your imported data using a custom LabTalk script. Another chief advantage of using the Wizard to import your
data files is that you can save your custom settings to a filter that can be used repeatedly to import the same
or similarly-structured files.
1. Create a new workbook. Click File, point to Import, and then click Import Wizard to open the Import
Wizard dialog. Click the browser button to the right of the File box. Browse to the \Samples\Import
and Export folder and open the file F1.dat. Click Next to navigate to Header Lines page.
2. This page enables you to easily customize the worksheet headers. For example, to specify the worksheet
long name, clear Auto determine header lines check box, place your cursor on the relevant line in the
lower panel, and then click the button next to Long Names.
1844
Importing Data
Similarly, specify the Unit line and select <None> for Comments.
3. Click Next to navigate to File Name Options page. Make sure the worksheet with file name box is
checked to rename worksheet by imported file name.
1845
Tutorials for Origin
4. Click Next to go to the Data Columns page. Select (XYE) from the Column Designations drop-down
menu and click Apply.
5. Click Next twice to go to the Save Filters page. To use these settings again, you can save this import
procedure as a filter. Select the Save filter check box and type a filter name in the Filter file name text
box (MyFilter in this example).
1846
Importing Data
Select MyFilter filter just saved. It will be used to import the file.
9.2.5.1 Summary
1847
Tutorials for Origin
Origin interprets Dates based upon the Gregorian Calendar, while Time is interpreted in
hours:minutes:seconds. When working with Date and Time data, Origin displays these data in different
formats, but internally uses underlying numeric values for calculations and certainly plotting operations. This
tutorial shows you how to import custom date/time data.
How to change the display settings for the custom date/time format
9.2.5.3 Steps
1. We will import \Samples\Import and Export\Custom Date and Time.dat in this tutorial. Before
importing the file, let's look at the data structure first.
We can see that there is a space between Date and Time, and it uses Tab to separate Time from the rest
of the data. So we will use multiple delimiters to import this data file.
2. Open the file in Import Wizard. Accept the default settings on all pages until you get to the Data
Columns page. Origin will, by default, use Tab to separate the data into two columns. To divide Date
and Time, check the Tab/Space checkbox in the Column Separator group.
1848
Importing Data
Note in the preview box that the column title is A(Y)(T&N), where (T&N) means the data format is Text
& Numeric. Because the date uses "." to separate day, month and year, Origin by default treats the first
column as Text. For the second Time column, Origin shows the underlying numeric values. To import data
correctly, we should change the column properties.
dd'.'MM'.'yyyy
where dd, MM and yyyy mean the days, months, and year respectively. Since the "."is used as a
separator, we need to put single quotation marks around it in the format specification. After entering
the custom format, press the Apply button next to the edit box. Then right-click on the header of the
first column in the preview and select Date from the context menu:
1849
Tutorials for Origin
Then the column title will turn into A(Y)(D) which means this is now a Date data column.
4. Similarly, right-click on the header of the second column and select Time to set that column as a time
column:
1850
Importing Data
You can see the time data display in long format. We can change the display setting after imported.
5. Click Next twice to go to the Save Filters page. Select Save filter checkbox and In the User File
folder radio box to save the import settings to a filter. Enter the filter file name as Custom Date and
Time in the Filter file name (.OIF extension will be appended) edit box.
6. Click Finish button to import data. Then double-click the second column title to open the Column
Properties dialog, and set the Time display as:
HH:mm:ss.##
1851
Tutorials for Origin
7. Open Windows Explorer and browse to folder \Samples\Import and Export\. Locate the file Custom
Date and Time.dat, drag and drop it to Origin workspace. The Select Filter dialog will open asking
you to select a filter.
Select Custom Date and Time filter just saved. It will be used to import the file.
Note: In the case of this particular data file, the first column simply has the exact same date in every row. So
at this point you may want to set this first column as Disregard by right-clicking on the column header and
selecting Disregard from the context menu. Then you can set the 2nd column as type X, and plot the data in
the third column against the time data in the 2nd column.
9.2.6.1 Summary
The Import Wizard allows defining a custom filter to import ASCII and simple binary files. The filter can then
be reused with similar data files once created. The filter mechanism also allows including LabTalk script lines
that will then be run at the end of the import. This capability allows user to add post-processing script code to
the filter.
1852
Importing Data
9.2.6.3 Steps
1. Start a new workbook by clicking the New Workbook button on the Standard toolbar.
2. Click the Import Wizard button on the Standard toolbar to open the wizard.
3. In the Data Source group, click the button to the right of File and navigate to and add the file
Samples\Import and Export\S15-125-03.dat.
4. A suitable filter for importing this file already exists in the data folder. Click the Next button to proceed
thru all the pages of the wizard till you get to the Save Filters page.
5. On this page, check the Save Filter checkbox and select the option of In the User Files folder. Then
specify the filter name as fil_01 in the Filter file name(.OIF extension will be appended) area.
6. Check the Specify advanced filter options checkbox and then click Next. This will bring you to the
Advanced Options page.
7. On this page, copy and paste the following lines in the Script after Each File Imported edit box:
nlfit;
8. Click Finish. This will save the filter along with these added lines of script, and the file will be imported
and the script will run. The workbook will then have three sheets, which will include the custom report
sheet and the fitted curve sheet, which are results of Gauss function fit to column 4 of the imported data.
9. Start a new project and open import wizard again and add all three files S15_125_03.dat, S21-235-07,
S32-014-04 in the file open dialog.
10. Under Import Filter, check List filters applicable to both Data Type and file name checkbox and
select Select User File Folder:fil_01 from the Import Filters for current Data Type drop-down list.
11. Under Target Window, select Start New Books from the Import mode drop-down list then click Finish.
Your modified filter will be used and after each file is imported, the 4th column will be fit with the Gauss
function.
9.2.7 Importing Multiple Files into Workbooks Cloned from Active Workbook
9.2.7.1 Summary
1853
Tutorials for Origin
Origin provides a quick yet powerful way to clone current workbook/sheet when importing data, so that each
new data will be imported to workbook/worksheet with same customization and analysis. This feature is
implemented for most of Origin's supported import file types, e.g., ASCII, CSV, Excel, etc. This tutorial will
highlight this feature with commonly used ASCII files.
In this example we will import a file and do a linear fitting with it.
1. Start a new project. Click the Import Single ASCII button on standard toolbar.
2. Browse to <Origin Installation Path>\Samples\Curve Fitting\ folder to select Sensor01.dat.
3. Check Show Options Dialog checkbox and click Open button.
4. Under the Import Options -> Rename Sheets and Books node, uncheck the Rename Sheet with
(Partial) Filename box.
5. Click OK button to finish import. You can see after import, Sheet name is still Sheet1.
6. Highlight column B (Sensor Output) and choose Plot: 2D: Scatter : Scatter to plot a scatter graph.
7. Double click on X axis to open the Axis dialog. Activate Scale tab. Choose both Horizontal and Vertical
on left panel and set Rescale as Auto. Click OK.
8. Choose Analysis: Fitting: Linear Fit menu to open Linear Fit dialog. Select Recalculate mode as
Auto, click OK button to perform the fit. Select No radio box and click OK button in appeared prompt.
9. Right click in gray area on Sheet 1 worksheet and choose Add Graph... context menu. Choose Graph1
and click OK. Scatter plot with linear fit curve will show as a floating graph on Sheet1.
1854
Importing Data
In step 8., you were asked to set the Recalculate mode to Auto. Beginning with Origin
2018b, this step is not necessary as cloned imports automatically trigger recalculation.
Earlier versions of Origin will behave in the same way if you put the following line of LabTalk
script into Script after Each File Imported box in the Import Multiple ASCII dialog box.
run -p au;
Now we want to import more Sensor data and do the same linear fit.
1. Make sure Sheet1 sheet is active and click the Import Multiple ASCII button on standard toolbar.
2. Select the files Sensor02.dat, Sensor03.dat from \Samples\Curve Fitting and add to lower panel of the
file dialog. Keep the Show Options Dialog:<sheet> box checked and click OK. This will open a dialog
for import settings.
1855
Tutorials for Origin
3. Expand Import Options node and set 1st File Import Mode and Multi-File (except 1st) Import
Mode to Start New Books. To clone current workbook, select <clone> from Template Name drop-
down list.
4. Click OK button to import multiple files. Each data file is stored in a new workbook with same analysis done
as in prototype workbook.
1856
Importing Data
9.3 Database
9.3.1 Database
9.3.2.1 Summary
Query Builder (Origin 32-bit only) -- a graphic dialog to build the SQL query.
SQL Editor (both Origin 32-bit and 64-bit) -- editor to directly write and edit SQL query. It is more
convenient for skilled database users. It also allows users to define LabTalk variables in the SQL script.
1857
Tutorials for Origin
In both tools, Database Connection can be saved as ODS file and Database Connection and Query can
be saved as ODQ file for future use. Importing from database in Origin 64-bit is faster so users can build ODS
and ODQ file in Query Builder if they are not familiar with SQL language, and later run Origin 64-bit to load
the ODQ in SQL Editor for the real import.
This tutorial will show you how to build the connection to a SQL server and extract desired data from specified
tables using SQL Editor and Query Builder. The SQL database we use here is AdventureWorks database. For
detailed information of how to attach an AdventureWorks database, please refer to CodePlex website.
Reimport data.
9.3.2.3 Steps
Suppose we have already set up a SQL server named AdventureWorks2008 on a server machine noho.
1. Start a new project. Open SQL Editor by clicking the Open SQL Editor button on the Database
Access toolbar.
1858
Importing Data
2.
3. Now we are going to create the connection to the AdventureWorks2008R2 database. Click button or
select File: New...menu to bring up the Data Link Properties dialog.
4. Select Microsoft OLE DB Provider for SQL Server on the Provider tab. Click Next>> button.
1859
Tutorials for Origin
5. On the Connection tab that is active, specify the server information, including server name, log-in
user name and password (if needed, in this example labtalk2015), and database name. Click Test
Connection to make sure the connection is successful.
1860
Importing Data
6. Click OK button. All tables in database AdventureWorks2008 are listed in the left panel. The Connection
string is in the Message tab.
1861
Tutorials for Origin
7.
Alternatively if you already have connection string, you can select File: Edit Connection String...
menu to open the Connection String Editor dialog. Enter the following SQL string and then click OK
button to create the connection.
Provider=SQLOLEDB.1;
Password=labtalk2015;
USER ID=CONNECT;
Initial Catalog=AdventureWorks2008;
DATA SOURCE=noho
8. Select File: Save Connection As... to save the data source file as MyDataSource.ods.
1862
Importing Data
9. Now we are going to extract data from 9 tables to construct the employee list. You can write SQL script
from scratch. Double click node on left panel will help you add the table and field name in the editor. For
now, just copy following SQL scripts in the right panel.
SELECT
p.AdditionalContactInfo
FROM
Person.CountryRegion AS cr ON cr.CountryRegionCode =
sp.CountryRegionCode LEFT OUTER JOIN
1863
Tutorials for Origin
WHERE sp.Name='Washington'
ORDER BY e.BusinessEntityID
10. Click the Preview the result data button to preview the data. If the preview is fine, click the
Import data to worksheet button to import these data. Once imported, the worksheet is
connected to the database, and a yellow icon will appear at the top-left of the worksheet.
11. Select File: Save Connection and Query As... from menu to save the connection and query as
MyQuery.odq. Close the SQL Editor.
1. If you are running Origin 32-bit, you can use Query Builder to visually build your SQL scripts
2. Start a new project. Click Query Builder button on Database Access toolbar.
1864
Importing Data
3. Select Query: Data Source: Open... menu to load MyDataSource.ODS. All tables in database
AdventureWorks2008 will show in right panel.
4. Drag and drop the following 9 tables from the right panel to the Main panel in the middle:
HumanResources.Employee
Person.Address
Person.BusinessEntityAddress
Person.CountryRegion
Person.EmailAddress
Person.Person
Person.PersonPhone
1865
Tutorials for Origin
Person.PhoneNumberType
Person.StateProvince
5. Drag main key BusinessEntityID from table HumanResources.Employee and drop it to that key in
table Person.BusinessEntityAddress to join these two table. A join line will connect between them.
6. Select the checkbox in front of the following columns from the corresponding tables to add them to the
lower panel.
Table Column
o BusinessEntityID
HumanResources.Employee o JobTitle
o Title
o FirstName
Person.Person o MiddleName
o LastName
o Suffix
1866
Importing Data
o EmailPromotion
o AdditionalContactInfo
o AddressLine1
o AddressLine2
Person.Address o City
o PostalCode
o Name
Person.StateProvince
o Name
Person.CountryRegion
o PhoneNumber
Person.PersonPhone
o Name
Person.PhoneNumberType
o EmailAddress
Person.EmailAddress
7. In the lower panel, drag and drop the first cell of a row to re-arrange column order as needed. E.g.
JobTitle is moved after Suffix.
1867
Tutorials for Origin
8. Select Ascending from Sort Type drop-down list in the first row
HumanResources.Employee.BusinessEntityID to sort the whole worksheet according to this column
ascendingly.
1868
Importing Data
10. Click the Preview button to preview the data in bottom panel. If the preview is fine, click the Import
button to import into data into worksheet. Once imported, the worksheet is connected to the
database, and a yellow icon will appear at the top-left of the worksheet.
11. Select File: Save Connection and Query As... from menu to save the connection and query as a ODQ
file MyQuery2.odq. Close the Query Builder.
1869
Tutorials for Origin
No matter using SQL Editor or Query Builder to import data from database, the connection and the query
are automatically saved in the worksheet. You can click the Import data button on Database Access
toolbar anytime to import the data from the database again. Try the following steps.
1. If your database is big, the saved workbook file will be big. You can choose
Worksheet: Clear Worksheet to clear the data and then save the workbook.
Later you can load the workbook and click the Preview the result data button
to preview 50 rows of the data or click the Import data button to import
from database.
2. If you need to modify the query, with the worksheet active, click the SQL Editor
In above examples, we only imported data for Washington state. But it's harded coded so if you want to do a
query of another State, you need to change the query. This section will show you how to define a Labtalk
string variable for state name so it's easier to change the query in the future.
1. Start with a new project. Choose File: Database Import: MyQuery.ODQ to import data directly into
worksheet.
2. Click the Open SQL Editor button to open the SQL Editor.
3. To add a Labtalk string variable, select Query: LabTalk... to open the LabTalk Support Setting dialog.
1870
Importing Data
6. At the end of SQL Script on right panel, change WHERE statement into
7. Click the button to preview the SQL query string in with labtalk variable substituted the SQL
Editor box.
1871
Tutorials for Origin
8. Click the Import data to worksheet button to import these data. Close the dialog and choose Yes
to resaved the SQL Query into worksheet.
9. From now on, you only need to change the strCond$ value in LabTalk Support Settings dialog to
change the State name. No need to change the SQL Query.
9.3.3.1 Summary
This tutorial shows how to import data from database into Origin worksheet by using SQL Editor. And then
perform some operations on the data, such as filter, statistics, etc., so to get the desired results for the
graphing.
The SQL database we use here is AdventureWorks database. For detailed information of how to attach an
AdventureWorks database, please refer to CodePlex website.
Import two SQL queries of same database into two sheets of a workbook data using SQL Editor.
1872
Importing Data
9.3.3.3 Steps
Suppose we have already set up a SQL server named AdventureWorks2008 on a server machine noho.
1. Start a new project. Open SQL Editor by clicking the Open SQL Editor button on the Database
Access toolbar.
2. Select File: Edit Connection String... menu and put the connection string below to the text box.
Provider=SQLOLEDB.1;
Password=labtalk2015;
USER ID=CONNECT;
Initial Catalog=AdventureWorks2008;
DATA SOURCE=noho
3. Click the Test button to test if the connection is fine. If fine, click the OK button to connection to the
database.
4. From the top left panel, double click on Production.Product table to add the table name on right panel.
5. Click the Preview the result data button to view the data in the bottom panel.
1873
Tutorials for Origin
6. Click the Import data to worksheet button to import the data in the table to the active
worksheet.
1874
Importing Data
7. To import data based on another SQL query from the same database to new sheet, click the minimum
button on the title bar of SQL Editor dialog to make it shrink into a bar.
8. Right click on Sheet1 tab and choose Add to add a new sheet.
9. Click the minimum button of SQL Editor dialog again to expand the dialog. You can see Production:
Product still shows in right panel. You can ignore it for now.
10. Select Query: LabTalk... menu to open the LabTalk Support Settings dialog. Check the Enable
LabTalk (%, $) Substitution checkbox, and put the following script to the text box.
1875
Tutorials for Origin
11. Click OK to go back SQL Editor. Then put the following SQL script to the top right panel to replace existing
content Production.Product. This script is going to query three columns from the database, one is the
product's category name, other twos are line total for each category on year 2003 and 2004 respectively.
FROM
(SELECT Production.ProductCategory.Name,
LINETOALANDNAME2003.LineTotalFor2003
FROM
(SELECT SUM(SALEANDPRODUCT2003.LineTotal) AS
LineTotalFor2003, Production.ProductSubcategory.ProductCategoryID
FROM
(SELECT SALEINFO2003.LineTotal,
PRODUCTINFO2003.ProductSubcategoryID
FROM
(SELECT Sales.SalesOrderHeader.OrderDate,
1876
Importing Data
Sales.SalesOrderDetail.LineTotal, Sales.SalesOrderDetail.ProductID
FROM Sales.SalesOrderHeader
ON
Sales.SalesOrderHeader.SalesOrderID=Sales.SalesOrderDetail.SalesOrderID
WHERE Sales.SalesOrderHeader.OrderDate
BETWEEN '%(strDateBegin1$)' AND '%(strDateEnd1$)') AS SALEINFO2003
INNER JOIN
(SELECT Production.Product.ProductID,
Production.Product.ProductSubcategoryID
FROM Production.Product) AS
PRODUCTINFO2003
ON
SALEINFO2003.ProductID=PRODUCTINFO2003.ProductID) AS SALEANDPRODUCT2003
ON
SALEANDPRODUCT2003.ProductSubcategoryID=Production.ProductSubcategory.Prod
uctSubcategoryID
GROUP BY Production.ProductSubcategory.ProductCategoryID)
AS LINETOALANDNAME2003
ON
LINETOALANDNAME2003.ProductCategoryID=Production.ProductCategory.ProductCa
tegoryID) AS TABLE2003
INNER JOIN
(SELECT Production.ProductCategory.Name,
1877
Tutorials for Origin
LINETOALANDNAME2004.LineTotalFor2004
FROM
(SELECT SUM(SALEANDPRODUCT2004.LineTotal) AS
LineTotalFor2004, Production.ProductSubcategory.ProductCategoryID
FROM
(SELECT SALEINFO2004.LineTotal,
PRODUCTINFO2004.ProductSubcategoryID
FROM
(SELECT Sales.SalesOrderHeader.OrderDate,
Sales.SalesOrderDetail.LineTotal, Sales.SalesOrderDetail.ProductID
FROM Sales.SalesOrderHeader
ON
Sales.SalesOrderHeader.SalesOrderID=Sales.SalesOrderDetail.SalesOrderID
WHERE Sales.SalesOrderHeader.OrderDate
BETWEEN '%(strDateBegin2$)' AND '%(strDateEnd2$)') AS SALEINFO2004
INNER JOIN
(SELECT Production.Product.ProductID,
Production.Product.ProductSubcategoryID
FROM Production.Product) AS
PRODUCTINFO2004
ON
SALEINFO2004.ProductID=PRODUCTINFO2004.ProductID) AS SALEANDPRODUCT2004
ON
1878
Importing Data
SALEANDPRODUCT2004.ProductSubcategoryID=Production.ProductSubcategory.Prod
uctSubcategoryID
GROUP BY Production.ProductSubcategory.ProductCategoryID)
AS LINETOALANDNAME2004
ON
LINETOALANDNAME2004.ProductCategoryID=Production.ProductCategory.ProductCa
tegoryID) AS TABLE2004
ON TABLE2003.Name=TABLE2004.Name
12. Click the last button to view the SQL query script with subsitudted variable. Click Preview the
13. Click the Import data to worksheet button to import the query into the the active Sheet2.
1879
Tutorials for Origin
14. Close SQL Editor. You will be prompted to save the change. You can choose No since the query settings
are saved in corresponding sheet automatically when clicking Import button. You can also choose Yes to
save the query of active sheet as an ODQ file for future use.
1. Go to the first worksheet with the imported data from Production.Product in the above section.
2. Select column I (long name is StandardCost), and then add a data filter to this column by clicking the
Add/Remove data filter button on the Worksheet Data toolbar.
3. Then there will be a filter icon on the top left corner of the column header. Click on it, and then select
Greater Than... from the context menu.
1880
Importing Data
4. There will be a dialog open, just keep the default Value to be 0 and click OK button.
5. Add a filter in column P (long name is ProductLine) as well with condition as follows.
1881
Tutorials for Origin
6. Select column I and J (StandardCost and ListPrice), then select menu Statistics: Descriptive Statistics:
Statistics on Columns to open the Statistics on Columns dialog.
7. In the open dialog, set Grouping Range to be column P. You can just click the triangle button to
select column P from list on the right. And in the Plots tab, check Box Charts checkbox.
1882
Importing Data
1883
Tutorials for Origin
1. Go to the Sheet2.
2. Highlight all three columns, and select Plot: Specialized: Radar menu to make a radar plot.
1884
Importing Data
3. Double click on the Clothing axis to open the Axis Dialog. Please note that the below procedure is based
on Origin 2017.
4. With Scale selected on the left panel. Make sure Use Same Options for All Axes checkbox is
unchecked. Select Axis1 to Axis4 on the left panel. Then set From to 0, and choose By # of Majors
for Major Ticks with value of 6. Click Apply button.
1885
Tutorials for Origin
5. Still with Axis1 to Axis4 selected on the left, go to Tick Labels tab. Before Axis is chosen in Show Tick
Labels. Please expand the dropdown list and choose Before Axis again since we want to apply it to all
Axes.
6. Set Display to Decimal: 1000, and Divide by Factor to 1000000 (one million). Click Apply button.
1886
Importing Data
7. Now go back to Scale tab. Select Axis1 - Clothing only on the left and change To value to 1.5. Repeat
this operation for Axis3 - Accessories and Axis4 - Components, with values of 0.7 and 6 respectively.
Note: because Divide by Factor was set to 1000000 in the previous step, it's much easier to type the To
value now.
8. Click OK button.
1887
Tutorials for Origin
We can see that, for all four categories, line totals for 2004 is bigger than that for 2003. And Bikes is the
biggest.
9.3.4.1 Summary
Origin supports importing data from many popular databases using ADO or ODBC. Once the data is in, Origin's
data filtering and analysis features allow you to set up an Analysis template. This tutorial illustrate how to
setup such an analysis template and use it to import data from database with updated analysis result.
The SQL database we use here is AdventureWorks database. For detailed information of how to attach an
AdventureWorks database, please refer to CodePlex website.
Use SQL Editor to import data from database for a specific year.
Create a pivot table for total cost of different products in different countries.
1888
Importing Data
Insert the graph into the worksheet as a floating graph and save such self-contained workbook as analysis
template.
Load the analysis template and change the SQL query, reimport database to do analysis for another year.
9.3.4.3 Steps
Suppose we have already set up a SQL server named AdventureWorks2008 on a server machine noho.
1. Start a new project. Open SQL Editor by clicking the Open SQL Editor button on the Database
Access toolbar.
2. Select File: Edit Connection String... menu and put the connection string below to the text box.
Provider=SQLOLEDB.1;
Password=labtalk2015;
USER ID=CONNECT;
Initial Catalog=AdventureWorks2008;
DATA SOURCE=noho
3. Click the Test button to test if the connection is fine. If fine, click the OK button to connection to the
database.
4. Copy and paste the following query into the SQL Editor text box. The query shows data for the year 2003:
1889
Tutorials for Origin
Pr.Name AS ProductName,
Pr.Color AS ProductColor,
PC.Name AS ProductCategory,
PS.Name AS ProductSubcategory,
SOH.OrderDate AS OrderDate,
SOD.OrderQty AS OrderAmount,
SOD.LineTotal AS TotalCost
FROM Person.CountryRegion AS CR
ON SP.CountryRegionCode = CR.CountryRegionCode
ON A.StateProvinceID = SP.StateProvinceID
ON BEA.AddressID = A.AddressID
ON P.BusinessEntityID = BEA.BusinessEntityID
ON PCC.BusinessEntityID = P.BusinessEntityID
ON SOH.CreditCardID = PCC.CreditCardID
1890
Importing Data
ON SOD.SalesOrderID = SOH.SalesOrderID
ON Pr.ProductID = SOD.ProductID
ON PS.ProductSubcategoryID = Pr.ProductSubcategoryID
ON PC.ProductCategoryID = PS.ProductCategoryID
5. Click the preview button to view the data the query produced in the bottom panel.
1891
Tutorials for Origin
6. In the SQL Editor dialog, click File: Save to Active Worksheet menu to save database connection and
query to the active worksheet. Close the SQL Editor.
7. Click Import data button to import data into worksheet. The icon on the top left of the workbook
indicates the sheet contains an SQL query.
1. Origin has a data filter feature similar to Excel. We can use this feature to choose specific data for
graphing and analysis without removing the rest of the data.
2. Select column E (Long Name: Product Subcategory). In order to choose just the bike data for
analysis, add a data filter to this column by clicking the Add/Remove data filter button on the
Worksheet Data toolbar.
1892
Importing Data
3. A filter icon will appear on the top left corner of the column header. Click on it, and from the list that
appears, uncheck Select All and then select Mountain Bikes, Road Bikes and Touring Bikes.
4. If a reminder message about hidden data appears, select the Yes radio button and click OK.
5. The sheet will now show data for just those 3 bikes types.
1. We can create a pivot table to see total costs of each bike type in different countries.
2. With nothing selected in worksheet, select Worksheet: Pivot Table: Open Dialog...
3. In the dialog that opens set the Row Source as CustomerCountry.
4. Set the Column Source as ProductSubcategory (the column with the filter on it).
5. In order to see the Total Cost, set the Summarize by option as Sum , and set the Pivot Table Data
Source option that appears as TotalCost.
1893
Tutorials for Origin
7. Click on the green lock located on the top right of the first column and set the Recalculate Mode:
Auto in the context menu. This will make the pivot table manipulation update if the data is re-
imported from the SQL Editor.
1894
Importing Data
8. Now highlight the pivoted data and click on the Column Plot button to create a column plot.
1895
Tutorials for Origin
1. Double click the Y axis title and set it as Total Sales ($)
2. Double click on the Y Axis to open the Axis dialog.
3. On the Y axis Scale page, set the Rescale dropdown to Auto. Click OK.
4. Right click on the graph and select Add/Modify Layer Title from the context menu. Set the Title as Bike
Sales by Year. If needed, a year title can be added this way as well.
1. Add the graph to the worksheet with the original data by right clicking gray area in worksheet and from
the context menu selecting Add Graph....
2. In the Graph Browser dialog, select the graph and click OK. Resize and move as needed. If you need to
customize the graph further, double click it to bring up the independent graph window again to customize.
And then click the return button on graph window title to bring it back to worksheet.
3. workbook is self-contained with everything: database connection, data filtering, analysis (pivot table) and
graph.
4. Choose Worksheet: Clear Worksheet... menu and choose Yes when prompt shows to clear data from
workbook. Note: Usually saving analysis template will clear data automatically but for database
connection, it doesn't happen automatically. So we need to do this step
1896
Importing Data
5. Choose File: Save Workbook as Analysis Template... or right click on the .worksheet title bar and
select Save as Analysis Template... as shown below to save a template.
6.
1. Go to File: Recent Books menu to load the analysis template you just saved. This will open a blank
analysis template workbook.
1897
Tutorials for Origin
2. Click on the SQL Editor button to open the SQL Editor with SQL query loaded. Change it to
show data for the year 2004 and then exit out of the Editor.Choose Yes to save the change SQL
change in worksheet.
3. Re-import the data by clicking the Import Data button on Database Access toolbar.
4. and reapply the filter with the Reapply data filter : button.
1898
Importing Data
5. All the data will update. The graph now shows the Bike Sales for the year 2004, and the year title has
changed to reflect this.
6. You project now has two books; Book1 has the data for the year 2003, Book2 has the data for the
year 2004.
7. You can use this template and the SQL re-import feature to find the Bike sales for as many years as
needed just by adjusting the year range in SQL Editor and reimport.
9.3.5.1 Summary
This tutorial shows how to import data from database into Origin worksheet by using SQL Editor with LabTalk
substitution. And then make a column plot for the imported data. Then update the worksheet data and the plot
by changing the defined LabTalk variables.
The SQL database we use here is AdventureWorks database. For detailed information of how to attach an
AdventureWorks database, please refer to CodePlex website.
9.3.5.3 Steps
1899
Tutorials for Origin
Suppose we have already set up a SQL server named AdventureWorks2008 on a server machine noho.
1. Start a new project. Open SQL Editor by clicking the Open SQL Editor button on the Database
Access toolbar.
2. Select File: Edit Connection String... menu and put the connection string below to the text box.
Provider=SQLOLEDB.1;
Password=labtalk2015;
USER ID=CONNECT;
Initial Catalog=AdventureWorks2008;
DATA SOURCE=noho
3. Click the Test button to test if the connection is fine. If fine, click the OK button to connection to the
database.
4. Select Query: LabTalk... menu in SQL Editor to open LabTalk Support Settings dialog. In this dialog,
check the Enable LabTalk (%,$) Substitution checkbox, and then put the following LabTalk script to
Before Query Script textbox.
1900
Importing Data
5. Click OK to go back SQL Editor. In the right text box, put the following SQL statements.
(SELECT SUM(SALEANDPRODUCTYEAR.LineTotal) AS
%(myStrName$), Production.ProductSubcategory.ProductCategoryID
FROM
(SELECT SALEINFOYEAR.LineTotal,
PRODUCTINFOYEAR.ProductSubcategoryID
FROM
(SELECT Sales.SalesOrderHeader.OrderDate,
Sales.SalesOrderDetail.LineTotal, Sales.SalesOrderDetail.ProductID
FROM Sales.SalesOrderHeader
ON
Sales.SalesOrderHeader.SalesOrderID=Sales.SalesOrderDetail.SalesOrderID
1901
Tutorials for Origin
WHERE Sales.SalesOrderHeader.OrderDate
BETWEEN '%(myStartDate$)' AND '%(myEndDate$)') AS SALEINFOYEAR
INNER JOIN
(SELECT Production.Product.ProductID,
Production.Product.ProductSubcategoryID
FROM Production.Product) AS
PRODUCTINFOYEAR
ON
SALEINFOYEAR.ProductID=PRODUCTINFOYEAR.ProductID) AS SALEANDPRODUCTYEAR
ON
SALEANDPRODUCTYEAR.ProductSubcategoryID=Production.ProductSubcategory.Prod
uctSubcategoryID
GROUP BY Production.ProductSubcategory.ProductCategoryID)
AS LINETOALANDNAMEYEAR
ON
LINETOALANDNAMEYEAR.ProductCategoryID=Production.ProductCategory.ProductCa
tegoryID
1902
Importing Data
As we can see that there are three LabTalk variables are used in the statements.
6. Just click the last button on the toolbar, we can see the substitutions.
7. Select menu File: Save to Active Worksheet to save these settings to the worksheet, and then click the
8. Close SQL Editor. We can see the imported data form the image below. The Long Name for column B
is "LineTotalFor2003", which is set in the LabTalk variable.
1903
Tutorials for Origin
9. Highlight column B from the worksheet, then select menu Plot: Column/Bar/Pie: Column to make
a column plot.
LabTalk variables myStartDate$, myEndDate$, and myStrName$ are used to control which year's data will be
imported from database. One way to import data of another year is by modifying these variable values in
LabTalk Support Settings dialog.
1. Activate the worksheet with data from database above. Click Open SQL Editor button and SQL Editor
opens again, with the saved settings.
2. Select menu Query: LabTalk to open LabTalk Support Settings dialog. Now, change the values of
these three variables: myStartDate$, myEndDate$, and myStrName$.
1904
Importing Data
3. Click OK to go back to SQL Editor. Click Save Query Settings button and then click the Import data to
4. Now we can see that the data in worksheet and graph are updated.
1905
Tutorials for Origin
But you will need to open the SQL Editor dialog everytime to change the variable values which is not
convenient. A nicer way is to modify the LabTalk Support Settings to use global variables. Then we can
modify the global variables outside SQL Editor and reimport.
1906
Importing Data
else
else
else
1907
Tutorials for Origin
3. Click Save Query Settings button in SQL Editor and close it.
4. Select Window: Script Window menu to open Script Window.
5. Run the following script by pasting them into Script window, highlighting them and then pressing ENTER
keyboard.
1908
Importing Data
Note:
1. Three "global" LabTalk variables are defined here. Here "global" means the LabTalk variables can be
"seen" and used by SQL Editor for the substitutions.
2. The last dbimport LabTalk command is the same as clicking the Import data button on Database
Access toolbar.
9.3.6.1 Summary
This tutorial demonstrate how to import data from database and do analysis and graphing with data, then add
a button in graph to update database query and reimport data using Origin's labtalk script.
The SQL database we use here is AdventureWorks database. For detailed information on how to attach an
AdventureWorks database, please refer to CodePlex website.
Import data from database with LabTalk variables in the SQL query to define date range of the query.
Add a button on the graph to modify date range of the query and reimport from database.
9.3.6.3 Steps
Suppose we have already set up a SQL server named AdventureWorks2008 on a server machine noho.
1. Start a new project. Open SQL Editor by clicking the Open SQL Editor button on the Database
Access toolbar.
2. Select File: Edit Connection String... menu and put the connection string below to the text box.
1909
Tutorials for Origin
Provider=SQLOLEDB.1;
Password=labtalk2015;
USER ID=CONNECT;
Initial Catalog=AdventureWorks2008;
DATA SOURCE=noho
3. Click the Test button to test if the connection is fine. If fine, click the OK button to connection to the
database.
4. Select Query: LabTalk... menu in SQL Editor to open LabTalk Support Settings dialog. In this dialog,
check the Enable LabTalk (%, $) Substitution checkbox, and put the following script to the text box.
1910
Importing Data
pastTo$ = strPast2$;
else
pastTo$ = "3/31/2003";
curFrom$ = strCurrent1$;
else
curFrom$ = "4/1/2003";
1911
Tutorials for Origin
curTo$ = strCurrent2$;
else
curTo$ = "6/30/2003";
5. Click OK to go back SQL Editor. In the right text box, put the following SQL statements.
1912
Importing Data
CASE
ELSE 'Current'
END,
FROM
(SELECT OrderDateAndTotalDue.OrderDate,
OrderDateAndTotalDue.TotalDue, Production.Product.ProductSubcategoryID
FROM
(SELECT Sales.SalesOrderHeader.OrderDate,
Sales.SalesOrderDetail.ProductID, Sales.SalesOrderHeader.TotalDue
FROM Sales.SalesOrderHeader
ON
Sales.SalesOrderHeader.SalesOrderID=Sales.SalesOrderDetail.SalesOrderID
OR Sales.SalesOrderHeader.OrderDate
BETWEEN '%(curFrom$)' AND '%(curTo$)')) AS OrderDateAndTotalDue
1913
Tutorials for Origin
ON OrderDateAndTotalDue.ProductID=Production.Product.ProductID) AS
OrderDateTotalDueAndProductSubcategoryID
ON
OrderDateTotalDueAndProductSubcategoryID.ProductSubcategoryID=Production.P
roductSubcategory.ProductSubcategoryID
As we can see that there are three LabTalk variables are used in the statements.
6. Click the last button on the toolbar, we can see the substitutions.
1914
Importing Data
7. Select menu File: Save to Active Worksheet to save these settings to the worksheet, and then click
the Import data to worksheet button to import the data into worksheet, and then close SQL
Editor. We can see the imported data as the following image shows. A yellow icon will appear at the
top-left of the worksheet to indicate there is database connection is saved in the worksheet.
1915
Tutorials for Origin
1. Start with the imported data. Select column C, and then choose Worksheet: Pivot Table menu to open
the Data Manipulation\Worksheet: wpivot dialog.
2. Set the Recalculation as Auto.
3. Select column B for Pivot Table Column Source by clicking the triangle button to the right.
4. Choose Sum for Summarize by. Then you can see Pivot Table Data Source row shows above, just
choose column D for it by clicking the triangle button to the right.
5. Expand the Options node and set Sort Output Columns to None.
1916
Importing Data
1917
Tutorials for Origin
1918
Importing Data
D > 0 ? 12 : 2
col(D) > 0 ? 12 : 2
1. On Pivot1 worksheet, select column C and D and select Plot: Multi-Panel: Stack... menu.
1919
Tutorials for Origin
1920
Importing Data
4. Double click bottom axis on left panel. On Tick Labels tab, set Divide by Factor as 1000000 (one
million), set Suffix as M. On Scale tab, set From and To as 0 to 120. Set Major Tick Type as By
Increment and Value as 20. Select Vertical on the left panel of the Axis dialog. Set Rescale as Auto. Select
Click OK.
5. Double click the bottom axis on right panel. On Scale tab, set From and To as -100 to 400. Set Major
Tick Type as By Increment and Value as 100. Select Vertical on the left panel of the Axis dialog. Set
Rescale as Auto. Go to Grids tab, now Horizontal shows on the left panel. Check Y=0 checkbox at the
bottom of the tab. On Special Ticks tab, select Bottom on the left panel. On Axis Begin row, set Show
as Hide. Otherwise the end tick label of left plot will run into beginning tick label of right plot. Click OK.
6. Delete legends, right axis tick labels, etc. so the graph will look as follows.
1921
Tutorials for Origin
9. You can further customize the axis such as delete those axis frames on the top and right and bottom.
Turn on grid lines. Hide the major and minor ticks on the left axis, etc. The graph will look as follows.
1922
Importing Data
1. Right click at bottom-right corner of the graph and choose Add Text.... And type Update to create a text
label.
2. Right click on the text Update and choose Properties... context menu to open Text Object dialog. Go to
Programming tab. Note: In versions before Origin 2017, choose Programming Control... from the
menu to open the Programming Control dialog.
3. Set Script, Run After to Button Up, and put the following script to the bottom text box. Click OK.
1923
Tutorials for Origin
same time
pastDate1 = date(strPast1$);
pastDate2 = date(strPast2$);
currentDate1 = date(strCurrent1$);
currentDate2 = date(strCurrent2$);
(From) pastDate1:@FD0
(From) currentDate1:@FD0
(Set Date);
1924
Importing Data
dbimport iw:=[book1]sheet1!;
The text object turns into a button and the script in it will be triggered when clicking on it.
4. Click this button, a dialog will pop up with the default dates (for the first time, if not the first time, the
dates set last time are shown).
5. Now, let's change the period, such as Last Season From 1/1/2004 To 3/31/2004, and Current Season
From 4/1/2004 To 6/30/2004.
1925
Tutorials for Origin
6. Click OK, data in the specified date range will be reimported into worksheet and Pivot1 worksheet will
be updated. The graph is updated as well. The bar color is indexed to Gain/Loss column in Pivot1
sheet. You can easily tell there is a loss in one product.
9.4 Digitizer
9.4.1 Digitizer
1926
Importing Data
Digitizer Tool
Enhanced Digitizer
9.4.2.1 Summary
The Digitizer helps you to capture data from images of graphs. You can import image files of graphs into Origin
and digitize data points one by one.
How to capture data from images of graphs using the Digitizer Tool.
9.4.2.3 Steps
1. Select Tools: Digitizer... from the main menu to open the Digitizer dialog.
2. Click the Import button on the dialog box toolbar, and select the Digitizer_image.png under
<Origin EXE folder>\Samples\Import and Export\ path. The image is imported. Note that there are
two pairs of XY axes showing in the image; one red and one blue.
1927
Tutorials for Origin
3. Click on the Rotate Image button (dialog box toolbar), and click the button to slightly rotate
the image in the counter-clockwise direction. Note that the rotation increment can be specified in << >>
Increment (degree) the text box.
1928
Importing Data
When the graph axes in the image are aligned along the bottom/top and left/right edges, click once more
4. Click on the Edit Axes button in the dialog. Using your mouse, drag the two pairs of axis lines so that
they coincide with minimum and maximum axis values. Note that when a line is selected, its
corresponding row in the Digitizer dialog is also selected. Enter the appropriate coordinate value (0, 8, -
20, 120) in the Axis Value column.
1929
Tutorials for Origin
5. After locating the axes, click the Pick New Points button. Move the cursor sequentially over the
points in the phosphorus plot (filled symbol), double-clicking on each point (or single-click and press
Enter). The GetPoints dialog displays coordinate values, while the Data Display window shows image
pixel values.
1930
Importing Data
6. When you have added all points for the phosphorus plot, click the Done button.
7. Click on the Go to Data button to show the resulting worksheet which contains the values of picked
data points.
8. Click on the Go to Image button to return to the original image. Click on the Start New Data
button to start digitizing the second plot (potassium = open symbol). Note that two new oolumns of
data points are created in the result worksheet.
1931
Tutorials for Origin
9. Click on the Pick New Points button to get the points for the second plot, repeating the procedures
followed in steps 5 and 6.
10. Click on the Go to Data button and two datasets result shows in the worksheet.
11. Click on the Go to Image button. This takes you to your imported image file. Click on the Go to
Graph button and note that this opens a graph window containing plots of your digitized data points.
1932
Importing Data
12. When you close the Digitizer dialog, a Digitizer... button appears on the image. Clicking on the
button, you can reopen the Digitizer dialog.
1. Following the steps in the above section, you will easy to get the points from the image. But if the picked
points are on the incorrect position or extra, as point A and B in the below image, you can modify or
1933
Tutorials for Origin
delete them.
2. To modify the position of point A, click on it and move the cursor to the correct position. Or you can use
Arrow keys to move the selected point.
3. To delete the point B, click to select it and right-click to choose Delete in the context menu. Or you can
press Delete key to delete the selected point.
1934
Importing Data
9.4.3.1 Summary
The Enhanced Digitizer supports auto tracing and digitizing in 2D Cartesian, polar and ternary coordinate
systems.
NOTE: The Enhanced Digitizer is built into Origin 2015 SR0 and later versions. If you are running Origin 9.1,
the Enhanced Digitizer is available as an add-on tool from the OriginLab File Exchange. The Enhanced Digitizer
is not supported by versions prior to Origin 9.1 SR1.
9.4.3.3 Steps
1935
Tutorials for Origin
3. In the Digitizer dialog, there are hints at the bottom of the Axes tab to guide you through each step.
Before capturing data points, you need to setup axes on the image so that there is a reference for calculating
the XY coordinates of the data points that will be captured later.
Use the Zoom and Pan button on the Tools toolbar or hold down A and use the mouse wheel to zoom
in and pan the image. Then fine tune the line location. Press Ctrl+W to restore the original image size.
1936
Importing Data
1937
Tutorials for Origin
3. After editing Axes, you can right click and save Axes settings in order to load them in the future for similar
images.
Besides the Manually Pick Data Points method, the Enhanced Digitizer provides four automatic digitizing
methods to capture data points. They are all under the Digitize menu and have corresponding buttons.
Manually Pick Points Double click on every spot you want to capture a point.
Auto Trace Line By Double click on a curve on the image and data points will automatically
Points be captured along the curve.
1938
Importing Data
Drag a rectangle on a desired area of the image and data points will be
Auto Pick Points By
captured where ever the gridlines in rectangle intersect with the image
Grids
curve.
Boundary- Limited Similar to the Auto Trace Area button except that points are created only
Area Auto Trace within the selected area.
1939
Tutorials for Origin
If you want to move or delete a captured point,click the captured point in the image to select it. Use the
arrow keys on the keyboard to move the point or press the Delete key to delete it.
You can click the Manually Pick Points button again to pick more points for line 1.
Multiple digitizing methods can be used on same line as long as the line is highlighted on the Data tab of the
Digitizer dialog. Let's pick more red points for Line 1 using the Auto Trace Line by Points method.
1940
Importing Data
2. Double-click on red points to the left side of the peak and the right side of the peak. Every time you
double click a point, Origin auto traces to find more points along the curve. Click the Done button.
1941
Tutorials for Origin
Next let's use the Auto Pick by Grids method to digitize the black baseline.
2. Click the New Line button. The Data tab will start a new row for Line 2.
Note: All plots in this image use the same XY axis so we don't need to edit the axes again. However, in
case you have images with multiple axes, you can setup a new axis for each new line of data.
3. Select the Auto Pick Points by Grids button.
4. Click and drag to create a rectangle on a portion of the black baseline as shown below:
1942
Importing Data
Some points on the red and blue lines are captured as well.
1943
Tutorials for Origin
7. If you are not satisfied with the result, click the Delete Line button to delete Line 2 on the Data tab
of the Digitizer dialog and click the New Line button to start over.
You can use the Settings: Digitize Settings... menu to customize the grids density.
1944
Importing Data
Auto Trace method creates more points than just where the curve intersects with the grids.
6. Click the Reorder Points button to set the captured points in order.
10. To add another label on the peak of the digitized red line, click the Set Label button again to release it
first.
11. Select Line 1 to show digitized red points on the Image. Repeat the same process, this time set the label
as Red Peak.
1945
Tutorials for Origin
12. Select the Go To Data button. You can see the Labels added are in corresponding Label rows.
13. With the image window active, click the Go To Graph button.
All the curves resulting from the picked points will show in one graph window.
1946
Importing Data
14. You can save the project with the Digitizer in it. When you open the project in the future, there will be a
Digitizer... button on the image and you can click it to continue Digitizing.
The following section only explains how to define axes for images with polar or ternary coordinate systems
using the Enhanced Digitizer. Once the axes are defined the same methods outlined above can be used to
digitize the image.
1947
Tutorials for Origin
2. Browse to the <Origin EXE Folder>\Samples\Import and Export folder and select PolarCoordinate.bmp.
The data plots in this image are in the polar coordinate system.
3. By default the Digitzer uses the Cartesian Coordinate system. Select Axes:Polar Coordinate... menu to
open the Polar Coordinate Settings dialog box.
4. We can accept the default orientation and theta unit and click OK. Two line objects with anchor points
show on the image.
1948
Importing Data
To set the axes for polar coordinates, we need to make sure each line object follows the same radius line,
i.e. P1 & P2, or P3&P4 need to be at the same angle.
1949
Tutorials for Origin
5. Drag each line's anchor points to known positions. Note: You can press theSpace key to make the cursor
bigger so that it is easier to locate the desired position.
6. Enter the corresponding Theta and Radius values on the Axes tab of the Digitizer.
1950
Importing Data
4. Specify the Axes Orientation and Range of Variables (i.e. whether the ternary plot is normalized to 0 -
1 or 0 - 100). For this example, accept the default settings and click OK. Three anchor points are added to
the image.
5. Drag these three points to the three vertices of the ternary plot.
1951
Tutorials for Origin
6. Similarly to the polar coordinate anchor point control, the row of selected anchor points in the graph will
be highlighted on the Axes tab:
7. The Axes Values of each point are X Y Z respectively. The X, Y, Z values of P1 in the ternary image are
0 0 1 because P1 is at the end of the Z axis. Similarly P2 and P3 lie at the end of the X axis and the Y
axis, so the X,Y, Z values should be 1 0 0 and 0 1 0 respectively. Logically therefore, P1, P2 and P3 can't
be same values.
1952
10 Exporting and Presentation
10.1.1 Exporting
Exporting Graphs
10.1.2 Presentation
10.2 Exporting
10.2.1 Exporting
Exporting Graphs
10.2.2.1 Summary
When you have completed your graphs for publication, exporting your final results is very easy with Origin.
The graph export is highly customizable. You can specify the size of the image, the file format, and other
advanced settings such as color format.
1953
Tutorials for Origin
1. In the Project Explorer, browse to XYZ Contour folder, and make the graph window active.
2. With the graph window active, select File: Export Graphs from the Origin menu to open the expGraph
dialog.
3. Click the Auto Preview check box. Then the graph will auto preview the temporary copy in the right
panel of the dialog.
1954
Exporting and Presentation
1955
Tutorials for Origin
5. Click the triangle button to the right of the Dialog Theme. Select Save As from the shortcut menu. The
Theme Save as dialog opens.
6. In the Theme Save as dialog, enter My EPS Export as Theme Name. And click OK.
7. Click the OK button in the expGraph dialog, then My Graph.eps is created in your User File Folder. And
the graph path will display in the Message Log.
8. Repeat export a graph using the setting from above, select the theme My EPS Export in the fly-out menu
of the export graph tool directly.
Or
Click the right-sided triangle button to the right of the Dialog Theme in the expGraph dialog. From the
1956
Exporting and Presentation
shortcut menu, pick My EPS Export. The settings from that theme will then be loaded in the dialog.
3. Select Specified from the Select Graph(s) drop-down list. Click the button to the right of the Graph
Page edit box to open the Graph Browse dialog.
4. In the Graph Browse dialog, all the graphs in this project will list in the left panel of the dialog. Select
Graph8 in the left panel, then the preview panel will show a preview of the graph.
1957
Tutorials for Origin
5. Click the button to add the selected graph to the right panel, or double-click selected graph in left
panel to add to the right panel.
6. Then click OK button, the specified graphs will show in the Graph Page box.
1958
Exporting and Presentation
7. Expanding the Image Size node, select pixel from the Specify Size in drop-down list. And uncheck the
Auto check box for Fit Width and set width to 600.
8. Click OK button in the expGraph dialog, then two images are created. And the graph path will display in
the Message Log.
10.3 Presentation
10.3.1 Presentation
1959
Tutorials for Origin
10.3.2.1 Summary
The difference is that embedded graph is contained in the destination file while the linked graph is not. A
linked graph can be dynamically updated if the source graph is changed.
OLE embedding is not supported by Origin's Master Page feature. When exporting
graphs containing master items to MS Office or other documents, you should insert the
graph as an image. For more information, see Adding common elements to an MS
Word or PowerPoint file.
10.3.2.3 Steps
1960
Exporting and Presentation
1. Launch Origin, open the OffsetY.opj project from <Origin program folder>\Samples\Graphing\. This
project contains a graph (Graph 1).
Another menu option Copy Graph as Picture are also available. You can select it to insert the
graph into Word(or other applications) as a picture. Then, you are not allowed to edit it with
Origin anymore.
3. Create a blank page in Microsoft® Word(Here, I am using Word 2010). In the Home tab, select Paste
Special... under the Paste option.
1961
Tutorials for Origin
4. In the Paste Special dialog, select the Paste link radio button and then choose Origin Graph Object in
the As list. Click OK to close the dialog.
1962
Exporting and Presentation
6. This time, select the Paste radio button then choose Origin Graph Object in the As list. Click OK to
close the dialog. The graph will be pasted again, but as an embedded object.
7. Go back to the OffsetY.opj file in Origin, double click on the olive dot plot in Graph 1, bring up the Plot
Details dialog, change the symbol color to Violet and click OK to close the dialog.
8. Now switch to Word file we just created, right-click on the first graph(the linked one), and choose Update
Link from the fly-out menu. The color of the dot plot in this graph will be changed to violet.
9. Right-click on the second graph(the embedded one), and choose Graph Object: Edit to reopen the graph
in Origin. Note that the graph name is Graph in Document1, indicating that the graph is contained in the
1963
Tutorials for Origin
destination file.
10. In the Graph in Document1, change the color of olive dot plot to blue similar as previously, and close
Origin. Note that the linked graph and the embedded graph looks different now.
10.3.3.1 Summary
1964
Exporting and Presentation
This tutorial will show you how to send the specified graphs to an existing PowerPoint file by inserting graphs
from a specified slide on and also copy that slide style, logo, layout, etc. User will no longer need to set Slide
Master in PowerPoint.
10.3.3.3 Steps
This tutorial is associated with the Column and Bar project:<Origin EXE Folder>\Samples\Graphing\Column
and Bar.opju and the PPT file: <Origin EXE Folder>\Samples\Import and
Export\Column_Plots_in_Sample_OPJ.pptx
We are going to send most graphs in Column and Bar project to the above PPT file which consists of four
slides: 1st slide is title; 2nd slide is table of contents; 3rd slide is blank; 4th slide is End page. All the sent
graphs will be inserted into this PPT file starting from the 3rd slide and using the same style as starting slide.
2. Click the Send Graphs to Powerpoint button to open the pef_pptslide diallog.
3. Select Specified for the Select Graph(s) drop-down list, click the browse button beside the
Graph Page box to open the Graph Browser. In this dialog, select Active Folder(Recursive) for
the top-left drop-down list, and then select all graph listed in the left panel except Graph 5B, click
1965
Tutorials for Origin
4. Click OK button. All selected graphs will be listed in the Graph Page text box, you can reorder the
graphs. Expand the Slide Margin branch, set the Top Margin(%) text box to 8.
5. Select Top of Slide for the Title Line drop-down list and set Title Mode to Window Long Name.
6. Set Starting Slide Index to 3 to insert all these graphs to the existing PPT file by starting from the
3rd slide with same style as starting slide. Then set Slide Mode to Start New.
1966
Exporting and Presentation
7. Click the browse button beside the Load File/Template(Optional) box to locate the existing
PPT file Column_Plots_in_Sample_OPJ.pptx under the <Origin EXE Folder>\Samples\Import and
Export folder. Then specify the path to save the new PPT file in the Save File As(Optional) text box.
1967
11 Collaboration and Connectivity
11.1.1 Connectivity
11.1.1.1 Excel
11.2 Connectivity
11.2.1 Connectivity
11.2.1.1 Excel
11.2.2 Excel
11.2.2.1 Excel
11.2.2.2.1 Summary
Origin provides flexible ways to interact with Excel. You can either import Excel data into an Origin workbook,
or open an Excel book inside Origin. If you require full access to all of Origin's graphing and analysis features,
you will probably want to import your Excel data files into Origin. If it is important to maintain a separate Excel
workbook file—perhaps, so that other colleagues who do not work with Origin have access to that file—you will
probably want to open your Excel data files directly. We give a brief introduction to working with Excel in this
tutorial.
Save an Excel file with path relative to the Origin Project file.
1969
Tutorials for Origin
It may be desirable at times to simply copy+paste data from Excel to Origin instead of importing or opening
Excel. These steps show that such a copy-paste operation can bring in data with full precision.
3. Select columns B through L. Right click, bring up the Format Cells dialog, and set the number of
decimal places to 2. Now Excel will show fewer decimal places.
4. Click on the top left cell in the Excel sheet to select the entire sheet, right-click and select Copy, or
use the keyboard shortcut CTRL+C to copy.
1970
Collaboration and Connectivity
5. In a new book in Origin, place the cursor in row 1 of column 1 and press CTRL+V or right click and
Paste.
6. Note that the numbers come into Origin with full precision, not the number of displayed digits in
Excel. As shown in the example below, the number circled value is displayed with 2 decimal places in
Excel (0.35) but imported with all three decimal places into Origin (0.348).
7. In Origin, right click on the row 1 header and select Set as Comment to make this row an Origin
column comment.
1971
Tutorials for Origin
8. Right click on row 1 again and select Set as Long Name. This makes rows 1 and 2 in Excel the
worksheet header in Origin:
1972
Collaboration and Connectivity
9. You can now double click column 1, set it as Date, and plot the data.
1973
Tutorials for Origin
In Step 5, you can right click to choose Paste Link or press Ctrl+Alt+V instead of
choosing Paste or pressing Ctrl+V. As a result, you will create a DDE link between the
Excel data and Origin workbook. By this way, the linked data in Origin workbook will
change when the values in Excel are changed. You will learn more in this blog.
Origin supports importing Excel files directly into Origin workbooks. Multiple sheets are supported and controls
are available for setting specific rows in the Excel sheet to be brought into an Origin worksheet as header
information such as Long Name or Comments. If you want to perform analysis or data manipulation operations
on your Excel data, we recommend importing your data into Origin.
1. With a new book active in Origin, use the menu File: Import: Excel (XLS, XLSX, XLSM)....
2. Select the file <Origin Program Folder>\samples\graphing\Excel Data.xls and make sure the
Show Options Dialog is checked.
1974
Collaboration and Connectivity
3. In the dialog that comes up, leave the Use Excel COM Component to Import check box checked.
4. Set Index of Rows for Comments From to 1
5. Set Index of Rows for Long Name drop-down to 2 and click OK to Import.
1975
Tutorials for Origin
6. Click and select the Comments cell under column 1, hold the CTRL key and drag the bottom right
point of the selected cell to stretch across all columns with data, thus copying the same comments to
all columns.
1976
Collaboration and Connectivity
7. Press F4 to bring up the format dialog, switch to the Format tab, change the Apply To drop-down to
Comments and set Dynamic Merge to Horizontal. Click OK.
This merges the comments cells and shows the title in the center of all the data columns as shown
below:
1977
Tutorials for Origin
At times it may be desirable to keep the data in an external XLS file while opening the file inside Origin as an
Excel window and then working with the data. When you open Excel (.XLS or .XLSX) files as Excel workbooks
in Origin, an OLE instance of Microsoft Excel is launched. You can plot directly using Excel workbook data, but
many analysis features as well as 3D plotting are inaccessible.
1. Select File: Open Excel... and select the file \Samples\Graphing\Excel Data.xls.
2. A new Excel window opens inside the Origin workspace. When this window is active, the Origin main
menu has different entries, some of which are specific to Excel. The Excel toolbars are also available.
1978
Collaboration and Connectivity
3. Highlight the Excel data range A3:A26 and right click. Select Format Cells to make sure that the
data is Date format.
1979
Tutorials for Origin
4. Now select the Plot menu in Origin and select the Multi-Y: Double-Y plot type.
5. Select A3:A26 in the Excel sheet and click X in the Select Data for Plotting dialog to assign the X
data.
1980
Collaboration and Connectivity
6. Select B3:C26 in the Excel sheet and click Y in the Select Data for Plotting dialog to assign the Y
data. Select Multiple Layers from the Plot Into drop-down.
8. By default, Origin displays the tick labels for time on the X axis in MM/DD/YYYY format. Double-click
the X axis to open the Axis dialog. Select the Horizontal icon in Scale tab and change the scale
from 1/1/1970 to 1/1/2000.
1981
Tutorials for Origin
Select the Bottom icon in the Tick Labels tab and change the Display to year.
1982
Collaboration and Connectivity
Click OK to apply the settings and close the dialog. The graph should be resemble to the following
image:
1983
Tutorials for Origin
After opening Excel in Origin, switching to another Origin window, causes a toolbar
spacer to become visible where the Excel menu used to be. To remove it, right click and
select Hide Toolbar Spacer or Hide Toolbar Spacer Always.
The Origin Project can contain an Excel window which is linked to an external Excel file. In such a case it may
be beneficial to save the Excel file in the same folder as the Origin project, or a subfolder under the Origin
project folder. This will make the two files more portable, as seen in the following steps:
4. Right-click on the Excel window and select Save Workbook As. Save it in a (new) subfolder under
the OPJ save location, such as "C:\My Files\Data\My Data.xls".
5. Right click again on the Excel window title and select Properties. Check the box that says Relative
to current project (opj) path. Note that the Excel file path in the box below changes to a relative
path of "Data\My Data.xls".
1984
Collaboration and Connectivity
6. Save the OPJ again. Now you can copy the entire subfolder structure, starting from where the OPJ is
saved, and put it on an external memory device (i.e., a memory stick or similar), or zip the entire folder
structure. When taken to another computer and opened, Origin will look relative to the OPJ path to find
the Excel file.
If your Excel file is in a different location and you want to save it to the same path as
the OPJ, you can open the Excel file in Origin, then right click the title, select
Properties and click the Switch to OPJ path upon Saving button. On saving the
OPJ, the Excel file will be copied from its current location to the same path where OPJ is
saved.
1985
12 Programming
12.1 Programming
12.1.1 LabTalk
12.1.2 Origin C
12.1.3 X-Functions
Introduction to X-Functions
1987
Tutorials for Origin
12.2 LabTalk
12.2.1 LabTalk
12.2.2.1 Introduction
This tutorial will show you how to share code with other users by distributing OPX files. In this example, only
Origin C files are distributed. However, please note that OPX distribution can include any file types including
(but not limited to) project files, templates and toolbars.
12.2.2.2 Tutorial
The following procedure will show you how to distribute your Origin C code to other Origin users. In this
example, we will be packaging an Origin-C function in a file (MyCode.c) in a folder (MyFunctions) under the
User Files Folder (UFF).
2. The Source Path for your files should be available on any computer your OPX is targeted for. The
easiest way to do this is to make a subfolder of the Origin UFF. Any of the files and folders of the UFF
1988
Programming
can then be added to your OPX for distribution. So, create a subfolder named MyFunctions under the
UFF.
4. Copy all the files to be packaged to the subfolder created in the last step. Here there is only a C file
(MyCode.c). The function in this file is shown below.
void get_data_from_wks()
if( !wks )
return;
1989
Tutorials for Origin
DataRange dr;
matrix mData;
vector vOneCol;
mData.GetColumn(vOneCol, nColIndex);
vOneCol.GetMinMax(min, max);
1990
Programming
5. Create a Package
6. Open the Package Manager by selecting Tools: Package Manager.... Then fill in the dialog as the
following image shows.
o The Module Name will appear as the name of the package for uninstall purposes.
o Origin Version Required means the minimum version of Origin required for this package. You
want to enter the version number like 8.0988, and not like 8.0SR6.
o To force the Origin C source file to the System Folder Workspace, use the run.addoc() method in
the After Installation branch of LabTalk Script. In this example, it looks like the following:
run.addoc(%YMyFunctions\MyCode.c);
1991
Tutorials for Origin
o Click the Add Files or the Add Folder button and browse to and add any files required. In this
example, browse to the subfolder (MyFunctions) under the UFF and add the C file (MyCode.c).
Then the path of the UFF will show as the source path, and the files will list in the lower panel.
7. Save the Package
8. Select the File: Save menu of this Package Manager dialog. In the pop-up Save As dialog, enter a
name (in this example, can be MyCode) for this package, and then save it as an OPX file.
10. Send the saved OPX file to other users. The user who gets this package can drag and drop the OPX
onto Origin to install it, and then the functions in the C file are available.
o Drag and drop MyCode.opx onto Origin to install it. After installation, the function
get_data_from_wks defined in MyCode.c can be used as a LabTalk command.
get_data_from_wks;
12.3 Origin C
12.3.1 Origin C
12.3.2.1 Summary
Origin C supports a nearly-complete ANSI C language syntax as well as a subset of C++ features including
internal and DLL-extended classes. In addition, Origin C is "Origin aware". This means that Origin objects such
as worksheets and graphs are mapped to classes in Origin C, allowing direct manipulation of these objects and
their properties from Origin C.
Origin C's integrated development environment (IDE) is called Code Builder. Code Builder provides standard
tools for writing, compiling, and debugging your Origin C programs. Once an Origin C function is compiled and
linked, the function can be called in various ways from the Origin or Code Builder workspaces.
1992
Programming
To open Code Builder, click the button on the Origin Standard toolbar, or press ALT + 4 from the
keyboard.
12.3.2.3 Steps
1. In Code Builder, start with a new workspace (File: New Workspace...). On the Code Builder Standard
toolbar, click the New button to open the New File dialog.
2. Select C File to create a .c file. Type Tutorial in the File Name text box. In the Location text box,
specify the User Files Folder/OriginC folder to save your source file. Make sure that the Add to
Workspace box is checked. Click OK. A file named Tutorial.c is created and opened in the Code
Builder workspace.
4. Copy and paste the following code beneath the line that reads "// start your functions here.":
1993
Tutorials for Origin
void new_wks()
Worksheet wks;
vecY.Data(0.1, 1, 0.1);
vector<string> vsLongName =
"Index",
"Data"
};
1994
Programming
col.SetLongName(vsLongName[nCol]);
This new_wks function will create a worksheet using the Origin template. It fills the first column with
numbers from 1 to 10, incrementing by 1. The second column is filled with numbers from 0.1 to 1,
incrementing by 0.1. Lastly, it sets the Long Names of the first and second columns as Index and
Data, respectively.
Prss SHIFT + ALT + O or select Tools: Quick Open Files to open the Quick Open Files dialog.
When open a .h file, press CTRL + ALT + O to open the corresponding .c or .cpp file, and vice
versa.
Find symbols
Press SHIFT + ALT + S or select Tools: Find Symbols to open the Find Symbols dialog.
1995
Tutorials for Origin
1. On the Code Builder Standard toolbar, click the Build button . This compiles the new_wks
function and performs linking (Please make sure the Tutorial.c file is active).
2. Click the space just to the left of lines 34, 35, 37, 50. A red ball icon will be placed at the beginning of
each line, indicating that you added breakpoints to these lines. These breakpoints are listed in the
Breakpoints window.
3. In the Breakpoints window, clear the box before tutorial.c, line 35 to disable this breakpoint. Note that
the breakpoint icon before line 35 becomes a hollow circle icon.
To delete a breakpoint, you can click on the breakpoint icon before the corresponding
line, or right-click on the breakpoint in the Breakpoints window, and select Delete
Breakpoint.
4. Right-click on the breakpoint of line 37. Select When Hit... to open a dialog. Check the box before
Print a message. In the text box under Print a message:, append the text test code runs to
here. . Click OK to finish. Note that this breakpoint's icon is now a diamond.
1996
Programming
5. Right click on the breakpoint at line 50. Select Condition... to open a dialog. Enable Condition and
type nCol==1 in the text box. Click OK.
6. To run this code, type the function name new_wks in the upper panel of the LabTalk Console window.
7. Press ENTER. A yellow arrow will appear upon the first breakpoint icon, indicating which line of code is
executed to.
8. Press F8 to continue debugging the code. You will see the yellow arrow icon moving to the line 50.
9. In the Command & Results window, the message added in the breakpoint of line 37 is printed in the
lower panel.
1997
Tutorials for Origin
10. Activate the Variables window. The variable names are listed in the first column and their values are
listed in the second column. Check the value of nCol.
11. Press F5 to run over all codes, the yellow arrow will disappear.
12. Return to the Origin workspace. You can see that a workbook is created as in the following image.
1998
Programming
1. Hold the CTRL + SHIFT keys and click the Custom Routine button . It will open the Custom.ogs file in
Code Builder.
2. With the cursor at line 11, click the Comment button to comment out line 11.
new_wks();
This code will load the Tutorial.c file we added in the previous section and run the new_wks()
function.
5. Return to the Origin workspace. Click the Custom Routine button . A new worksheet will be
created and filled with data as it was in the previous section.
1999
Tutorials for Origin
12.3.3.1 Summary
In this tutorial, we will create a workspace in the Code Builder of Origin, add a source file with a new function,
then build, test and save the workspace file. Also, we will configure the appearance of the Code Builder.
Build on Startup
A workspace is a collection of files that can be opened by a single menu option (File: Open Workspace...) in
Origin's Code Builder. Any text file can be a part of the collection. They do not necessarily have to be source
code files; they could be notes, for example.
All files opened in the Multiple Document Window by a workspace can be edited and saved individually. In
addition to files being opened in the Multiple Document Window, source code files can be added to the
Workspace Window with the File: Add to Workspace menu option.
2000
Programming
By including source code files in the Workspace Window, you can build individual or multiple files with the
appropriate menu option or toolbar button. Header files can be referenced within source files and do not need
to be loaded in the Workspace Window or even open in the Multiple Document Window.
Since you can save a workspace with a new name, you can have multiple workspace files. However, only one
workspace file can be opened at a time.
To create a workspace:
void bar()
printf("Hello World!\n");
6. Click the Build button (or use the hotkey Shift+F8). Origin automatically saves the source file and
compiles and links the function.
bar
9. Press ENTER
10. From the Code Builder menu, choose File: Save Workspace As....
2001
Tutorials for Origin
The figure shows the foo.ocw workspace file containing a single source file, foo.c, in the Multiple Document
Window. The file has been added to the Workspace Window. The Output Window shows that the file has been
compiled. The source file contains a single function "bar( )" which is listed in the tree structure of the
workspace.
The Code Builder workspace has six subfolders: Apps, Project, System, Temporary, User [AutoLoad] and User.
Files added by user, such as foo.c that you just added, are placed in the User subfolder. Origin, itself, uses
Origin C for many analysis routines. When these routines are accessed, the Origin C source files are loaded
into either the System subfolder or the Temporary subfolder in the Workspace. The Project subfolder is
reserved for files that are saved and loaded with the Origin project. This aspect of attaching a file to the
project is described in a separate tutorial.
If you right click on the Origin C Workspace folder, the shortcut menu has a Build on Startup option. When
this option is checked, the last workspace you saved will be loaded when you restart Origin. All source files in
the Workspace will be built and all functions in the source files will be available for immediate use.
For information on building individual source files on startup by including information in the ORIGIN.INI file,
please view Build on Startup
2002
Programming
User can configure code builder interface including the fonts and colors, the brackets color, the icons size and
so on.
1. Open Options dialog in Code Builder by select Tools: Options in main menu. Go to the Fonts and
Colors tab, change the Theme to Dark. An interface with dark background and light font is obtained.
You can further adjust the font size or type in this dialog.
2. In Options dialog, go to the (Text Editor) General tab, change the properties for Enable Multiple
Colored Brackets to True and click OK. The nested "()" in code will be shown in multiple colors.
2003
Tutorials for Origin
3. Open Customize dialog in Origin's main interface by select View: Toolbars in main menu. Go to the
Options tab and check on Use Large Icons box, then you can get large icons for buttons in Toolbars
(note that this setting may not work well on your system depending on your display settings). Close
the Customize dialog box.
2004
Programming
4. You can control the show or hide of each panel by selecting or unselecting them from View in Code
Builder menu, the selected panel will be shown in Code Builder.
To create an App package, you need to combine the use of Apps folder in Code Builder workspace and the
Package Manager. Following steps will show you how to create the package for an App.
1.On the Standard toolbar, click the Code Builder button to open Code Builder.
2005
Tutorials for Origin
2.Make sure Workspace window is open, if not you can select menu View: Workspace to open it. Right click
on the Apps folder in Origin C Workspace and select New to add a new folder.
3.Right click on the newly added folder Untitled and select Rename to name the folder as "MyApp".
4.Right click on MyApp folder and select Add Files... to open Add Files to Workspace dialog. Browse to
select all prepared files and click Open button to add them to current folder.
5. Right click MyApp folder to select Generate and you will be directed to the Package Manager.
2006
Programming
6.You can find the added files in the lower panel of Package Manager. Now you can input some basic
information about MyApp under Package node as shown below. To make the App display as an icon in App
Gallery, you need to prepare a 32*32 (in pixels) bmp image and input its name with extension in Icon edit
box. Then you can input some LabTalk script in Launch Script field to tell Origin what to do when launching
the App.
2007
Tutorials for Origin
7.Select File: Save to save the package as an OPX file. Later you can drag and drop this OPX file into Origin
workspace to install this App.
The Hotkey in Code Builder make the coding work efficiency. The following parts introduce the useful hotkey
one by one.
Firstly, please download this zip file, extract it and then browse to the \Origin C Examples\Programming
Guide\Practical Examples subfolder to add AccessMatrix. c by right-clicking the user folder and select "Add
Files"
Ctrl+F2 and F2
Ctrl+F2 add a Toggle Bookmark at the specific line. You can use hotkey F2 to go to next Toggle Bookmark.
Ctrl+F3 and F3
Ctrl+F3 highlight all the select word ("MatData") in code. You can use hotkey F3 to go to the next highlighted
"MatData".
2008
Programming
Ctrl+]
F9
This hotkey Ctrl+/ comment the selected lines, while Ctrl + Shift + / uncomment them.
Ctrl+Alt+O
After constructing the *.c and *.h files with the same name, you can use hotkey Ctrl+Alt+O to switch
between them.
2009
Tutorials for Origin
12.3.4.1 Summary
Functions written in Origin C are accessible from various locations within the Origin interface, such as the
Script Window, provided they meet the following criteria: the function should return either void (as in the
previous tutorial), double, string, or vectors of type double or string. Variables passed to the function from
Origin should be of type double or string, or vectors of these types. Functions that do not meet these criteria
are not callable from the Origin interface, but can be called within other Origin C functions. Note that although
an Origin C function that accepts and returns type int can be called from the Origin interface, the data may be
truncated since the interface only supports type double.
In this tutorial, you will be introduced to writing a math function that returns computed values. We will first
create a function that returns type double to Origin, and then we will create a function that returns vectors of
type double.
How to add a new function and how to run this function in the Script Window.
12.3.4.3 Steps
return sin( a * x );
2010
Programming
This function can now be called from the Origin interface, in places such as the Script Window.
4. Go to the Script Window, and type in the following lines, pressing ENTER at the end of each line:
y = myfunc1(2, 3)
y =
5. Make a worksheet active, enter a number in the first row of column A. Then type the following into the
Script Window and press ENTER:
col(B)[1] = myfunc1(col(A)[1], 3)
Note that a function such as myfunc1, that accepts and returns type double, can also be used to perform
vector operations.
6. Fill rows 1 through 10 of Column A with numbers, and type the following into the Script Window:
col(B) = myfunc1(col(A), 3)
In the above example, Origin calls the myfunc1 function for each row of column A. For performing vector
operations as above, it is more efficient to write functions that accept and return vectors.
7. Go back to Code Builder and add the following function to the same file, and compile the file by clicking
vector<double> vecOut;
2011
Tutorials for Origin
return vecOut;
8. Go back to the Origin interface, fill Column A with some new numbers, and type the following into the
Script Window:
col(B) = myfunc2(col(A), 3)
The function myfunc2 is called only once for computing the entire column.
Note that you can use such functions in other places such as the "Set Column Values" dialog. The Auto Update
feature of "Set Column Values" can be enabled by checking the appropriate check box in this dialog. As long as
the Origin C function is compiled and ready to be called from Origin, any changes to the source column will
result in an update of the destination column.
12.3.5.1 Summary
One way to load and compile your Origin C function is to save the Origin C file as an attachment to your Origin
Project (*.OPJ) file. When a project file is opened, all files attached to it are separated out and stored in a
temporary folder. In addition, any Origin C file that was attached is also automatically loaded into the Code
Builder workspace, and compiled. The function is then ready to be called upon opening the Origin Project file.
1. Start a new Origin project file by clicking on the New Project button on the Standard Toolbar.
2012
Programming
5. In the File Name text box, type: Test. Keep the Add to Workspace check box selected. Click OK. The
file Test.c is added to the workspace.
6. Select and copy the following function, and paste it into the Test.c file. Be sure to paste the text below the
line that reads "//start your functions here."
GraphPage gp;
if( !bOK )
return;
GraphLayer gl = gp.Layers(0);
Curve crv(strData);
if(nPlot >= 0)
2013
Tutorials for Origin
gl.DataPlots(nPlot).SetColor(2, TRUE);
gl.Rescale();
The Plot_Data function takes two arguments: (1) the template name and (2) the name of a Y dataset to
include (plot) in the layer.
8. Drag-and-drop the file Test.c from the User subfolder branch of the Workspace tree, to the Project
subfolder. (Hint: You may need to first expand the User subfolder branch to display the Test.c entry prior
to dragging the file).
9. Go back to the Origin interface and save the project by clicking the Save button on the Standard
Toolbar. Give the project the name Test.OPJ, and save it in a location of your choosing.
10. The Origin C file, Test.c, is now saved with the Project. To verify this, close the project, and go back to
Code Builder. You will see that there are no entries under the Project subfolder of the Workspace tree.
Now go back to Origin interface and reopen the project. Go to Code builder and verify that Test.c is now
listed under the Project subfolder (Hint: you may need to expand the Project subfolder branch to see the
Test.c entry).
You will now learn how to create a button on a worksheet and program the button to call the Origin C function
in the Test.c file that you saved with the project.
1. Open the Test.OPJ project that you saved under step 9 (previous section).
2. Highlight the A(X) and B(Y) columns, right-click and select Fill Columns With: Row Numbers.
3. From the menu, select Format: Worksheet to open the Worksheet Properties dialog box.
4. In the Size tab, Worksheet Measurement branch, set the Gap from Top to 40 and click OK to close
the dialog.
2014
Programming
The worksheet now has sufficient space above the column headings to add a text label.
Right-click in the area directly above the two columns and choose Add Text.
7. Right-click on the text label and choose Programming Control to open the Programming Control
dialog box. (Hint: Please choose Label Control in Origin 7.5)
8. From the Script, Run After drop-down list, choose Button Up.
9. Type the following script in the text box at the bottom of the dialog box:
Plot_Data("scatter","book1_b");
2015
Tutorials for Origin
12. The Plot_Data function in your Test.c file is called, and a scatter plot is created.
Notes: The script behind the button assumes that you have data in column B(Y) of the Data1 worksheet
and that there is an associated X data set.
In this tutorial we learned how to save an Origin C function along with the project file and then access the
function from the Origin interface. Saving an Origin C file with a project limits access to functions within that
file to only that project. When a new project is opened, the functions are not available any more.
To access functions in an Origin C file that is saved on disk, the file can be programmatically loaded and
compiled using LabTalk script. The script command for performing the programmatic load and compile is
run.LoadOC. Refer to the LabTalk Help files (Help: Programming: Labtalk) for more information on using
this command.
12.3.6.1 Summary
Origin/OriginPro includes the complete NAG Mark 9 numerical library. This library provides multiple method for
numerical integration. All functions are accessible from Origin C. In this tutorial, you will call NAG functions to
perform the double integration. Note that an infinite NAG integrator is used here.
2016
Programming
To calculate the double integration. You need to call function in NAG library category D01 Quadrature. This
category provides functions for the numerical evaluation of definite integrals in one or more dimensions. Two
functions with different algorithm are available for double integral, which is nag_multid_quad_adapt_1 and
nag_multid_quad_monte_carlo_1. In this tutorial, you will learn to use them to solve the integral formula
below:
You are recommended to read the relevant tutorial Calling NAG Functions From Origin C, to study how to run
and test the code below for calculation. Then you can copy and pase the code into new created .c file in Code
Builder and run the compile and build process. Below is the Origin C code with comments:
#include <Origin.h>
#include <OC_nag.h>
int multid_quad_monte_carlo()
2017
Tutorials for Origin
NagError fail;
Nag_MCMethod method;
Nag_Start cont;
Nag_User comm;
comm_arr=NULL;
printf("Invalid ndim.\n");
exit_status = -1;
return exit_status;
method = Nag_ManyIterations;
2018
Programming
cont = Nag_Cold;
/* nag_multid_quad_monte_carlo_1 (d01xbc).
* thread-safe
*/
if (fail.code == NE_QUAD_MAX_INTEGRAND_EVAL){
exit_status = 2;
else{
2019
Tutorials for Origin
exit_status = 1;
if (comm_arr)
NAG_FREE(comm_arr);
return exit_status;
Then you can call the functions in LabTalk Console. The results will be like this:
#include <OC_nag.h>
#include <Origin.h>
2020
Programming
int multid_quad_adapt()
Integer exit_status = 0;
Integer k;
double finval;
Integer minpts;
Nag_User comm;
NagError fail;
2021
Tutorials for Origin
eps = 0.001;
minpts = 0;
exit_status = 1;
return exit_status;
return 0;
Then you can call the functions in LabTalk Console. The results will be like this:
2022
Programming
12.3.7.1 Summary
Calling a NAG function from an Origin C function is very much like calling any other Origin C function. You
must familiarize yourself with the desired NAG function to gain an understanding of what parameters the
function requires to be passed as arguments and what parameters the function returns. Once familiar with the
function, you must develop code that follows the function's requirements.
The NAG header file containing the function's prototype must be included, required parameters must be
correctly declared, sized, and initialized, and the function call must follow the function's prototype as described
in header file. The objective of this tutorial is to demonstrate how to call a NAG function from an Origin C
function.
The primary resource for understanding NAG functions is NAG library. The library also can be found in Origin C
Reference. For example, d01sjc NAG function:
1. From the Origin menu select Help:Programming:OriginC. In the Origin C Reference book, expand the
Global Functions book, expand the NAG Functions book, and choose Accessing NAG Functions Category
and Help.
2. Select Quadrature (d01) category and then select nag_1d_quad_gen_1 (d01sjc) function.
3. The selected page is one PDF file. Study the nag_1d_quad_gen_1 function as needed to understand the
description of the function, the function's prototype, and the description of all arguments. Sample data
and an example program calling the function are also often included.
Secondary resource for understanding the Origin C NAG functions is Examples book. From the Origin menu
select Help:Programming:OriginC, expand Examples book, expand Analysis book, choose Accessing NAG
Functions, there are some examples to show how to call NAG functions in Origin C.
2023
Tutorials for Origin
The best way to understand how to write an Origin C function that calls a NAG function is to step through an
example function in Debug mode. Follow the steps below to set up Origin and Code Builder to execute such a
sample Origin C function in Debug mode.
1. From the Code Builder menu, select File: New. This opens the New File dialog box.
2. In the File Name text box, type: TestNAG, Keep Add to Workspace checkbox is checked. Click OK.
The file TestNAG.c is added to the workspace.
3. Select and copy the following function, and paste it into the TestNAG.c file. Be sure to paste the text
below the line that reads "// Include your own header files here."
#include <OC_nag.h>
//NAG_CALL denotes proper calling convention. You may treat it like a function
pointer
return (x*sin(x*30.0)/sqrt(1.0-x*x/(PI*PI*4.0)));
void nag_d01sjc_ex()
2024
Programming
double a = 0.0;
// you may use epsabs and epsrel and this quantity to enhance your desired
precision
epsabs = 0.0;
epsrel = 0.0001;
Nag_QuadProgress qp;
NagError fail;
Nag_User comm;
comm.p = (Pointer)&use_comm;
2025
Tutorials for Origin
// For the error other than the following three errors which are due to bad
input parameters
// You will need to free the memory allocation before calling the
integration routine again to
NAG_FREE(qp.sub_int_beg_pts);
NAG_FREE(qp.sub_int_end_pts);
NAG_FREE(qp.sub_int_result);
NAG_FREE(qp.sub_int_error);
printf("%10.6f", result);
2026
Programming
#include <OC_nag.h>
This header file containing all the header files of NAG functions, and all type define and error code define. So
just include this one function should be enough.
1. Acivate TestNAG.c file that created in above section, move scoll bar to find out #include <OC_nag.h> line.
2. Right click anywhere in the line and select Open "OC_nag.h". This opens the NAG header file.
3. Move scoll bar to find out #include <NAG_MARK25\oc_nag_all.h> line, and also right click to select Open
"NAG_MARK25\oc_nag_all.h". This opens the header file containing all nag headers at Mark25.
4. In the Search combo box type nagd01.h and press ENTER button to
find out this line. Function d01sjc belongs to d01 category, so the header file name should be nagd01.h.
5. Right click anywhere of this line to choose Open "nagd01.h". This opens the header file including the
prototype of the functions.
6. In the Search combo box, type d01sjc and press ENTER button to go to the declaration of this function.
1. Reactivate the TestNAG.c window in Code Builder. In this file, the NagError variable fail is defined and
passed as last argument to function d01sjc.
2. NAG function returns error code into NagError variable code item. In this example, can access NAG error
code by fail.code.
3. Open Origin C Help from Origin menu Help: Programming: OriginC, expand Origin C Reference book,
Global Functions book, NAG Functions book and choose Accessing NAG Functions Category and Help.
4. In Chapters of NAG C Library table, choose d01 to enter Quadrature page, select d01sjc in the table of
this category to open the PDF help of this NAG function.
5. Drag scall bar to page down to 6 Error Indicators and Warnings part, there list all error codes for this
function and the related description. Can directly use these error codes in Origin C if included correct
header file (include <OC_nag.h>, this header containing all NAG headers), for example NE_INT_ARG_LT,
NE_BAD_PARAM, NE_ALLOC_FAIL used in TestNAG.c file.
2027
Tutorials for Origin
3. Double-click NAG_D01SJC_FUN to high-light it. From menu choose Edit: Find in Files to open Find
in Files dialog. Set settings same as the following picture, click Find button.
4. Searching result display in Output window. Double click nag_types.h line to go to this file, typedef
NAG_D01_TS_FUN NAG_D01SJC_FUN line, you can find the define of NAG_D01_TS_FUN nearby.
5. The define of NAG_D01_TS_FUN is
User defined function should keep the same return type and argument list as this define. And NAG_CALL
denotes proper calling convention and it should be used in your own function.
6. Activate TestNAG.c file. There is a function named f_callback_ex and it used as function pointer in
d01sjc as the first argument.
return (x*sin(x*30.0)/sqrt(1.0-x*x/(PI*PI*4.0)));
2028
Programming
12.3.8.1 Summary
Internal Origin objects (such as Project Explorer folders, Origin windows (pages), layers, plots, graphic objects,
data sets, etc.) are accessed using Origin C classes. To access or programmatically control an internal Origin
object, you must attach it to an Origin C object.
To attach something to an internal Origin object you must first "find" it using the properties, methods, and
collections of a container class. Common container classes include the Project, Folder, Page, GraphPage, Layer,
GraphLayer, Worksheet, MatrixLayer, and Collection classes. Once found, an internal Origin object can easily
be attached to an Origin C object of the appropriate type.
The internal Origin object is then programmatically controlled by manipulating the class methods and
properties of the attached Origin C object. The objective of this tutorial is to demonstrate how to find particular
internal Origin objects, attach things to those objects, and access the objects by manipulating the methods
and properties of the attached Origin C objects.
Familiarity with the Origin C Project class (Project.h), the Collection class (Collection.h), and the Folder class
(Folder.h), is valuable when attempting to understand how to find particular internal Origin Objects. Users may
find it helpful to preview these classes in the Origin C Reference: Classes book of Origin C Help or in the
above header files located in the ..\Origin\OriginC\system subfolder.
7. On the Code Builder toolbar, click the Rebuild All button . This compiles and links the file.
8. On the Code Builder View menu, verify that the LabTalk Console (Command & Results) and the Local
Variables windows are visible (the corresponding menu items should be checked).
2029
Tutorials for Origin
9. From the Code Builder menu, select Tools: Customize. Select the Toolbars tab and make sure that the
Debug toolbar check box is selected.
10. In Code Builder, activate AccessWorksheetObjectsTutorial.c.
11. Near the top of the file, locate and click on the line:
PageBase pb;
11. From the Code Builder menu, select Debug: Toggle Breakpoints. Alternately, press F9 or click the
A brown circle is displayed in the gray margin to the left of the above line indicating that a Debug breakpoint
has been set for that line.
12. In the Code Builder workspace, activate the LabTalk Console (Command & Results window) and type in
the following:
AccessWorksheetObjectsTutorial
15. Press the Step Into button repeatedly, stopping to read the comments for each statement.
Periodically stop and resize and/or reposition the Local Variables window to view the current run-time
value of each variable.
2030
Programming
1. Return to the Origin workspace and, on the Standard toolbar, click the Open button .
2. Locate the unzipped folder you created at step 1 of above section in this page. Browse to the \Origin C
Examples\Programming Guide\Introduction to Accessing Origin Objects subfolder, select
AccessGraphObjectsTutorial.OPJ, and click Open. You may be prompted to save changes to an untitled
project. Click No and a worksheet and graph should open.
3. From the Code Builder menu, select File: New Workspace. Click No when prompted to save workspace
changes.
6. Click the Rebuild All button to compile and link the file.
7. On the Code Builder View menu, verify that the LabTalk Console (Command & Results) and the Local
Variables windows are visible (the corresponding menu items should be checked).
2031
Tutorials for Origin
8. From the Code Builder menu, select Tools: Customize. Select the Toolbars tab and make sure that the
Debug toolbar check box is selected.
9. In the Code Builder workspace, activate AccessGraphObjectsTutorial.c.
10. Near the top of the file locate and click on the line:
GraphPage gp;
11. From the Code Builder menu, select Debug: Toggle Breakpoints. Alternately, press F9 or click the
A brown circle is displayed in the gray margin to the left of the above line indicating that a Debug breakpoint
has been set for that line.
12. Activate the LabTalk Console (Command & Results window) in Code Builder and type the following:
AccessGraphObjectsTutorial
15. Press the Step Into button repeatedly, stopping to read the comments for each statement.
Periodically stop and resize and/or reposition the Local Variables window to view the current run-time
value of each variable.
12.3.9.1 Summary
Apps are custom applications for Origin that perform specific graphing and/or analysis tasks. Origin users can
browse for Apps and download and install them from the File Exchange area of the OriginLab website. Origin
users can also create Apps and share with other on File Exchange. This tutorial provides the guidelines for
making an App and detailed steps to build, upload and modify an App.
Build an App
2032
Programming
Icon files
This should be a png file with size of 32*32 in pixels. This icon will be displayed in the Apps
Gallery window in Origin.
This should be a bmp file with size of 16*16 in pixels, and 16 color (4 Bits). It will be available
from View: Toolbars: Apps button group in Origin. It can be used as a button, by adding to a
toolbar.
Programming files
X-Function, *.ogs, *.c, *.h and DLL files are supported. Note that X-Function file name should not be the same
as *.c file name if both exist.
Other files
Any other files such as documentation (*.chm, *.pdf), image files, sample data, etc, can be included.
1. Locate the Apps folder under the AppData area of your Origin installation. You can enter the following
command in Command/Script Window to locate this folder:
2. Open the folder in the path found in step1, create a subfolder in this location. Note that the subfolder name
will be used as your App name. Place all your files for the App in this subfolder.
3. Start Origin and click Code Builder button in Origin main interface.
4. In Code Builder window, right click on the Apps folder in the left Workspace panel. Select Add Existing
Folder from the shortcut menu and browse to add the folder created in step 2. Expand the folder in
Workspace panel. All files in the folder will be listed.
Note that if you have no existing App folder, you can choose New from the shortcut menu to create a new
sub-folder in Apps folder. If you right click on a file, you can choose to remove the file. Right click on the
folder, and you can add more files, even files not located in current folder.
2033
Tutorials for Origin
5. Right click on the newly created App folder in Code Builder's Workspace panel, and choose Generate from
the shortcut menu. It will open the Package Manager dialog.
Package branch:
Name
Do not change the Name field, otherwise the folder name will also be changed.
Description
Input descriptions of the App in this field. The desciptions will be shown in the file exchange web's
Summary section.
Version
Set current App version. You can use two decimal digits, e.g. 1.11.
2034
Programming
Set the required Origin version. For Origin 2016, you should type 9.3 instead of 2016.
App branch:
Icon
Icon (Small)
Launch Script
LabTalk script to run after you click the App icon. If you want to open an X-Function dialog, you can
write your script such as: xfname -d; You can also have your script point to a section in ogs file, and
run that section, e.g. run.section(%Afoldername\ogsname,sectionname).
Enable by Window
Specify the active window type(s) for which the App should be enabled. e.g. for Latex App, Graph
window should be active.
Specify LabTalk script for before, after installation and before uninstalling.
2035
Tutorials for Origin
7. When settings are done in Package Manager, click File: Save from the menu. The .opx file will be saved.
The opx name can be different from the folder name. The opx file for an App is ready now. You can simply
drag-and-drop the file onto Origin to install. Note that you may need to run Origin not as administrator to be
able to drop the file onto Origin.
When the App package file is ready, you can upload it to File Exchange website to share with the public. To do
it, follow the steps below:
1. Go to File Exchange Website, click Submit a file on the bottom right to open Submit File page. Select
File Type as App and fill in other needed information, File Category, Created using Origin:, etc. Note
the information contained in the App package will be automatically extracted, such as, Minimum Origin
Version Required, Title, Summary.
2. Upload the App OPX package file, screenshot image, click Submit button to submit your App and create a
File Exchange tool page for it.
3. You can then download the OPX file from the web page you have created, and drag-and-drop onto Origin
to test it. A package ID will be assigned to the opx during the download process.
2036
Programming
4. You can continue editing the web page for your App. Once finished, you can click Update button to
update the web page.
5. When you are ready to publish your App, press the Request Approval button on the botton of Update
form. You will be notified by OriginLab through email when your App has been approved. The approval
status is also shown on the Update File page as indicated by OriginLab Tested, OriginLab Approved
checkboxes.
6. Once your App got approved, it will be automatically shown on the Tools: Apps on file Exchange menu
list.
1. Select Tools: Package Manager from Origin menu. Select Tools: Browse Installed Package in
Package Manager dialog's menu. Select the App and click Open button.
2. You can change the settings in the dialog. If your files in the folder are modified, you can click Repack
Files button.
3. Click File: Save to save the App OPX package.
When you need to add files, remove files or change file names in App folder, you can perform these operations
by right clicking on the App folder in the Workspace panel on Code Builder and selecting corresponding
option from the shortcut menu. When done, click Generate from the shortcut menu to regenerate the App
package.
Note that when removing files or changing file names, original files should be kept in the App folder under path
C:\Users\XXX\AppData\Local\OriginLab\Apps\ even if they are not being used, otherwise old settings in the
opx will not be kept in Package Manager dialog when you click Generate button.
Log in Origin website, go to the File Exchange page you have created for your App and upload the updated
OPX file to the File Exchange page. Update the web page as needed, including notes on what has been
updated in current App version. Users would know this update from menu Tools: Apps on File Exchange: *
YourApp (installed) as indicated by the asterisk symbol * if this App was previously installed.
Click the Request Approval button in the File Exchange webpage of your App and wait for OriginLab to notify
you.
12.4 X-Functions
12.4.1 X-Functions
2037
Tutorials for Origin
12.4.2.1 Summary
Many of Origin's analysis tools and other data processing tools have been implemented using X-Functions. The
Command Window provides a convenient way to run these functions.
Another important use for the Command Window is to send LabTalk script commands to Origin. Script
commands can range from simple math and data operations, to user-created X-Functions or Origin C
functions.
This tutorial will introduce you to the Command Window and show you how to:
Access X-Functions
The Command Window consists of two panels: the Command Panel and History Panel:
The Command Window is normally located at the bottom right corner of the screen, but if it is not visible, you
can access it by pressing Alt+3 or by selecting View: Command Window.
When typing in the Command Panel, the Auto Complete support allows you to choose among X-Function script
commands and OGS files in the current working folder. The command and OGS file name will be respectively
preceded by Xf and LT. You can move up and down the list using the arrow keys; pressing Enter selects the
item. After your selection, press the space bar and the Auto Complete now shows you the available options for
the command.
12.4.2.4 Examples
The Command Window can be used as a calculator or to access any of Origin's mathematical functions. See
the examples below.
2038
Programming
One of the more basic uses for the Command Window is as an interface to perform simple calculations. For
example, type the following:
2+2=
2+2=4
If you are typing multiple lines of scripts, first edit it in Code Builder (View:Code Builder) or any text editor,
such as Windows Notepad, ending each line with a semi-colon, and then Copy + Paste the script in the
Command Window, and press ENTER to execute. For example, paste the following script in the Command
Window and ENTER:
sum = 0;
loop(ii, 1, 10)
sum += ii;
sum = ;
Origin returns:
SUM=55
2039
Tutorials for Origin
12.4.2.4.1.3 Functions
Any mathematical function, built-in as well as user-created, can be executed from the Command Window. For
example, type:
ln(10) =
You can also use the Script Window to read and write worksheet values, or to perform math operations on
datasets.
2. To return the value in the first cell of the second column, type the following:
2040
Programming
cell(1,2)=
You can also use the column name and row number to reference cell values.
Notes: In addition to using the column name, you can also use the dataset name. In LabTalk, the syntax
for naming datasets is worksheetName_columnName. So, For example, Book1_A[1]= would return the first
element of column A in worksheet Data1. Also, if the worksheet that you are referencing is the active
window, you can use the LabTalk string variable %H, in place of the worksheet name. For example,
%H_A[1].
To subtract the value in row 1 of column A, from all the values in column B…
col(B)=col(B)-col(A)[1]
Let's use what we have learned about executing multiple lines of script in the Script window. We will multiply
every value in a column of data by some constant b.
2041
Tutorials for Origin
b=3;
Press CTRL+ENTER. Recall that this gives us a carriage return without executing the command.
9. Now type:
col(A)=col(A)*b;
10. Choose Edit from the Script window's menu bar. Script Execution should have a check mark next to it;
if not, single-click on the menu item to place a check mark there.
11. Now, select the two lines of script that you just entered into the Script window and press ENTER.
b=3;
col(A)*=b;
You can also use linear interpolation or extrapolation on a specified X dataset to find the corresponding
interpolated or extrapolated value in a Y dataset. This requires using a new notation with parentheses ( )
instead of brackets [ ].
2042
Programming
In this example, book1_b is a Y dataset and (4) is a value in an X dataset (book1_a) for which you want to
find a corresponding, interpolated Y value.
book1_b(4) =
This is a line plot of our simple worksheet data. You can see that our interpolated Y value – the one
corresponding to X = 4 – is 5.333333.
14. If the columns you work with are in different worksheet/workbook, you should use the range variables to
represent the worksheet columns. For example, this script calculates the sine value on Book1 column A,
and puts the result in Book2 column A (You must have Book2 before hitting Enter):
15.
range a = [Book1]Sheet1!Col(A);
2043
Tutorials for Origin
range b = [Book2]Sheet1!Col(A);
b = sin(a);
Origin 8 provides a large collection of X-Functions for performing a wide variety of data processing
tasks. Of this collection, many of the X-Functions are accessible from LabTalk script. The functions
accessible from script provide a powerful environment for users to create custom script code for their
routine tasks.
X-Functions that are accessible from script can be listed in the Command Window, and you can also
obtain help on the command syntax as well as make use of auto completion of commands for such
functions.
X-Functions accept data range string or range variable for specifying source and destination data for
the operation. For example, the smooth X-Function under signal processing can be accessed from the
Command Window as follows:
2044
Programming
When you press ENTER, the result will append to the source worksheet.
help smooth
12.4.3.1 Summary
X-Functions provide a structured programming environment that offers a framework for building Origin tools.
Different from the simple GetN box, creating tools by using X-Functions allows the user to focus on the actual
data processing code and not have to worry about codes for the user interface.
Most of the dialogs/functions in Origin 8 are X-Functions, and many of them can be run from both menu and
command line mode. The flexibility of running X-Functions makes them an attractive approach to customizing
Origin
2045
Tutorials for Origin
1. Select Tools: X-Function Builder or press F10 to open the X-Function Builder dialog
2. Set Name, Label and Data of the 1st variable as ix, Source and <active>
3. Right click in the list panel and select Add Variables from the context menu.
4. Set Name, Label, Input/Output and Data of the 2nd variable as ox, Destination, Output and
<new>
2046
Programming
if (!ix || !ox)
XF_THROW(CER_NO_DATA);
ox = ix;
4. Open the Usage Context branch. Make sure the Labtalk check box is selected
2047
Tutorials for Origin
7. Type the following script in the command window, Column(A) will be copied to Column(B)
3. Open the Menus branch, make sure Simple GetNBox is selected from the Auto GetN Dialog list
box
5. Type following script in the command window, Dialog of VCOPY.OXF will be opened
vcopy -d
2048
Programming
12.4.4.1 Summary
A wizard is a graphical user interface that includes a series of dialogs to direct a user to complete a mission
step by step. A wizard makes a complex task easier to perform. Origin provides several classes in Origin C for
users to develop a wizard. The dialog for each step in the wizard can be created using an X-Function.
In this example, the wizard will perform a normality test and then a one-sample t-test for data in a column.
The normality test's result can be shared in one-sample t-test.
1. Select Tools: X-Function Builder or press F10 to open X-Function Builder dialog
2049
Tutorials for Origin
2. Add the variables as follows and save the X-Function as "StatTest" in the User Files folder, User Files\X-
Functions\Statistics\Hypothesis Testing.
3. Click the New X-Function Wizard button. Add the variables as follows and save the X-Function as
"StatTestWizGoal" in the User Files folder, User Files\X-Functions\Statistics\Hypothesis Testing.
2050
Programming
4. Click the New X-Function Wizard button. Add the variables as follows and save the X-Function as
"NormalityTest" in the User Files folder, User Files\X-Functions\Statistics\Hypothesis Testing.
5. Click the New X-Function Wizard button. Add the variables as follows and save the X-Function as
"OnetTest" in the User Files folder, User Files\X-Functions\Statistics\Hypothesis Testing.
2051
Tutorials for Origin
Note that the X-Functions NormalityTest and OnetTest have the same variable "prob", which is a shared
variable and will be declared in the source file.
1. Open the X-Function StatTest. Click the TreeView button to open the Tree View. Make the following
settings in the Tree View.
Click the TreeView button and type "Select Wizard Goal", "Normality Test" and "One-Sample t-test"
in the Description edit box of each X-Function's Tree View, which will be shown in the dialogs.
Click the Code Builder button on the Standard toolbar. In Code Builder, click the New button. In the
New File dialog, select H File, click the Browse button, and select the User Files folder, User
Files\OriginC as the new header file's Location. Then type StatTestWiz in the File Name edit box. Click
OK to close the dialog.
2052
Programming
#ifndef __STAT_TEST_WIZ_H__
#define __STAT_TEST_WIZ_H__
#include <..\OriginLab\XFWiz.h>
#include <..\OriginLab\XFCore.h>
#include <..\OriginLab\XFWizard_utils.h>
public:
StatTestWizCore();
public:
DataRange GetRange();
int nStep;
protected:
};
2053
Tutorials for Origin
#endif //__STAT_TEST_WIZ_H__
///////////////////////////////////////////////////////////////////////////////////
#include <..\OriginLab\XFWizManager.h>
#include <..\OriginLab\WizOperation.h>
#include <..\OriginLab\XFWizNavigation.h>
#include <..\OriginLab\XFWizScript.h>
#include <..\OriginLab\XFWizDlg.h>
///////////////////////////////////////////////////////////////////////////////////
2054
Programming
#include "StatTestWiz.h"
enum
GOAL_ALL = 0,
GOAL_SIMPLE,
};
///////////////////////////////////////////////////////////////////////////////////
//Class StatTestWizTheme
2055
Tutorials for Origin
public:
StatTestWizTheme();
};
StatTestWizTheme::StatTestWizTheme()
:XFWizTheme()
///////////////////////////////////////////////////////////////////////////////////
};
///////////////////////////////////////////////////////////////////////////////////
//Class StatTestWizManager
2056
Programming
public:
protected:
};
2057
Tutorials for Origin
STR_LABEL_STEP_TTest};
m_saMapXFNames = saMapXFNames;
m_saMapXFLabels = saMapXFLabels;
m_saDefaultXFNames = saDefaultXFNames;
///////////////////////////////////////////////////////////////////////////////////
//Class StatTestWizCore
StatTestWizCore::StatTestWizCore()
:XFCore()
m_vsXFsRecalculateShown = vsXFsRecalculateShown;
nStep = GOAL_ALL;
2058
Programming
ASSERT(pXFWizNavg);
nStep = nGoal;
if ( pXFWizNavg )
StringArray saXFNames;
saXFNames.Add(STR_STEP_GOAL);
switch (nGoal)
case GOAL_ALL:
saXFNames.Add(STR_STEP_Normal);
saXFNames.Add(STR_STEP_TTest);
break;
case GOAL_SIMPLE:
saXFNames.Add(STR_STEP_TTest);
2059
Tutorials for Origin
break;
pXFWizNavg->SetSteps(saXFNames);
DataRange StatTestWizCore::GetRange()
DataRange drInput;
if(!pIORange)
return drInput;
Array<DataRange&> drs;
2060
Programming
return drInput;
drInput = drs.GetAt(0);
return drInput;
///////////////////////////////////////////////////////////////////////////////////
2061
Tutorials for Origin
Note that StatTestWiz.c should be compiled after the X-Function StatTest is compiled, since the included files
in StatTestWiz.c are not yet in the workspace until the X-Function StatTest is compiled. In fact StatTestWiz.h
is included in X-Function StatTest, so StatTestWiz.c will be compiled automatically when X-Function StatTest
is compiled.
In the X-Function Builder, click the Open button and open the X-Function StatTest. Click the Edit X-
Function in Code Builder and add the following script.
#include <..\OriginLab\XFWiz.h>
#include <..\OriginLab\WizOperation.h>
2062
Programming
#include <..\OriginLab\XFCore.h>
#include <..\OriginLab\XFWizNavigation.h>
#include <..\OriginLab\XFWizManager.h>
#include <..\OriginLab\XFWizScript.h>
#include <..\OriginLab\XFWizDlg.h>
#include <..\OriginLab\XFWizard_utils.h>
#include <..\OriginLab\WksOperation.h>
#include <event_utils.h>
#include "StatTestWiz.h"
StatTest()
if( script )
stat_test_run_wiz_nodlg(tn);
else
stat_test_open_wiz_dlg(tn);
StatTest_before_execute()
Add the function body, which determines not to show this dialog before the wizard is opened.
2063
Tutorials for Origin
nRet = XFEVT_PROCEED_NO_DLG;
Click Compile button to compile the file. Then click Return to Dialog button to return to X-Function
Builder. In the X-Function Builder, click Save OXF file button to save the X-Function.
Open the X-Function StatTestWizGoal. Click Edit X-Function in Code Builder button, add the following
script.
#include "StatTestWiz.h"
This function is used to check whether the input DataRange is a single column.
DataRange drInput;
drInput.Create(trRange.strVal);
if( drInput.GetNumRanges() == 0 )
return false;
2064
Programming
else
if( drInput.GetNumRanges() == 1)
Worksheet wksInput;
return true;
return false;
StatTestWizGoal_event1()
ASSERT(pstatwc);
2065
Tutorials for Origin
if ( 0 == lstrcmp(lpcszNodeName, "goal") )
pstatwc->ChangeGoal(trGetN.goal.nVal);
return false;
Click Compile button to compile the file. Then click Return to Dialog button to return to X-Function
Builder, and click Save OXF file button to save the X-Function.
Open the X-Function NormalityTest. Click the Edit X-Function in Code Builder button and add the
following script.
#include "StatTestWiz.h"
#include <XFbase.h>
This function is used to update the dialog's edit boxes for normality test result.
2066
Programming
vector vRes;
trGetN.stat.dVal = vRes[0];
trGetN.df.dVal = vRes[1];
trGetN.prob.dVal = vRes[2];
This function is used to update the string shown at the bottom of the dialog.
strErr = "At the 0.05 level, the data was significantly drawn from a
strErr = "At the 0.05 level, the data was not significantly drawn from a
else
2067
Tutorials for Origin
Note that the string is divided into two lines shown in the page. It should be a command of one line in the
script.
StatTestWizCore* pstatwc =
(StatTestWizCore*)get_xf_core_handler(nXFCorePointer);
ASSERT(pstatwc);
vector vRes(3);
vRes[2] = -1;
DataRange drInput;
drInput = pstatwc->GetRange();
if( !drInput )
return vRes;
XFBase xfNorm(vsXFName[nType]);
2068
Programming
return vRes;
return vRes;
return vRes;
return vRes;
if( !xfNorm.Evaluate() )
return vRes;
2069
Tutorials for Origin
return vRes;
NormalityTest()
Update the function body, which exports the result into a worksheet when the Next button is pressed.
DataRange drInput;
StatTestWizCore* pstatwc =
(StatTestWizCore*)get_xf_core_handler(nXFCorePointer);
ASSERT(pstatwc);
drInput = pstatwc->GetRange();
if( !drInput )
return;
if(!drInput.GetBookSheet(strBook, strSheet))
return;
}
WorksheetPage wpData(strBook);
2070
Programming
if(nLayer >= 0)
vsParaName[2] = vsNProb[type];
vector vRes;
wksRes.Columns(1).SetLongName(vsTypeName[type]);
wksRes.SetCell(ii, 1, vRes[ii]);
else
2071
Tutorials for Origin
NormalityTest_event1()
Update the function body, which will update the results in the dialog as the method of normality test changes.
Strings shown at the bottom of the dialog will also be updated.
_update_GUI(trGetN);
_update_strErr(trGetN, strErrMsg);
return true;
NormalityTest_before_execute()
Update the function body, which will make the edit boxes for results grayed out, and show the result in the
dialog.
trGetN.stat.Enable = false;
trGetN.df.Enable = false;
trGetN.prob.Enable = false;
Click the Compile button to compile the file. Then click the Return to Dialog button to return to X-Function
Builder, and click the Save OXF file button to save the X-Function.
Open the X-Function OnetTest. Click the Edit X-Function in Code Builder button and add the following
script.
#include "StatTestWiz.h"
2072
Programming
#include <XFbase.h>
Define strings
const vector<string> vsAlter = {"Mean <> ","Mean > ","Mean < "};
string strNull;
trGetN.null.strVal = strNull;
if(bMean)
2073
Tutorials for Origin
trGetN.tail.SetAttribute(STR_COMBO_ATTRIB, strAlter);
This function is used to check the Significance Level edit box value.
return true;
else
return false;
2074
Programming
This function is used to define the string for the conclusion of t-test at the bottom based on P-value.
else
Note that the command is divided into several lines shown in the page. It should be a command of one line in
the script.
2075
Tutorials for Origin
This function is used to update edit boxes for results in the dialog.
vector vRes;
trGetN.stat.dVal = vRes[0];
trGetN.df.dVal = vRes[1];
trGetN.tprob.dVal = vRes[2];
trGetN.lcl.dVal = vRes[4];
trGetN.ucl.dVal = vRes[5];
DataRange drInput;
StatTestWizCore* pstatwc =
(StatTestWizCore*)get_xf_core_handler(nXFCorePointer);
ASSERT(pstatwc);
2076
Programming
vector vRes(6);
vRes[2] = -1;
drInput = pstatwc->GetRange();
if( !drInput )
return vRes;
return vRes;
return vRes;
2077
Tutorials for Origin
return vRes;
return vRes;
return vRes;
return vRes;
2078
Programming
return vRes;
return vRes;
return vRes;
if( !xfTTest.Evaluate() )
return vRes;
return vRes;
2079
Tutorials for Origin
OnetTest()
Update the function body, which exports the result into a worksheet when the Finish button is pressed.
DataRange drInput;
StatTestWizCore* pstatwc =
(StatTestWizCore*)get_xf_core_handler(nXFCorePointer);
ASSERT(pstatwc);
drInput = pstatwc->GetRange();
if( !drInput )
return ;
if(!drInput.GetBookSheet(strBook, strSheet))
return;
}
WorksheetPage wpData(strBook);
if(nLayer >= 0)
2080
Programming
{
Worksheet wksRes = wpData.Layers(nLayer);
vsParaName[2] = vsProb[tail];
vector vRes;
wksRes.SetSize(-1, 4);
wksRes.Columns(0).SetLongName("Test Statistics");
wksRes.Columns(1).SetLongName(strNull);
wksRes.SetCell(ii, 1, vRes[ii]);
2081
Tutorials for Origin
else
OnetTest_event1()
Update the function body, which will update results and show a conclusion at the bottom of the dialog
according to the result. As settings change in the dialog, the Null edit box will be updated as the mean and
hypothesis change, and the Significance Level edit box's value is checked.
_update_null(trGetN, true);
_update_null(trGetN);
_update_GUI(trGetN);
_update_strErr(trGetN, strErrMsg);
return false;
OnetTest_before_execute()
2082
Programming
Update the function body, to show/hide or disable the controls in the dialog.
StatTestWizCore* pstatwc =
(StatTestWizCore*)get_xf_core_handler(trGetN.nXFCorePointer.nVal);
ASSERT(pstatwc);
trGetN.prob.Show = 1 - pstatwc->nStep;
trGetN.prob.Enable = false;
trGetN.null.Enable = false;
trGetN.stat.Enable = false;
trGetN.df.Enable = false;
trGetN.tprob.Enable = false;
trGetN.lcl.Enable = false;
trGetN.ucl.Enable = false;
Click the Compile button to compile the file. Then click the Return to Dialog button to return to the X-
Function Builder. Click the Save OXF file button to save the X-Function.
Close Origin. Then start Origin and you will notice that a new item Stat Test is added to Origin's menu
Statistics: Hypothesis Testing.
2083
Tutorials for Origin
2. Select Statistics: Hypothesis Testing: Stat Test from the Origin menu or type the command "StatTest
-d" in the command window. The Stat Test wizard dialog will open.
2084
Programming
3. Click the Next button. The Normality Test dialog is opened. The result is shown in the Output branch. A
conclusion is drawn at the bottom of the dialog.
4. Click the Next button. The One-Sample t-test dialog is opened. The result is shown in the Output
branch. A conclusion is drawn at the bottom of the dialog. Previous step's result of normality test is shown
at the top. You can also change the setting in the dialog, and notice the result changes.
2085
Tutorials for Origin
2086
Programming
2087
Tutorials for Origin
5. Click the Finish button to end the wizard. Two worksheets for results are created.
2088
Index
2 Axis ...............................................................839
2D FFT and Filter............................................. 380 Bar and Scatter Plot with Error Bar .................. 1039
2D Pie Chart of a Population Study .................. 1020 Bar Graph of African Population ....................... 1025
2089
Tutorials for Origin
Contour Graph with XY Data Points and Z Labels1206 Distribution Fit with the Probability Density
Function and Cumulative Distribution Function..282
Contour Plot with Vector Overlay ..................... 1211
Double Y....................................................... 1101
Contour Plots and Color Mapping ..................... 1180
E
Convert Data from Spherical Coordinate to XYZ
and Make a 3D Plot..................................... 1715 Energy-Level Structure of the Er3+ Ion in A YAG
Crystal ...................................................... 1143
Convolution .................................................... 388
Enhanced Digitizer ......................................... 1935
Copy and Apply a Plot Format to Another Plot ..... 915
Error Bars with Fill Area ....................................795
COX Model Estimator ....................................... 681
Excel ............................................................ 1969
Create an 8 layer multi-panel plot template ...... 1153
Exporting ...................................................... 1953
Create and Subtract Baseline with Peak Analyzer 439
Exporting and Presentation ............................. 1953
Create and Update Apps for Origin .................. 2032
Exporting Graphs ........................................... 1953
Create Heat Map with Vritual Matrix and Colormap
Bar Plot ..................................................... 1226 F
Creating a Custom Report Sheet ....................... 554 FFT and IFFT ...................................................348
Creating Analysis Templates using Set Column Fill Partial Area between Curves.........................924
Value .......................................................... 550
Fit Curve Through Certain Points .......................275
Creating and Using Analysis Templates .............. 547
Fit Function with Non-constant Background .........266
Creating Intersecting Surface Plots from
Worksheets ............................................... 1593 Fit Multiple Datasets by Fitting One and then Using
Those Fit Parameters for Other Datasets ..........330
Cross Tabulation ............................................. 593
Fitting Complex Function ..................................254
Curve Fitting..............................................22, 137
Fitting Integral Function with a Sharp Peak .........285
Curve Intersection Gadget .................................. 68
Fitting Integral Function with parametric limit
D using NAG Library .........................................224
2090
Index
Global Fitting with Parameter Sharing ................ 176 Line and Symbol ..............................................916
Global Vertical Cursor ........................................ 58 Line Graph with Masked Data ............................980
Graph Template and Theme ............................. 915 Line Graph with Recession Bars .........................939
Graph Templates and Batch Plotting ......................4 Linear and Polynomial Fitting ............................138
Grouped Box Chart with Color Indexed Data Points1260 Linear Fitting and Outlier Removal .....................138
Grouped Box Plot .......................................... 1367 Lock Filter with Analysis ...................................527
Grouped Stacked Column ............................... 1076 Marginal Distribution Curve ............................. 1292
Histogram with Distribution Curve overlay ........ 1464 Merge and Arrange Graphs ................................ 11
How to Create a Wizard ................................. 2049 Merging and Arranging Graphs ..........................883
How to share Origin C based LabTalk Functions. 1988 Micro-Raman spectroscopy of complex
nanostructured mineral systems .....................959
Hypothesis Tests ............................................. 616
Modifying Derived Parameters in Build-in Functions324
I
Multi-Axis and Multi-Panel ............................... 1101
I Shaped Box Plot.......................................... 1274
Multi-Data Dot Chart ...................................... 1406
IIR Filter ........................................................ 375
Multi-line-plot with Special Position Annotation
Implicit Fitting with Three Variables ................... 338 Line.............................................................967
Import Data from a Database ......................... 1857 Multiple Axis Breaks .........................................839
Import Data from a Database for Analysis ........ 1872 Multiple Axis Plot ........................................... 1135
Import Time Data.......................................... 1847 Multiple Layers with Linked Axis ........................893
Import Wizard .............................................. 1843 Multiple Surfaces in Same Layer ...................... 1646
Introduction to Origin C and Code Builder......... 1992 Nonlinear Fitting with System Function ...............165
2091
Tutorials for Origin
Notched Boxes with Variable Width Control ...... 1381 Polar Crop..................................................... 1492
One Way ANOVA ............................................. 627 Polar Graph with Custom Angular Scale ............ 1550
One-Way Repeated Measures ANOVA ................ 633 Polar Graph with Custom Radial Axes ............... 1505
Open-High-Low-Close-Volume Stock Chart ....... 1794 Polar Graph with Multiple Layers ...................... 1518
Organizing and Accessing Origin C Functions .... 2012 Polar Plot with Error Bar ................................. 1486
Origin C ....................................................... 1992 Post Processing with Import Filter .................... 1852
2092
Index
SQL Editor for Database Analysis .................... 1888 Two-Way Mixed-Design ANOVA .........................649
Statistics ......................................... 28, 581, 1249 Use Script to Search for Baseline Anchor Points in
Peak Analyzer...............................................446
STFT (Short-Time Fourier Transform) ................ 368
User Defined Fitting Function ............................193
Surface Fitting with Multiple Peaks .................... 319
User Defined Fitting Function using GNU Scientific
Surface with Missing Values ............................ 1586 Library.........................................................210
Surface with Symbols and Droplines ................ 1607 User-Defined Arbitrary Tick Positions ..................851
Surface With Transparent Plane ...................... 1676 Using Multiple Gadgets .....................................123
Symbol Plot with Color Transparency ................. 986 Variable Column Width ................................... 1091
Symbol Plot with Size and Colormap from Other Vertical 2 Panel Line....................................... 1127
Columns ...................................................... 999
Video Tutorials ................................................. 37
T
W
Ternary Contour ............................................ 1193
Waterfall....................................................... 1779
The Code Builder Workspace .......................... 2000
Wavelet ..........................................................391
Three-Way ANOVA .......................................... 654
Weibull Fit ......................................................685
Transparent Parametric Surfaces combined with
Scatter Plot ............................................... 1707 Weibull Probability Plot ................................... 1436
Calculating Double Integral with NAG Functions Working with Excel ........................................ 1969
From Origin C.......................................... 2016
Working with Multi-Sheet Workbooks ............... 1803
Calling NAG Functions From Origin C............. 2023
Worksheet Data Operations ..............................506
Importing Data .......................................... 1832
Worksheet Query .............................................506
Two Way ANOVA ............................................. 638
X
Two Way Repeated Measures ANOVA ................. 644
X-Functions................................................... 2037
Two-Level Grouped Box Chart ......................... 1324
XYZ Contour ................................................. 1170
2093