CHM 152 Lab 1: Plotting with Excel updated: May 2011 Introduction In this course, many of our labs will involve plotting data. While many students are nerds already quite proficient at using Excel to plot data, there are quite a few who rarely, if ever, even run the program. This lab will ensure that everyone not only knows how to use Excel to plot data, but how you re expected to prepare your graphs in this course. There are several advantages to using a spreadsheet program like Excel for graphing. First of all, they usually look better than a hand-drawn plot (especially those drawn by students trying to get our of lab as quickly as possible) and once you get the hang of using Excel, it s usually a lot faster to plot your data than doing it by hand. Also, many of you are already familiar with the most commonly used plots, those that follow a linear relationship, y = mx + b, where m is the slope of the line and b is the y-intercept. With Excel, not only can it more accurately best-fit the line, but can also automatically generate the linear equation for you. Linear plots you prepare in this and future labs should be formatted as follows: It should take up an entire page. It should be formatted so the data uses as much of the page as possible. For example, Excel plots usually include the origin (0,0) by default, but if your first data point is at (25, 40), you might end up with a page full of blank space and a 1-2 inch line in the top right corner. It should include a title and both axes should be properly labeled (value measured and units). If you re only plotting one set of data, remove the legend to give your plot more space (plus, I just think it looks better). Linear plots should include the equation (y = mx + b) as well as the R 2 value. R 2 is a statistical value between 0-1 that measures how linear your data is. Data that s perfectly linear (i.e., no best-fitting required) has a value of 1. It s a convenient way for you (and the instructor) to gauge how accurate your data is. Graphing Linear Data with Excel Example: The following data was collected, which measured the boiling point of an aqueous solution over various concentrations. Concentration (m) Boiling point ( C) 1.34 100.60 1.89 101.18 2.58 101.61 3.76 102.70 1. Open Excel and insert your data anywhere in the spreadsheet. The first column should be the independent variable (i.e., the property you re controlling), which we put on the x-axis, and the second column should be the dependant variable (i.e., what you re measuring), which goes on the y- axis. Here, we re measuring boiling point by varying concentration, so boiling point is the dependant variable and concentration the independent variable.
2. Select all of your data, including the headers (in this case columns A and B, rows 2 through 6), and select the chart button (see below) to bring up the Chart Wizard. 3. The first step is to select your Chart Type. Select XY (Scatter) and choose the first subtype, without any connecting lines (we ll add the line when we best-fit, which happens later). To preview your chart, use the Press and Hold to View Sample button. Hit Next to continue. 4. The second step of the Chart Wizard shows you a preview of your plot. If it looks OK (which it should if you ve done everything correct up to now), simply hit Next. 5. Step three of the Chart Wizard is where you add the chart title and label the axes. This is also where you can do other aesthetic changes, such as varying the number of gridlines and showing or hiding the axes, chart legend or data labels. Play around with the other fours tabs in this step, checking and unchecking boxes until you see what each feature does, then click Next when you re done. [Note: don t worry about including special symbols, such as the degree symbol, in you titles.] 6. The last step of the chart wizard gives you the option to displaying your chart in the current sheet or in a new sheet (it doesn t really matter).
7. To add a best fit line, right-click on one of your data points (all of your points should highlight yellow if you do it correctly), and select Add Trendline 8. In the Type area the Linear trend type should already be selected (for other types of plots, select the one that seems most appropriate). To add the equation and R 2 value, select the Options tab and check the bottom two boxes. Click OK to return to your graph Click and drag the box displaying the equation and R 2 value to move it somewhere that won t be obscured by the gridlines or other parts of your plot. To remove the legend, right-click on it and select Clear (it can also be removed in step 5). At this point the plot should look something like this:
9. Your plot doesn t need to include the origin (0,0). If there is a significant amount of empty space on your graph, as is the case here, you can rescale your axes so they start or end with a new value. For example to reformat the x-axis above so it begins with 1.00 m, right-click on the x-axis and to bring up the box below (if a different box comes up you didn t click on the x-axis). Select Format Axis 10. Select the Scale tab. In Minimum: box change 0 to the new value (in this case, 1.00). The box under Auto should now be unchecked, since you re now manually scaling the x-axis (if you check it again, it will reset to zero). Hit OK to return to your graph.
Steps 9 and 10 can also be done with the y-axis to rescale it. For this graph, the y-axis was also rescaled to a minimum of 100.50, which gives the following 11. If you chose to display your graph in a new sheet (step 6), simply hit the print button to print out your plot as a whole page. If you displayed it in the same sheet as you data, right-click anywhere in the white area of your plot and select Chart Window. This brings up your graph in a new window, which should now print as a whole page when you click on the print button.
Name: Section: Questions 1. Prepare a plot of concentration vs. boiling point like the one shown in step 10 of this lab, using the same data used in that example (see page 1). Print this plot as part of your assignment. 2. The volume of a gas was measured at various temperatures at a constant pressure, giving in the following data. Temperature ( C) Volume, (L) 30.0 24.84 40.0 25.66 50.0 26.49 60.0 27.94 70.0 28.12 80.0 28.99 a) Plot the data, reformatting as needed, and note the linear equation and R 2 below. Print this plot as part of your assignment. y = R 2 = b) In this course, there s usually insufficient time to repeat a trial or measurement, so it s usually acceptable to omit one bad data point from your plot, so long as you have at least three others to work with. From your data table, remove the entry at 60.0 C (simply highlight the two boxes and hit Delete ). Excel should automatically remove this point from the plot. Write the new linear equation and R 2 below. You don t have to print a copy of this plot. y = R 2 = c) Using the linear equation from 2b, calculate the expected volume of this gas at -20.0 C? d) Using the linear equation from 2b, calculate the temperature for a volume of zero. e) The slope of 2b should look a little familiar, at least to the first significant figures. Identify this number (hint: see Chapter 5 of your textbook).