How to Make Graphs with Excel 2000

Appendix A
How to Make Graphs with Excel 2000
A.1 Introduction
This is a “quick-and-dirty” tutorial to teach you the basics of graph creation and formatting in
Microsoft Excel. Many of the tasks that you will learn have short cuts, but many of the tasks are
demonstrated here “the hard way.” This is done so that you will be able to tackle some of the more
complicated tasks that short cuts tend to miss.
A.1 Entering and Formatting Data
First, let’s start with some test data measured during a spring force experiment.
1. Open MS Excel, and enter the following data on your spreadsheet as shown below:
Spring
Displacement, Spring Force,
x (mm)
F (N)
1
2
2.2
5.1
5.8
34.52
6.5
45
10.1
99.91
11
110
2. To make the data presentable, you would need to make the decimal place uniform throughout
each column of data:
a. Using your mouse, highlight the first column of numbers, then right-click once to
obtain a pop-up menu.
b. Choose Format Cells… and click the menu tab called Number.
c. Under Category, choose the item Number, which brings up additional information.
d. Under Decimal Places, change the value in the selection box to 1.
e. Then at the bottom of the Format Cells window, click the OK button.
3. Repeat Step 2 for the second column of numbers, this time changing the decimal places to 2.
4. The Format Cells pop-up menu can also be used to add borders and shading to cells, among
other things.
A-1
A.2 Creating the Graph
We are now ready to create a graph. Again, there are short-cuts that make creating graphs much
easier and faster, but we are learning the nuts and bolts here.
1. From the pull-down menus in Excel, choose Insert=>Chart… The Chart Wizard window will
open.
2. Under Chart Type, choose XY (Scatter). There are several Chart sub-types to choose from, but
leave the default type as is, and click Next >.
3. In step 2 of Chart Wizard, we will enter the data to be graphed, one series at a time. Choose the
Series menu tab, and click Add. You now have an x-y series called Series 1 that you will be
defining on the graph.
4. Choose the name of the series. To the right of the menu box called Name: , click the little
red/white/blue button. The Chart Wizard window disappears, and you may now choose a cell
from the spreadsheet that contains the name of the series. Click on the cell that reads F(N) ,
then press enter. The Chart Wizard window will reappear.
Or you can simply type the name of the series in the menu box.
5. Below the Name selection box are the selection boxes for the x-axis and y-axis series. Select
the series cells just like you selected the name in step 4.
6. After selecting the x- and y-axis series, click Next >.
7. You can now select chart options. Under the Titles menu tab, enter the name of the x-axis:
“Spring Displacement, x (mm).” For the y-axis, enter “Spring Force, F (N).” Erase the chart
title; you will enter a title for the graph when you import the graph into the word processor.
8. After entering titles, click click Next >.
9. Finally, Leave the default location of the chart “as an object in Sheet 1.” Click Finish.
You should now have a plot that looks something like this:
120
100
80
60
F (N)
40
20
0
0
2
4
6
8
10
12
Spring Displacement, x (mm)
A.3 Formatting the Graph
Unfortunately, the default format for an Excel graph is not typical for reports. Let’s reformat the
graph. Later we will define the style so we don’t have to keep reformatting each time we make a graph.
A-2
1. First, change the font size on the axes and titles. Otherwise, if we resize the graph, the font size
may not be appropriate.
a. With the mouse cursor inside the chart box but outside of the actual graph, right-click to
view a pop-up menu.
b. Click Format Chart Area…, and choose the menu tab Font.
c. Under Size, choose 10 or 11 point font size.
d. Then locate a checkbox called Auto scale and unselect it. By unselecting this box, the
size of the font will not change when you change the size of the plot.
e. Click OK, which returns you to the spreadsheet.
2. Next, change the background color of the plot from gray to clear.
a. Right-click on the plot area, and choose Format Plot Area… from the pop-up menu.
b. Under Area, select the button marked None, then click OK.
3. Now let’s remove the horizontal lines from inside the plot.
a. Right-click on one of the horizontal lines to open a pop-up menu.
b. Click Clear. The horizontal lines should disappear.
At this point, the graph should look something like this:
120
100
80
60
F (N)
40
20
0
0
5
10
15
Spring Displacement, x (mm)
4. The symbols are actually colored blue in the above graph; colored symbols can often cause
confusion, especially when printed in black-and-white. Let’s change the color of the symbols,
and in fact make them a bit larger:
a. Right-click on one of the data symbols to open a pop-up menu, and select Format Data
Series...
b. Under the menu tab Patterns, in a sub-menu called Marker, you’ll notice that the
marker’s Foreground color has been chosen to be Automatic. Change the color to black
by selecting that color from the pull-down window.
c. Repeat step b for the Background color.
d. Change the Size of the marker to 6. The selection is just below the Background selection.
5. Just for the fun(?) of it, let’s change the shape of the plot from rectangular to square. Just
highlight the entire chart, and click and drag one of the corners to vary the shape and size of the
plot. You’ll notice that the text inside the chart does not change. Adjust the shape of the plot
until it is square. The plot should now look like:
A-3
120
100
80
60
F (N)
40
20
0
0
5
10
15
Spring Displacement, x (mm)
6. For aesthetics, we often move the legend to the inside of the plot. Do this by clicking and
dragging the legend to the inside right bottom corner of the plot.
7. Finally, you may have noticed that all the plots printed here have a border around them. Let’s
remove this.
a. Click on the chart (outside the plot area), right-click, and select Format Chart Area…
from the pop-up menu.
b. Under the Patterns menu tab, and under the sub-menu Border, select None.
c. Click OK to exit the menu. You will now see that the chart border has been removed.
The graph should now look like:
120
100
80
60
40
20
F (N)
0
0
5
10
15
Spring Displacement, x (mm)
A.4 Adding a Trendline
Often it is necessary to curve-fit the data using regression. In Excel, it is called a trendline. The
procedure follows:
A-4
1. Right-click on one of the data points to open a pop-up menu.
2. Choose Add Trendline.
3. Under the menu tab Trend/Regression Type, you can choose the type of curve you want to fit to
the data. Often you will choose a straight line (Linear type), but this time the data appears to be
parabolic (second-order polynomial). Choose Polynomial, then select a power of 2. Click OK.
The plot now looks like this:
120
100
80
60
40
20
F (N)
Poly. (F (N))
0
0
5
10
15
Spring Displacement, x (mm)
4. We can also display the curve-fit equation on the graph. To do this, right-click on the curve-fit
line, and select Format Trendline from the pop-up menu. Select the Options menu tab, and select
the box entitled Display Equation on Chart.
5. While we’re there, let’s change the name of the curve-fit. Under the Options menu tab, beneath
Trendline Name, select the box entitled Custom: , and type in “2nd order curve fit” in the box.
6. Click OK.
Spring Force, F (N)
Now the graph should look like this:
120
2
y = 0.7364x + 2.3138x - 2.2646
100
80
60
40
F (N)
20
0
0
5
10
2nd order
curve15
fit
Spring Displacement, x (mm)
A-5
7. You must change the symbol “y” in the equation to “F.” You can do this by clicking once on the
equation and editing it directly.
8. You will also want to change the size of the plot, as well as the font size for the equation and the
legend, in order to make the graph more presentable. Experiment with Excel to discover how to
do this.
After all is said and done, your plot should look something like this:
120
F = 0.7364x 2 + 2.3138x - 2.2646
Spring Force, F (N)
100
80
60
40
F (N)
20
2nd order curve fit
0
0
2
4
6
8
10
Spring Displacement, x (mm)
12
A.5 Saving the Graph Format
To save time later, you can save this format and call it up later.
1. Right-click on the chart, and choose Chart Type from the pop-up menu.
2. Under the menu tab Custom Types, beneath where it reads Select From, select User-Defined.
3. Click the Add… button, enter a name (and a description if you like), and click OK.
The named chart type now appears under the list of custom chart types. When you make a chart, you
will now be able to select this as your format when you are creating a new graph. You can even set
this as your default style.
A.6 Importing the Graph into Word
We can now (finally) import the graph into our Word Document.
1. Open MS Word, and keep Excel open.
2. In Excel, right-click on your chart. Choose Copy from the pop-up menu.
3. Go to Word, and move the cursor to where you want to paste the plot. Right-click and choose
Paste from the pop-up menu. The graph should now be in your document!
A-6
4. Write a figure number and descriptive title below it. Center both the graph and the title. Your
figure should now look like this:
120
F = 0.7364x 2 + 2.3138x - 2.2646
Spring Force, F (N)
100
80
60
40
F (N)
20
2nd order curve fit
0
0
2
4
6
8
10
Spring Displacement, x (mm)
12
Figure 1. Measured spring force as a function of displacement.
A-7
Appendix B
How to Make Tables with MS Excel and Word 2000
In this section, we will learn how to make basic tables using MS Excel and Word. Like Appendix
A, this appendix is only an introduction, not a complete guide.
Let’s start with the spring force measurement data we used in Appendix A:
Spring
Displacement, Spring Force,
x (mm)
F (N)
1
2
2.2
5.1
5.8
34.52
6.5
45
10.1
99.91
11
110
We will enter this data in a table created in Word. In Section B.7, we will learn how to import this
spreadsheet data directly into Word, and manipulate the format from there.
B.1 Creating a Table in MS Word
1. Locate the Table pull-down menu in Word. Using the mouse, pull down Table, then choose
Insert, then choose Table…
2. Under Table Size, choose 2 columns and 6 rows. This corresponds to the data listed above. Click
the OK button.
A table should appear like the one shown below:
3. Enter the data listed above in each cell, as shown below.
1
2.2
5.8
6.5
10.1
11
B-1
2
5.1
34.52
45
99.91
110
B.2 Formatting the Table and Data.
We now have the basic form of a table in Word, but it needs to be formatted.
1. Center the data. To do this, highlight all the cells by clicking and dragging with the mouse, then
from the toolbar, click on the Center Justify button
.
2. Make the significant digits uniform (one decimal place for the first column, two for the second).
The table should now look like:
1.0
2.2
5.8
6.5
10.1
11.0
2.00
5.10
34.52
45.00
99.91
110.00
3. Shrink the table to a more reasonable size. If you hold the mouse’s cursor over the table, two
icons will appear on the table as shown below. Click and drag on the lower right icon to make
the table smaller.
Changes
table size
Highlight or
move table
4. Center the table. You can do this one of two ways: You can click and drag the top left icon
shown above; alternately, you can highlight the entire table by just clicking the same icon, then
clicking the Center Justify button
as before.
The table should now look something like that shown below.
1.0
2.2
5.8
6.5
10.1
11.0
2.00
5.10
34.52
45.00
99.91
110.00
B.3 Adding Data Labels and Table Title
1. The data labels should be part of the table (not outside it), so let’s add a row for labels. To do
this, highlight the first row of the table by clicking and dragging with the mouse. Then from the
pull-down menus, choose Table, then Insert, then Rows Above. A blank row should now appear
at the top of the table. Type the data labels in the cells as shown below.
B-2
Spring
Displacement, mm
1.0
2.2
5.8
6.5
10.1
11.0
Spring Force, N
2.00
5.10
34.52
45.00
99.91
110.00
2. Add a Table Title as shown below. Center the title. Note that the table is numbered, and the title
is descriptive – not just “Force vs. Displacement.” Also note that the title does not appear within
the table, but above and outside it.
Table 1. Measurement of spring displacement under compression.
Spring
Displacement, mm
1.0
2.2
5.8
6.5
10.1
11.0
Spring Force, N
2.00
5.10
34.52
45.00
99.91
110.00
The table is complete, but there are a few more tricks we will find useful.
B.4 Aligning Data at the Decimal Point
You saw that we centered the data in each column, but that’s not the best way to present the data.
Ideally, the data is easiest to read if they are aligned by the decimal point. Doing this is easy, so
there’s no excuse for not doing this once you know how.
1. Highlight all the cells containing data. Then click the Align Left button
on the toolbar.
2. With the data cells still highlighted, click on the tab selection button on the left side of the tab
bar until the Decimal Tab appears. This is shown in the figure on the next page. With
Decimal Tab chosen, click and drag on the tab bar to locate the tab at the center of the
column. Note that this sets the tab for all the highlighted data, not just the first column.
B-3
Tab
selection
button
Click and
drag to
locate tab
here
Your table should now look like that shown below.
Table 1. Measurement of spring displacement under compression.
Spring
Displacement, mm
1.0
2.2
5.8
6.5
10.1
11.0
Spring Force, N
2.00
5.10
34.52
45.00
99.91
110.00
B.5 Changing Cell Borders and Lines
Sometimes changing the line type on a table, or even deleting them, can make the table more
readable. Although the table we’ve created is sufficiently formatted, we’ll make a few changes to it
just to show how this works.
1.
Let’s put a thicker line between the data labels and the data, to help separate them.
Highlight the top row of the table, which contains the data labels. Right-click with your
mouse, and in the pop-up menu that appears, choose Borders and Shading.
2.
There are three sub-menus available: Borders, Page Border, and Shading. In the Borders
submenu, click on the Custom button on the lower left. Under Width, choose 1½ point
thickness. Then under Preview, click on the bottom line of the cell. The line should
appear thicker. Click OK, and the change should appear on your table.
3.
You can also change the style of the line within this menu. As an exercise, see if you can
change the vertical line between the two columns to a double line. The results are shown
below.
B-4
Table 1. Measurement of spring displacement under compression.
Spring
Displacement, mm
1.0
2.2
5.8
6.5
10.1
11.0
Spring Force, N
2.00
5.10
34.52
45.00
99.91
110.00
B.6 Inserting columns; Splitting and Merging Cells
Let’s say we’d like to present the force data in units of both newtons and pounds-force, and we’d
like the table to look like the one that follows:
Table 1. Measurements of spring displacement under compression.
Spring
Displacement, mm
1.0
2.2
5.8
6.5
10.1
11.0
Spring Force
N
2.00
5.10
34.52
45.00
99.91
110.00
lbf
0.45
1.15
7.76
10.12
22.46
24.73
Notice that a column has been added to the table, but also that the cell containing the text “Spring Force”
spans two columns. In this section, we will learn how to accomplish this.
1. Add a column to the table: Using the table we created in Section B.5, highlight the entire second
column of the table. Then right-click, and in the pop-up menu that appears, choose Insert
Columns. The table now looks like that shown below.
Table 1. Measurement of spring displacement under compression.
Spring
Displacement, mm
1.0
2.2
5.8
6.5
10.1
11.0
Spring Force, N
2.00
5.10
34.52
45.00
99.91
110.00
2. Move the data and label in column 3 to column 2 as follows: Highlight column 3, right-click, and
from the pop-up menu choose Cut. The entire column will disappear. Then in the blank column
that remains, right-click, and choose Paste Columns from the pop-up menu. The table should
now look like the following:
B-5
Table 1. Measurement of spring displacement under compression.
Spring
Displacement, mm
1.0
2.2
5.8
6.5
10.1
11.0
Spring Force, N
2.00
5.10
34.52
45.00
99.91
110.00
3. Split the cell labeled “Spring Force, N” into two cells, one on top of the other. To do this, rightclick on the cell and choose Split Cells from the pop-up menu. Choose 1 column and 2 rows,
then OK. Repeat this for the cell to the right, so that the table looks like:
Table 1. Measurement of spring displacement under compression.
Spring
Displacement, mm
1.0
2.2
5.8
6.5
10.1
11.0
Spring Force, N
2.00
5.10
34.52
45.00
99.91
110.00
You’ll notice that the cell borders aren’t right – we’ll take care of that last.
4. Merge the cell labeled “Spring Force, N” with the one on its right: Highlight both cells, then rightclick and choose Merge Cells from the pop-up menu. Now, delete the text “, N” from that cell, and
below it, label the two columns “N” and “lbf” as shown below. Enter the data in the last column.
Table 1. Measurement of spring displacement under compression.
Spring
Displacement, mm
1.0
2.2
5.8
6.5
10.1
11.0
Spring Force, N
N
2.00
5.10
34.52
45.00
99.91
110.00
lbf
0.45
1.15
7.76
10.12
22.46
24.73
4. Finally, change the cell borders as before so that the table looks as shown below.
B-6
Table 1. Measurement of spring displacement under compression.
Spring
Displacement, mm
1.0
2.2
5.8
6.5
10.1
11.0
Spring Force
N
2.00
5.10
34.52
45.00
99.91
110.00
lbf
0.45
1.15
7.76
10.12
22.46
24.73
B.7 Creating Tables from Excel Spreadsheets
In the previous sections, we created a table from scratch in Word. But if your data is already
available in an Excel spreadsheet, you can import the data directly without having to retype the data. But
beware: simply importing data from a spreadsheet does not make a proper table. You must still follow
the basic rules of presentation. To see how this works, we will begin again with the data we entered in
Excel in Appendix A:
Spring
Displacement, Spring Force,
x (mm)
F (N)
1
2
2.2
5.1
5.8
34.52
6.5
45
10.1
99.91
11
110
1. First, import the data into Word: While in Excel, highlight the cells containing the data and
labels, and right-click. A pop-up menu will appear; choose Copy. Then open your Word file,
right-click where you want to place the table, and choose Paste from the pop-up menu. The
result should look something like this:
Spring
Displacement, Spring Force,
x (mm)
F (N)
1
2
2.2
5.1
5.8
34.52
6.5
45
10.1
99.91
11
110
B-7
2. The cells are indicated by their gray borders; these borders will not appear when you print your
report, so let’s change the lines to black. Highlight the entire table, and right-click. Choose
Borders and Shading from the pop-up menu. On the left of the Borders sub-menu, choose All.
Then under Color, choose Automatic (which should be black). Your table should now look like:
Spring
Displacement, Spring Force,
x (mm)
F (N)
1
2
2.2
5.1
5.8
34.52
6.5
45
10.1
99.91
11
110
3. At this point you can use the techniques of the previous sections to modify the table to the proper
format.
B-8
Appendix C
How to Make Equations with MS Equation 3.0
C.1 Inserting an Equation
To insert an equation, choose Insert from the pull-down menus, then Object, then MS Equation
Editor. A window should appear as below. Alternatively, a blank box may open with the equation
toolbar.
Note: If you can’t find MS Equation Editor among the list of objects to be inserted, it probably wasn’t
installed on your machine. MS Equation Editor comes with MS Word, but often the standard installation
doesn’t include it. You can install Equation Editor after the fact by running the install software that
comes with MS Word.
C.2 Entering Characters
All keyboard characters can be entered directly. Parentheses, brackets and braces can be entered
from the keyboard, but these are fixed in size. Brackets that will "grow" must be selected from the
appropriate template.
C.3 Entering Symbols
The symbols printed on the menu buttons provide information as to the characters available under
each button. The symbol palettes are shown below:
C-1
Relationship symbols; equality;
inequality; equivalence
Alignment symbols; spacers;
ellipsis
Logic symbols
Set theory symbols; union; intersection;
containment
Miscellaneous symbols; gradient; degree;
Planck’s constant
Accents; primes; hats; dots
Operators; multiplication; division;
dot product
Lowercase Greek
Arrows
Uppercase Greek
C.4 Entering Templates
The second row of palette buttons contains template palettes to provide placeholders for entering
information. For example:
Brackets, braces and parentheses
(that expand with their contents)
Overbars and underbars
Fractions; radicals; long division
Labeled arrows
Subscript; superscript; other
over/under positioning
Products and set theory
Summations
Matrices
Integrals
C.5 Example: Entering an Equation
This example will demonstrate how to insert the following common mathematical equation:
⎛⎜ − b ± b 2 − 4ac ⎞⎟
⎝
⎠
x=
2a
1. Type "x=" from the keyboard
2. Choose a fraction from the template.
3. Select parentheses from the template (NOT the keyboard).
4. Type "-b" from the keyboard.
5. Select "plus or minus" from the palette.
6. Select a radical from the palette.
7. Type "b" from the keyboard.
8. Select the superscript from the palette.
9. Type a "2".
10. Tab (or cursor) to come down a level, and type "-4ac".
11. Tab (or cursor) to move to the denominator, and type "2a".
TIP: You can use Control-Space to enter single blank spaces. Other spacing options are available in
the symbols palatte.
C-2
C.6 Stacking and Aligning Equations
Equations can be stacked in a pile. To do this, simply press the Return key to begin a new line. To
align this pile at a character, such as an equal sign, choose "align at" from the Format menu.
C.7 Positioning of Equations
Equations can appear in-line (for example, like this: x =
α
) in a line of text. The line spacing
β
will adjust automatically. If you wish to have equations appear in a paragraph by themselves, simply press
Return before and after the equation. The best way to position an equation when on a separate line is to
center the equation using tabs. You can also add a caption, e.g. (2.3), to the equation using tabs. This is
demonstrated below:
⎛⎜ − b ± b 2 − 4ac ⎞⎟
⎠ .
x=⎝
2a
Choose tab type
(center, right, left,
etc.) with this button
(C.1)
Center tab
Right tab
C-3