Вы находитесь на странице: 1из 8

12/3/2014

Plotting Graphs in Excel


Introduction
Welcome to your complete guide to plotting graphs in Microsoft Excel. This is a skill which will take you
little time to master but will be incredibly useful to you across a broad range of subjects. This guide has
been tailored in particular to give you the necessary skills to complete your coursework in all IB science
subjects, the example used in this handout is a physics experiment but the graphing process will be the
same no matter what data you are using.

DISCLAIMER
Unfortunately Microsoft like to move all the buttons around on excel every time they make a new
version so these instructions may now be 100% correct for all of you. However, in the last few versions
things havent changed too drastically so with a bit of common sense you should easily be able to apply
these instructions. (This also applies to Mac users, your version of excel is slightly different but its close
enough that these instructions are still applicable)

Entering your data


1. Enter your data into excel under clear headings; this will make your life a lot easier later on.
2. You may need to process your data before it is appropriate to put into a graph, for example if
you have taken several repeats you want to first find the average before you plot anything.
3. You may also have data which is has lots of numbers after the decimal point, as a general rule
we want to keep our data neat and so round to only a few decimal places. Fortunately excel has
a feature to do this for you. Select your data, select the HOME tab, under the Number section
click the drop down menu and change the data type from General to Number, you can then
use the buttons below the drop down menu to alter the number of decimal places displayed.
4. We also need to create columns in our data table to display the uncertainties in each of our
variables. The way you estimate the uncertainties will depend upon the experiment.
5. Your finished data tables should look something like the ones below. This is an experiment
about a bouncing ball, obviously you data will be different depending on your experiment.
RAW DATA
Start Height
(H1) (cm)

Height Of First Bounce (H2) (cm)


Repeat 1

Repeat 2

Repeat 3

Start Height
- H1 (cm)

PROCESSED DATA
Height of
H1
First Bounce
Uncertainty
- H2 (cm)
(cm)

H2
Uncertainty
(cm)

20

16.8

15.9

16.3

20

16.3

30

22.1

24.2

23.9

30

23.4

40

31.2

34.7

33.1

40

33.0

50

41.2

39.8

42.3

50

41.1

60

45.7

47.8

47.4

60

47.0

Page 1 of 8

12/3/2014

Plotting a basic graph


1. In your experiments you will normally just be looking at the relationship between two variables,
and usually you will select your variables so that there is a linear relationship between them.
2. The graph we want to use is the XY-Scatter.
3. Before you do anything click on an empty square in excel,
if you have any data selected and try to enter a graph,
excel will try and guess which data you want to put where
but more often than not it gets it wrong so we are better
starting with a blank graph
4. Go to the INSERT tab, and under the graph section you
want to find the XY-Scatter option. It is in slightly
different places on different versions of excel but in all
cases it is somewhere on the INSERT tab so Im sure you
can find it.
5. When you find the XY-Scatter button it will bring up a
drop down menu similar to the one shown in the picture,
you want to select the option circled in red; this will give
you an XY-Scatter with the points not connected in any
way.
6. Once youve done this, an empty graph window will appear in your document, it will just look
like an empty white box. We now need to input our data.
7. Right-Click anywhere in the graph window (big white box), and choose the option Select Data.
8. It will bring up a separate window listing the current data series in your graph. There shouldnt
be any there to start with; if there are, select it and remove it.
9. Find the Add button, this will add a new data series. You will get a pop-up window like the one
shown below.

10. From this window, give your data series an appropriate name. We will now select the data we
want to use.
11. It is important you know which variable is your independent variable (goes on x-axis) and which
is your dependent variable (goes on y-axis).

Page 2 of 8

12/3/2014
12. To select your x values click the button circled in green then in your data sheet select your
desired x values. To select multiple values click and hold the value at the top of a column and
drag down so all the values are highlighted.
13. Similarly, to select your y values click the button circled in red then in your data sheet select
your desired y values.
14. Click Ok and you should be returned to your data page, except now your graph should have
some points on it. It should look something like the image below. (Obviously location and scale
of data will be different depending on your experiment).
60.0
50.0
40.0
30.0
20.0
10.0
0.0
0

10

20

30

40

50

60

70

Basic Graph Formatting


