creating graphs with excel 2007 - ualberta.caphylabs/graphsexcel2007.pdf · creating graphs with...

6
1 Creating Graphs with Excel 2007 These instructions are for a Windows platform. All mouse operations will be made with the left button, unless otherwise stated. Do not change any Default settings, unless otherwise stated. Open MS OFFICE EXCEL 2007 Inputting Data Record data from your lab notebook into the spreadsheet, using the 1 st (A) column for the x data and the 2 nd (B) column for the y data. Modifying Data In some cases, you will have to modify your raw data (e.g. take the square root). It is easier to use Excel to do identical calculations to many data points than to use a calculator. Here’s how you can add an equation to one single cell of data and then apply it to the rest of the column: Applying a Calculation to a Column of Data 1. Select the first cell of a new empty column (e.g. if you wish to apply a calculation to A1, then choose C1 as the location for the result). 2. Click on the text box directly above the spreadsheet (to the right of the f x button). a) To add your own formula, first type the equal sign (=). This tells Excel that you are writing an equation and not plaintext. Then, type in your equation. Say you wanted to multiply cell A1 by 3. You would type “=3*A1”. Press Enter. The calculated value should now appear in the cell. b) To use a pre-defined formula in Excel, click on f x to the left of the text box. A window will pop up with a list of pre-defined formulas. Select the desired formula. Say you wanted to take the square root of A1. Select SQRT() from the list. Then another pop up window will ask you for the arguments. Type “A1” in the Number field. Select OK. Applying the Calculation to the Rest of the Data in the Column 1. Click on the new cell you just created. Say this is C1. Click and hold onto C1 and drag the mouse so that you highlight the rest of the desired cells. 2. Go to Editing Box in the Home Tab. 3. Select Fill and Down (or press CTRL +D). The entire column should now be filled. Graphing Data Here we show you how to graph a series of data (x,y) in Excel. 1. Use the mouse to highlight the rows and columns you wish to plot. 2. Go to Insert Tab in the Menu Bar. 3. In Chart Box, all types of charts are presented. In Chem 37X, you will only need to create scatter plots.

Upload: others

Post on 02-Nov-2019

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Creating Graphs with Excel 2007 - ualberta.caphylabs/graphsExcel2007.pdf · Creating Graphs with Excel 2007 These instructions are for a Windows platform. All mouse operations will

1

Creating Graphs with Excel 2007 These instructions are for a Windows platform. All mouse operations will be made with the left button, unless otherwise stated. Do not change any Default settings, unless otherwise stated. Open MS OFFICE EXCEL 2007 Inputting Data Record data from your lab notebook into the spreadsheet, using the 1st (A) column for the x

data and the 2nd (B) column for the y data. Modifying Data In some cases, you will have to modify your raw data (e.g. take the square root). It is easier to use Excel to do identical calculations to many data points than to use a calculator. Here’s how you can add an equation to one single cell of data and then apply it to the rest of the column: Applying a Calculation to a Column of Data 1. Select the first cell of a new empty column (e.g. if you wish to apply a calculation to A1,

then choose C1 as the location for the result). 2. Click on the text box directly above the spreadsheet (to the right of the fx button).

a) To add your own formula, first type the equal sign (=). This tells Excel that you are writing an equation and not plaintext. Then, type in your equation. Say you wanted to multiply cell A1 by 3. You would type “=3*A1”. Press Enter. The calculated value should now appear in the cell.

b) To use a pre-defined formula in Excel, click on fx to the left of the text box. A window will pop up with a list of pre-defined formulas. Select the desired formula. Say you wanted to take the square root of A1. Select SQRT() from the list. Then another pop up window will ask you for the arguments. Type “A1” in the Number field. Select OK.

Applying the Calculation to the Rest of the Data in the Column 1. Click on the new cell you just created. Say this is C1. Click and hold onto C1 and drag the

mouse so that you highlight the rest of the desired cells. 2. Go to Editing Box in the Home Tab. 3. Select Fill and Down (or press CTRL +D). The entire column should now be filled. Graphing Data Here we show you how to graph a series of data (x,y) in Excel. 1. Use the mouse to highlight the rows and columns you wish to plot. 2. Go to Insert Tab in the Menu Bar. 3. In Chart Box, all types of charts are presented. In Chem 37X, you will only need to create

