A Guide to using Origin - Workspace

N.J.Ekins-Daukes, A guide to using Origin
26 September 2011
A Guide to using Origin
Origin is a powerful piece of scientific software that
produces professional quality graphs. It is capable of
producing almost any type of graph you are likely to require
in your work as a physicist and is supplied with useful curve
fitting and statistical regression algorithms that to determine
the accuracy of the fit to your data and the associated
random error.
When you start Origin, you will receive a screen full of icons
and options. In this guide we will use only a small fraction
of them, but you are encouraged to explore the software
beyond what is covered here. The online help is available
to assist you learn more about the software, there are also
video tutorials posted online at:
http://www.originlab.com/index.aspx?go=Support/VideoTutorials
Data can be entered directly into the spreadsheet with
columns marked A(X) and B(Y). In this example we wish to
plot some data of speed vs time taken from a racing car. We
start by entering meaningful names into the row marked
Long Name. Since this data also has units, these are entered
into the row below.
Plotting the data on a graph is straightforward if you know
where to look. In the Plot menu bar, select Symbol then
Scatter 1. Origin will then ask you to assign the axes to the
columns of data to the X and Y axes, tick the appropriate
choice as shown below.
The result is a neat scatter graph of your
data. Notice that Origin automatically
labels your axes using the Long Name that
was entered in the table of data and also
has remembered the units too. Double
click on the the axes to change their
formating or type, e.g. to log-linear or loglog.
Origin can hold several graphs and many
tables of data at once. You can save all
your work in a single Project File with
extension by selecting to File ->Save
Project
1
Avoid the temptation to join the dots with a line, since this adds no additional information and it is best to
use lines to indicate theoretical projections.
Blackett Laboratory, Imperial College London
121
N.J.Ekins-Daukes, A guide to using Origin
26 September 2011
Performing calculations on data.
It is often desirable to manipulate data after it is in Origin. In our example, we wish to
convert the speed from mph to SI units, m.s-1. First we need to create a new column.
On the upper right hand side of the screen there is
the “add column” icon.
You can then add a new Long Name to the column
and it is worth noting that Origin supports subscripts
and superscripts via the following controls on the tool
bar:
Selecting the Greek icon selects the symbol font and allows you to
type in Greek, a=!, b=" etc..
To perform mathematical operations on columns of data, select the entire column by
clicking in the grey box marked C(Y), then navigate to the Column menu bar and select
You can then enter a formula which will be mapped onto every active row of that
column.
The operation we wish to perform is to multiply column B by 0.447, to do this type:
0.447*col(b)
Pressing [Apply ] will evaluate the command and you can check that the operation is
correct before pressing [OK] to dismiss the dialog box. Column C now contains the
speed in meters per second as shown below.
A large number of operations can be performed on columns of data in this way and
some of the more commonly used commands are listed at the end of this guide.
Blackett Laboratory, Imperial College London
122
N.J.Ekins-Daukes, A guide to using Origin
26 September 2011
Adding Error bars to graphs
Y - error bars can be added easily to a scatter plot if you have a fixed fractional or
standard error. Just select the window containing the graph, then navigate to the Graph
menu bar and select “Add Error Bars”. You can then enter a fractional or standard error
and Origin will enter a new column into your data table with the computed error.
Often you will have errors in both the X and Y data. In this case, the errors need to be
added as explicit columns of data. Add two new columns to your data table. In our
example, we have a 10% error in the speed reading and a 0.3s error in our time. We
again use the “Set column values” function by right clicking on the empty data columns
and issuing
0.1*col(c)
0.3
to set the 10% error in Y
to set the fixed 0.3s in X
Origin now needs to be told that these columns
contain error data. Select the entire X Error column,
then navigate to Column and select “Set as X Error”.
Do the same for the Y Error column but selecting “Set
at Y Error”. The columns should now look similar to
that shown adjacent.
To plot a graph you must now select columns A, C, D
and E. To do this hold down the Control key and click
on each column in turn. When they are highlighted
navigate to Plot -> Symbol and select XY Error.
You may find that the plot symbol is larger than some
of your error bars. To correct this, double click on the
data points to reveal the formatting options for the
scatter plot. Under the Symbol tab, you can adjust the
size of the plot symbol. 3 points were used in the
example shown below.
Blackett Laboratory, Imperial College London
123
N.J.Ekins-Daukes, A guide to using Origin
26 September 2011
Fitting straight lines to data.
The extensive curve fitting options in Origin can be found under the Analysis menu in the
Fitting sub-menu. Most of the time you will want to perform a straight line fit to your
data. In this example the deceleration is approximately linear, so we wish to fit only that
portion to a straight line. We start by plotting the speed in m.s.-1 on a new graph using
the same procedure as before, simply selecting column C for the y-data and column A
for the x.
To select the range of data for fitting, click on the “Data Selector” icon
that is
located on the left hand toolbar. You can select the region of interest by dragging the
red vertical lines to enclose the data points that you wish to include in the fit to the line,
shown below.
To fit a curve to the data enclosed within the
boundaries, go to Analysis -> Fitting -> Linear
fit -> Open Dialog.
There are a great many options that you can
adjust, some concern the fitting process itself,
most are related to what data Origin reports
back to you about the fit. The default settings
are likely to be sufficient for your needs so just
click [OK]. Origin may also ask if “you want to
switch to the report sheet”, choose the option “No and don’t bother me with this again”.
Origin will display a
graph with a line of best
fit together with a table
summarising the fitting
parameters. Notice that
the Slope and Intercept
of the line are quoted
with their standard error
that taking into account
the error bars. It is
important to realise that
this is the error due to
the scatter of your data
around the straight line.
It may give an indication
of the random error in the
data, but it will not include any systematic error, such as a poorly calibrated
speedometer in this example.
You will find that Origin has now added some additional tabs to your data table with
copious quantities of fitting data. You can inspect these by clicking the tabs at the
bottom of your table of data .
Blackett Laboratory, Imperial College London
124
N.J.Ekins-Daukes, A guide to using Origin
26 September 2011
Exporting graphs
To export your graphs for use in a word processor or presentation, navigate to File and
select Export Graphs then Open Dialog. You will be given a wide range of options for
exporting your graphs, shown below:
You may wish to change the following settings from their default setting:
Image Type: Here you choose the file format for your graph and the choice will depend
on the word processor or presentation software you wish to use. Portable Network
Graphics (PNG) is usually a safe choice for most software applications and has lossless
compression2. Users of the LaTeX word processing system may prefer to use
Encapsulated Postscript (EPS) or PDF.
File Names: Best to type a meaningful name into this box so that you can remember
what the file corresponds to.
Path: Origin has a default path to save graphics into, but you will probably want to
change this. Click on the [...] icon to select the location.
Image Size: If you click on the [+] symbol you can change the exported size of the
image. Changing the Specify Size setting to pixels and unchecking the Auto box
enables you to scale your image to any size you wish.
2
JPEG is also compatible with most software but not recommended for line art, such as diagrams and
graphs since the compression algorithm is lossy and results in poor definition of the sharp line edges.
Blackett Laboratory, Imperial College London
125
N.J.Ekins-Daukes, A guide to using Origin
26 September 2011
Commands
Excerpt from the Origin Reference Guide (Script Accessible Functions)
Cos
Cosh
Acos
Acosh
Sin
Sinh
Asin
Asinh
Tan
Tanh
Atan
Atanh
Returns value of cosine for each value of the given x.
The cosh(x) function is the hyperbolic form of cos(x)
Return the arccosine of a number, the result is in radians
Return the inverse hyperbolic cosin.
Returns value of sine for each value of the given x.
The sinh(x) function is the hyperbolic form of sin(x).
Returns the inverse of the corresponding trigonometric function.
Return the inverse hyperbolic sine.
Returns value of tangent for each value of the given x.
The tanh(x) function is the hyperbolic form of and tan(x).
Returns the inverse of the corresponding trigonometric function.
Return the inverse hyperbolic tangent.
N.B. Origin assumes all angles are expressed in radians
Degrees
Radians
Converts the radians into degrees.
Converts degrees into radians.
10^x
Log
Exp
Ln
Sqrt
Returns 10 to the power of x, 10x
Returns the base 10 logarithm value of x.
Returns the exponential value of x, ex.
Returns the natural logarithm value of x.
Returns the square root of x.
Abs
Mod
Nint
Prec
Round
Returns the absolute value of a number
Returns the integer modulus of integer x divided by integer y.
The return value of the nint(x) function is identical to round(x, 0).
Returns a value such that the numbers contain p places of significance.
Returns a value with p decimal places accuracy.
Blackett Laboratory, Imperial College London
126