1. By now you have a basic graph but we want to add a few features to make it more presentable.
2. The first step is to give your graph some headings and axis labels. Again click on your graph, a
new tab called CHART TOOLS will appear at the top of the screen, within that tab select the
DESIGN tab.
3. You should now have a toolbar which has lots of options for your graph, on the toolbar click the
button for Add Chart Element. This will bring up a menu which allows you to add a title and
chart axis.
4. When you click each of these it will automatically produce a text box in the correct place on
your graph, from there you can simply type appropriate headings into the text box. Remember
to always include units in your axis labels.
5. Before we add anything more advanced to the graph I would usually expand the graph to the
whole screen to make it easier to work on. To do this, right click in some of the empty white
graph space around the edge, and select Move Chart. This will bring up a dialog box, you want
to select New Sheet: Chart 1
6. This will produce a page just for your graph; you can toggle between your graph and your data
using the tabs at the bottom of the screen.

Page 3 of 8

12/3/2014

Adding a Trendline
1. As a general rule we always add a trendline as it helps us to interpret any patters in the data.
2. To insert a trend line, right click on one of the data points and select the option Add Trend line
3. This will bring up a menu that looks like the image below. On newer versions of excel it will not
be a pop-up box, but will be a menu that appears on one side of the screen, but all the content
is the same as this image.
4. The first thing to do is select the type of trendline; usually we will be using a linear trendline.
5. The next important thing is in the Forecast Section (circled in blue). When your trendline is
created it will only extend as far as the data points go, but frequently we may want to extend
the trendline to see where it intercepts the axis. If you want to extend the line in the negative-x
direction, type in the Backward box. To extend the line in the positive-x direction enter in the
Forward box.
6. The final thing we need to do is select the box circled in red, this will display an equation for the
line of best fit on the graph. This may be useful if our result is in some way related to the
gradient or intercept of the line.
7. There are some other options in this menu to change the style or colour of the line, but theyre
pretty easy for you to figure out on your own.
8. By this stage your graph will look something like the image below.

Coefficient of Restitution
Height of First Bounce - H2 (cm)

60.0
y = 0.837x - 0.5933

50.0
40.0
30.0
20.0
10.0
0.0
-20

0
-10.0

20

40

60

Height of Drop - H1 (cm)

Page 4 of 8

80

12/3/2014

Inserting Error Bars


1. The next stage is to add error bars to our graph. What these allow us to do is display the
uncertainties of the experiment on the graph itself.
2. To add error bars, click on the graph, then once again go to CHART TOOLS, DESIGN then select
Add Chart Element. Within this menu there should be an option to Error Bars.
3. It will give you a range of options such as Standard
Error, Percentage Error etc. but you want to select
the option at the bottom of the list More error bars
options, that should bring up a menu like the one
shown to the right (in different versions of excel it will
appear in different places but again the content
should all be pretty similar).
4. At the top of the box you can see which error bars
you are editing (in this case horizontal error), make
sure you know which uncertainties refer to your
independent variable (x-axis) and which refer to your
dependent variable (y-axis).
5. The Display section of the menu will give you options
on how the error bars will appear. Normally we want
to select Direction Both, this simply means that
we are representing a error.
6. Select Cap under End Style as it is clearer on the
graph.
7. The final step is to enter the error amount. Depending on the experiment this may be a fixed
amount in which case use the Fixed value box.
8. In some circumstances the error may vary for the different points, in this
situation select Custom and press the Specify Value Button. This will
produce a pop-up window like the one shown on the right.
9. This menu works in a very similar way to the data selection menu you
used previously. It is very important that all your data is nicely arranged
in a table otherwise this next step will not work.
10. Just as you did with the data selection, click the buttons and highlight
your data (now selecting from the appropriate error uncertainty columns in your table). As long
as your errors are aligned appropriately with your data in your table, the correct error will assign
itself to the correct point.
11. You will notice that this box has options for Positive Error Value and Negative Error Value, this
simply means that you can define a different error in the +ve and ve directions. However, in
all our experiments the error is a simple error so use the same uncertainty values for both
boxes.
12. Once you have formatted one set of error bars, go back to your graph, right click on the other
set of error bars, and select format error bars this will bring the window back up and you can
repeat the process. You should now have a graph that looks something like the one on the
following page.

Page 5 of 8

12/3/2014

Height of First Bounce - H2 (cm)

Coefficient of Restitution
y = 0.837x - 0.5933

50.0
40.0
30.0
20.0
10.0
0.0