scatter plots.

Page 2: Creating Graphs with Excel 2007 - ualberta.caphylabs/graphsExcel2007.pdf · Creating Graphs with Excel 2007 These instructions are for a Windows platform. All mouse operations will

2

4. Select Scatter drop down menu and select Scatter with only markers option as the Chart type. (Should be top left of drop down menu.)

5. A plot will appear on the current spreadsheet. 1Describes how to check that correct values have been plotted for X and Y Values.

Presentation of Graphical Data in CHEM 37X The presentation of your graphical data is a critical element in your lab report. You will be graded on your data as well as the presentation of your graphs. Almost every lab will require some graphing, so it is best to learn the requirements now. Excel will only provide you with its default formatting, so you will be required to modify how the data is displayed (e.g. axis labels, gridlines, title, etc.). 1. First we need to place the graph in its own page.

a) Click on Move Chart

b) Select New Sheet and name as desired.

2. Most everything in terms of formatting will now be done from the Layout Tab.

a) Select the Chart Titles drop down menu. Select Above Chart. Type in the name of

the chart. Your chart should have a descriptive title, e.g., V vs h of Cylinder. b) To place axis labels select the Axis Titles drop down menu and do the following: i) Primary Horizontal Axis Title à Title Below Axis ii) Primary Vertical Axis Title à Rotated Title

Type in the labels for your axes with units, e.g. V (mL) and h (cm).

c) Select the Gridlines menu and select the following: i) Primary Horizontal Gridlines à Major and Minor Gridlines ii) Primary Vertical Gridlines à Major and Minor Gridlines d) Select the Legend tab. Click None.

To switch between editing your numerical data and editing the graph, use the tabs found at the bottom of your screen. However, there are some more customizations that are required for the graph.

Page 3: Creating Graphs with Excel 2007 - ualberta.caphylabs/graphsExcel2007.pdf · Creating Graphs with Excel 2007 These instructions are for a Windows platform. All mouse operations will

3

A valuable feature in Excel is the Chart Toolbar. It is very useful for formatting the look of the graph and, if all steps were followed above, should contain all areas needed for customization.

In order to edit one of the properties of the Chart, select the one you want with the drop-

down box on the Chart Toolbar, then click on the button to the right of the drop-down box; the appropriate window will pop up.

1. Select Plot Area from the Chart Toolbar. Click Format Selection. A pop-up window will appear. a) Select Fill à No Fill

2. Select Horizontal (Value) Axis from the Chart

Toolbar & click Format Selection. A pop-up window will appear. a) Click on the Line Style tab. Change the

Width of the Lines to be 2. b) Under Axis Options ensure: i) Major tick mark type à Outside ii) Minor tick mark type à None iii) Axis labels à Low

You will want to choose your axes such that you display all your data points but do not leave too much white space (little if at all). c) Still under Axis Options. The Minimum, Maximum, Major unit and Minor unit should

not be automatically chosen; change from Auto à Fixed. d) Specify your own values. i) Choose the Minimum and Maximum according to the range of your x (1 and 3 for

this tutorial). ii) The Major unit defines the spacing of your major gridlines and should be chosen to

allow for easy analysis (try 0.1 for this tutorial). The Minor unit should reflect the precision of your data (it should be 0.001 for this tutorial, but it will be too difficult to read; try 0.01 instead). The Major unit should be no smaller than 1 cm and the Minor unit no smaller than 0.1 cm.

e) Still working within the pop-up. Click on the Number tab. Under category, select Number. Edit the number of decimal places according to the precision of your data (choose 0.001 for this tutorial). De-select ‘Use 1000 separator (,)’ if selected.

Page 4: Creating Graphs with Excel 2007 - ualberta.caphylabs/graphsExcel2007.pdf · Creating Graphs with Excel 2007 These instructions are for a Windows platform. All mouse operations will

4

*The precision of your axis should reflect the most common precision of your data e.g. if your x data is 1.2, 2.4, 4.1, 8.11, then choose 1 decimal place. In some cases, you may need to use the category Scientific to display your axes in scientific notation.

