# Graphing a Function: Basics

Excel can generate many different kinds of plots. We will only discuss generated a graph of a function such as you're used to in math classes. You can use this to plot any complicated function you come across, including problems in your homework as well as the labs.

## Step 1: Create a Data Table

You first need to create a table of values.

1. Decide what range of x values you wish to plot, and what step size you will use. (Hint: Smaller step sizes make larger tables, but tend to give nicer looking graphs.)
2. Create a column of x values by copying or filling the series down.
3. Enter the formula for the y values in the column to the right of the x values, and then fill that formula down the column.

You now have a table of x and y values.

We will use as an example a plot of the function y = e2 x+1 on the interval from -1 to 1 using a step size of 0.1. We fill in column A with x values, then enter =EXP(2*A2)+1 in cell B2 to start the formula. (See Special Functions for information on the exponential function.) Finally we copy the formula down, and we get the table at the right. (We have cut out several intermediate rows to make it shorter.)

Now you are ready to go to Charts to make your graph.

 A B 1 x y 2 -1 1.14 3 -0.9 1.17 4 -0.8 1.20 5 -0.7 1.25 6 -0.6 1.30 ... ... ... 15 0.4 3.23 16 0.5 3.72 17 0.6 4.32 18 0.7 5.06 19 0.8 5.95 20 0.9 7.05 21 1 8.39

## Charts

• Highlight the data but not the labels.
• Choose Charts from the choices listed horizontally directly under the tool box.
• A third menu bar opens. The last choice is X Y (Scatter). Choose that graph. (This is the most common graph for this course). Then choose an xy-scatter plot connected with smoothed lines, either with the points showing or not.
• Notice that when your chart is selected, you have more options available in the Formatting Palette. You can title the graph, then the axes. You may click on Legends, then choose None.
• To make any changes to the graph: With the graph selected, choose Chart in the menu and choose from the highlighted list. You may also make changes to the graph by double clicking on the part of the graph you wish to change. An options box will appear. For instance, click on the y-axis if you wish to change the scale on the y-axis.