Graphing Tutorial Graphing is an important analysis tool in physics. It permits us to look for trends in data, identify outliers in our measurements, and extract information of interest about the system under investigation. Before we discuss how to derive information from a graph of experimental data, we begin with a review of the basic components of a graph and what criteria are necessary to create a good graph. Graphing Vocabulary A graph is a pictoral representation of how one variable behaves as a function of another. In an experiment, the independent variable is the parameter that we choose to vary systematically. It is usually plotted on the horizontal axis of the graph. The dependent variable, typically plotted on the vertical axis of a graph, is the response that we measure for a given choice of an independent variable. It is given this name because its value depends on our specific choice of the independent variable. In Figure 1 below, the independent variable is time, t, and the position of the person, y, is the dependent variable. 20 Position of Person Walking at Constant Speed Position (m) 15 slope = m = (13.6 m - 1.6 m) = 1.5 m/s (8.4 s - 0.4 s) (8.4 s, 13.6 m) 10 y = mt + b y(t=0) = b = 1 m 5 (0.4 s, 1.6 m) 0 0 2 4 6 8 10 Time (s) Figure 1: A linear plot of position as a function of time for a person walking at constant speed. The slope of the line is characterized by m, the constant that multiplies the independent variable (time in this example). The vertical-intercept, b, is obtained by evaluating y(t) at t=0. In this case, y(t=0)=b=1.0 m. Linear Functions Linear plots are of particular interest in this introductory lab course because we can extract useful information from the two parameters that characterize linear functions – the slope of the line and the yintercept. i Graphing Tutorial Physics 118/198/212 Any linear function can be described mathematically by the general form y = mx + b (1) where m is the slope of the line, and b is the y-intercept. What makes the function linear is that the dependent variable (y in this case) depends on the independent variable (x in this case) raised to the 1st ! power. If we identify two points on the line (x1, y1) and (x2, y2), the slope of the line can be determined from m= "y y 2 # y1 = "x x 2 # x1 (2) The slope of a line is a measure of its rate of change or steepness. Larger slopes correspond to steeper lines and smaller slopes are indicative of shallower lines. Positive slopes describe lines that head upward as you move from left to!right on a graph whereas negative slopes describe downward pointing lines as you move from left to right. The y-intercept (b in Eq. 1) is the value of y when x = 0. That is, y(x = 0) = b. In the example in Figure 1, y(t = 0) = b = 1.0 m. The y-intercept characterizes any vertical offset in the line. If b = 0, the line passes through the origin (0,0). The slope and y-intercept of a line are independent quantities. We can change the slope of a line without affecting the y-intercept, and conversely we can change the vertical offset in the line without changing the slope. We will take advantage of this fact many times throughout this course to eliminate systematic errors in our measurements. This idea will be discussed in more detail in the Measurements & Uncertainties lab. Transforming General Functions into Linear Functions Not all physical systems are described by linear relationships. For example, the distance an object falls freely under the influence of gravity, Δy, when released from rest is a quadratic function of time, t, $1 ' "y = (y # y 0 ) = & g ) t 2 %2 ( (3) A graph of Equation 3 reveals that the distance traveled by the object is described by a parabola. ! measure the acceleration of gravity near the Earth’s surface, g, we could If we wanted to experimentally drop a ball different distances and measure the time it takes for the ball to travel that distance. Rearranging Eq. 3 to solve for the dependent variable: "2% t 2 = $ ' ( )y #g& (4) A graph of t2 vs. Δy will yield a linear plot, because the equation has been manipulated so that the independent variable (Δy) is raised to the first power. The line will have a slope equal to (2/g) and will intersect the vertical axis at y=0. ! This type of linear transformation applied to power law (y = axn) and exponential functions (y = eax) permits us to create a simple linear plot from which useful information about our system under study can be easily extracted from the slope and/or intercept of a best fit line. ii Guidelines for Creating a Proper Graph Graphing is a visual form of conveying information about your experiment, and a good graph should be self-explanatory to someone with no prior knowledge about your experiment and who may have just walked into your lab for the first time. A reader should be able to take a quick glance at your graph and glean from it a substantial amount of information. All graphs should have a short title that uses written out words (not algebraic symbols or abbreviations). Do not simply title your graph “y vs. t2”. A quick look at your axis labels and the reader already knows the independent and dependent variables. This type of title does not provide the reader with any additional useful information. Instead you might choose a title like “Free-fall position as a function of time”. This type of title conveys more information to the reader and avoids technical jargon. To further help the reader interpret your graph, all axes should have labels followed by the appropriate units in parentheses. As with choosing titles, avoiding the use of variables or abbreviations in axis labels makes the graph easier to interpret. If more than one data series is plotted on the same graph, include a legend to clearly identify each data series. When plotting a series of experimentally determined data points, use individual symbols for the data points rather than connecting the points with a line (See Figure 2). Using symbols for discrete data points helps the reader realize that they are viewing discrete rather than continuous data. Reserve using a line on a graph to denote your best-fit line to the data set. In order to easily read and extract information from a graph, the graph should occupy at least half a page in your notebook. When graphs are smaller than this, the information becomes so compressed that it is difficult to extract any meaning from the plot. The ranges for the horizontal and vertical axes should be chosen large enough so that all the data points fit on the graph, but small enough so that the data span at least 75% of the graph area. When drawing a best-fit line to a data series, as many data points should fall above the line as below. The best-fit line need not pass through all of the data points. However, if error bars are present on the graph, the best-fit line should fall within the error bars for each data point. To calculate the slope from a best-fit line, choose two points that lie on the best-fit line. Actual experimental data points should not be used in the slope calculation unless they fall directly on the best-fit line. The rationale behind this is that the best-fit line takes into consideration your entire data set whereas any one measured data point is only representative of a single measurement. Any measurement performed in lab should have associated with it some uncertainty. These uncertainties should be plotted as error bars on your graphs to help the reader assess how much confidence should be placed in the experimental measurements. An example of a well drawn graph and a summary of these guidelines are provided on the following page. iii Graphing Tutorial Physics 118/198/212 A checklist for creating a good graph: • • • • • • • • • Include a short title that uses real words (not algebraic symbols). Label both axes and include the appropriate units for each in parentheses. Represent discrete data points by individual symbols. Reserve a line to denote a best-fit line to your data. Include a legend when more than one data series is plotted on the same graph. Occupy at least one-half page for every graph. Choose large enough ranges for the horizontal and vertical axes so that all data points fit on the graph. However, the ranges should be set small enough so that the data span at least 75% of the graph area. Choose a best-fit line so that as many data points fall above the line as below the line. Use two points from the best-fit line to calculate the slope. Do not use actual data points unless they fall directly on the best-fit line. Include error bars on data points when possible. Dependence of the Free Fall Time on Distance Traveled (1.9, 0.38) Measured Data Points Best Fit Line 2 Square of Free Fall Time (s ) 0.4 0.3 0.2 (0.38 ! 0.06)s2 slope = = 0.19 s (1.90 ! 0.25)m 0.1 2 m (0.25, 0.06) 0.0 0.0 0.5 1.0 1.5 2.0 Distance Ball Drops (m) Figure 2: Another example of a computer-generated graph. Allowances for local variations in the slope are shown by using error bars, the small tickmarks above and below each individual data point (in open circles). Not only can the slope be determined by the best-fit line (in this case, slope = 0.19 s2/m), but the variation in the slope can also be calculated using the range of the error bars. iv Computer-Generated Graphs Using Microsoft Excel Some of the graphs that you develop in this course will be sketched using the computer program LoggerPro. At times, though, you will need to produce graphs from manually collected data. One way to create such graphs is to use a spreadsheet program, such as Microsoft Excel, which is installed on each of the computers in the introductory physics lab rooms. It is also available in the computer labs around campus if you need to work on your lab write-up outside of your lab section. You may choose to use any graphing application to which you have access to create your hand-made plots. The remainder of this section provides brief descriptions of how to create and modify graphs using Excel. NOTE: If you use a computer to generate a graph for a lab write-up, you will need to print two copies for your lab notebook. Fasten one to the original page in your notebook that will be turned in for grading, and fasten the second one to the duplicate of your lab write-up that will be retained for your records. Creating a Plot Using Excel: • Enter a data series into a column on an Excel worksheet. • Highlight the cells containing the dependent variables to be plotted. • From the Insert menu, select Chart. This will bring up the Chart Wizard that will walk you through how to customize your graph. • Select the chart type and sub-type from the available choices. Click Next. • Select the Series tab. Select the spreadsheet button to the right of the Category X-axis labels box. On your spreadsheet highlight the cells containing your independent variables. Click the spreadsheet button in the collapsed window. This step tells Excel which data points to plot on the horizontal axis. Click Next to continue. • Select the various tabs on this pop-up menu to modify the look of your final graph. Titles, axis labels, grid lines, and legends are some of the parameters that can be adjusted on this menu. Click Next to continue. • Choose whether you want to place the graph on your current worksheet or on a different worksheet. Click Finish. • Click once on your chart to select it. Drag the chart to the desired position on your worksheet. • In order to resize your plot, click once to select the chart. Move your cursor over one of the black squares on the edges of the graph until the cursor turns into a double arrow. Drag the black square in the desired direction to resize the graph. Modifying a Plot Using Excel: • Select the graph by clicking once on it. A Chart menu will appear at the top of the window. • Select one of the sub-menu options to modify your graph. Adding a Best-Fit Line to a Graph in Excel: • Click on the graph once to select it. • From the Chart menu, choose Add Trendline. o From the Type tab, select Linear. Select the data series to which you want to fit a line. o From the Options tab, select Display Equation on Chart. Click OK. • The best-fit line will be added to your graph, and the equation will be displayed on the graph. You can drag the equation box to another part of the graph if the default position makes it difficult to read. v Graphing Tutorial Physics 118/198/212 Adding Error Bars to a Graph in Excel: • On the graph, select the data series to which you want to add error bars. • From the Format menu, choose Selected Data Series. • Select the X Error Bars or Y Error Bars tab and create the appropriate error bars for your data. Printing a Graph from Excel: • Highlight the cells you wish to print. • From the File menu, select Print Area Set Print Area. • From the File menu, select Print Preview to make sure what you intend to print is displayed as you like. You can modify the page setup from this mode. Once you are satisfied with how the printed page will look, select the Print button. vi
© Copyright 2026 Paperzz