3. Repeat Steps 1 & 2 for Vertical (Value) Axis. However note the new values for Step 2: i) The Minimum and Maximum (4 and 10 for this tutorial). ii) The Major Unit (try 0.5 for this tutorial) and the Minor Unit (try 0.05 for this tutorial).

4. Select Horizontal (Value) Axis Major Gridlines from the Chart Toolbar.

a) Click on the Line Style tab. b) Change Line Width to 2.

5. Repeat step 4 for Vertical (Value) Axis Major Gridlines. 6. Select Series from the Chart Toolbar

a) Under the Marker Options tab choose the Type and Size of the data points (Marker) with the drop-down boxes. Make them big enough to see, but not huge (~ 8 pt – use your own discretion)

7. Go to Page Layout Tab.

a) Click Margins drop down menu. b) Select Custom Margins… c) Edit all four margins, header and footer to be 0. d) Your graphs should print full-size in Landscape format.

8. To maximize the plot within the print window, select Chart Area from the Chart Toolbar. a) Click Format Selection. b) Under Border Color select No Line. c) If graph is still not maximized in the print window, manually adjust by clicking and

dragging the adjustable border of the plot (adjustable border appears when you click anywhere within the graph).

9. To add a trendline to your data points, go to Chart in the Menu Bar. a) Select Trendline drop down menu. In this course any trendline that you will be asked to

plot will be linear so click on the Linear Trendline option. b) Select Series Trendline from the Chart Toolbar. Click Format Selection.

Checkmark Display equation on chart and Display R-squared value on chart. c) On the graph, click and drag the y=mx+b and R² equations to the top-right corner of

your graph (in the blank region).2 10. Save the Excel spreadsheet. If you are in the 37X computer lab, make sure you save the

file onto a memory stick or floppy. 11. Print out your graph and paste/staple it onto a left-hand side page of your notebook. Be

aware that you will be producing many graphs for this course, so make sure your attached sheets are neatly placed and secure in your notebook.

Page 5: Creating Graphs with Excel 2007 - ualberta.caphylabs/graphsExcel2007.pdf · Creating Graphs with Excel 2007 These instructions are for a Windows platform. All mouse operations will

5

(Note: Data point size in above figure is TOO BIG (12pt). Only selected this way for this

instruction manual to improve the clarity of the picture.) Footnotes 1 a) Under the Design heading, click on the Select Data button. Highlight the appropriate

data series, click Edit and make sure the X Values and Y Values are correctly selected. Say that there are 4 data points in column A1 that should be on the x-axis. Then X Values should read "=Sheet1:$A1:$A4".

b) If the wrong data was selected, click on the tiny button to the right of the text box. You will now have a view of your spreadsheet data and another window, the Source Data- Value, will pop up.

c) Highlight the appropriate column on the spreadsheet with the mouse (a flashing box should appear around it). The correct range will be displayed on the Source Data- Value window.

d) Click on the tiny button to the right of the text box on the Source Data-Value window. The Series tab will appear again.

e) Make any other changes that you need. f) Click on Next. 2 If you cannot see the whole graph or the equation: a) Go to View in the Menu Bar. b) Select Zoom. c) Select a smaller magnification. d) Click on OK.

Page 6: Creating Graphs with Excel 2007 - ualberta.caphylabs/graphsExcel2007.pdf · Creating Graphs with Excel 2007 These instructions are for a Windows platform. All mouse operations will

6

Pointers for Creating (Computer-Generated) Graphs in CHEM 37X • Label the graph and axes with appropriate names (with units). • Anything handwritten on a graph must be in pen (except for the drawing of lines). • When asked to draw a curve through your data points, do so manually with a pencil. The

curve should be smooth and does not necessarily have to pass through all the data points. • Major and minor gridlines should be chosen to allow for ease of analysis. • Minor gridlines must be small enough to be able to read off to the precision of the data if

possible. • The data should take up most of your page (letter-sized). If not, adjust the max/min of the

axes accordingly. • When a linear regression is requested, also print out the Chem 37X regression template

where you entered your data. This must be taped into a left-hand side page of your notebook in an appropriate place in your writeup.