-10

0
-10.0

10

20

30

40

50

60

70

80

Height of Drop - H1 (cm)

Max and Min Lines of Best Fit


1. The last things we will add to our graph are minimum and maximum lines of best fit. Explained
briefly, these are trend lines just like the one we already have, except they only just fit within
the allowed error. So the maximum line of best fit is the steepest line which still passes through
all the error bars, and the minimum line of best fit is the shallowest line of best fit which passes
through all the error bars.
2. Min and Max lines are very important as often the result we are looking for is related to the
gradient of our trendline. Therefore by looking at the variation in the gradients between the
Max and Min lines, we can learn how accurate our final result is.
3. Theory out the way, making Max and Min lines will require many skills weve already used.
Unfortunately excel does not have an automatic feature to do this so we have to manually add
extra lines to the graph.
4. The way it is done is that we create 2 new data series, Min and Max; these data series will
only have 2 points each, just enough so that we can add a trendline to each one.
5. Start by creating a new mini table in your data sheet. Each data series (Min and Max) will need
to have two points; essentially we want to locate the points in such a way, so that when they are
joined by a trendline they form Max and Min lines.
6. The way you pick your points is a bit of guesswork to start with, I always match the x-coordinate
to that of the biggest and smallest data points, then just vary the y-coordinate so that its not
the same as the existing data series.
7. Some example min and max points for this particular experiment are shown in the table below.
Page 6 of 8

12/3/2014

MIN
x

MAX
y

20
60

x
22
43

y
20
60

10
55

8. We now need to add this data series, this is exactly the same process as when we added the first
data series. Right-click on the graph and choose Select Data, this brings up a familiar menu and
from here we can add the two new data series.
9. If youre unsure how to do this go back and follow the same procedure we used when we
inputted the initial data. Once you have inputted the new data you should have something that
looks like the graph below on the left.
10. See how we have four new points (two for each data series); we now want to add a trendline to
each of these new data series. This is exactly the same procedure as you have done already so
Im not going to explain it again, if unsure read through the Adding a Trendline section again.
11. Once you have added your trend lines your graph should look something like the one below on
the right.
12. Now we have the trend lines we can see that our lines dont quite pass through all the error
bars, therefore we will have to slightly edit the values in our Max/Min chart. You DO NOT have
to remove the trendline and plot it all over again, if you change the values in the data sheet the
trendline will auto update.
13. Once you are happy with the position of the lines, you can extend them so they intercept the
axis. You also want to display the equation of the Min and Max lines on your graph as you may
need to later use these in your analysis.
14. The result should look like the graph on the following page.

Coefficient of Restitution

Coefficient of Restitution

50.0
40.0
30.0
20.0
10.0
0.0
-10 0
-10.0

y = 0.837x - 0.5933

Height of First Bounce - H2 (cm)

Height of First Bounce - H2 (cm)

y = 0.837x - 0.5933

10

20

30

40

50

60

Height of Drop - H1 (cm)

70

80

50.0
40.0
30.0
20.0
10.0
0.0
-10
0
-10.0

10

20

30

40

50

60

70

Height of Drop - H1 (cm)

Page 7 of 8

12/3/2014

Height of First Bounce - H2 (cm)

Coefficient of Restitution
60.0

y = 1.075x - 10.5

50.0

y = 0.837x - 0.5933
y = 0.65x + 7

40.0
30.0
20.0
10.0
0.0

-10
0
-10.0

10

20

30

40

50

60

70

80

90

Height of Drop - H1 (cm)

Final Formatting
1. Congratulations for getting this far, you now have everything you need to assess the results of
your experiment, these final few tips will just help make your graph look nicer. Im not going to
go through all the steps in detail as by now you are an excel master.
2. Remove the Max and Min data points so that just the lines are displayed.
3. Alter the equations so that we dont have an excessive number of decimal places.
4. Colour coordinate the various lines so we can distinguish one from another
5. The finished product is shown below.

Coefficient of Restitution
y = 1.1x - 10.5

Height of First Bounce - H2 (cm)

60.0

y = 0.8x - 0.6
50.0
y = 0.7x + 7.0
40.0
30.0
20.0
10.0
0.0

-10

0
-10.0

10

20

30

40

50

60

70

80

Height of Drop - H1 (cm)

Page 8 of 8

Вам также может понравиться