Tips on Graphing with Excel
How do I add a trendline / line of best fit / regression line to a chart?
- Make a chart. Then, click anywhere on the chart.
- The word Data in the top menu bar of Excel should change to Chart.
- Click on Chart, and select Add Trendline
- Select the Linear option, and click OK.
- The trendline will be added to your chart.
- OPTION: If you click the Options tab, you will be able to check the box for Display
equation on chart. If you do, the regression equation for the trendline will be
printed. It may be useful in forecasting. If you dont like where the equation shows
up, click and drag it to a convenient place in the chart.
How do I get a line graph to compare two variables, the way a scatterplot does?
Line charts in Excel, along with column, bar, and area charts, are preset to
treat the data you highlight as the dependent variable(s) or the Y axis series. To treat
one variable as the category or X axis, do the following either as you first make a chart,
or after clicking on an existing chart and then the Chart Wizard (Graph) button:
- Select the chart type you want, say, Line. Click Next.
- Click the Series tab at the top. In the Series box, click on the series
that you want to use as the Category or X axis. Click the Remove button.
- In the Category (X) axis label box at the bottom, type in the cell address of the
category variable. If you prefer, click the tiny red arrow at the right of that box,
highlight the column of data in the worksheet for the category variable, and click the
down red arrow in the pop-up dialog box. Excel will insert the cell address for
you.
- Click Next, and add labels as usual.
How do I draw a histogram, with the bars touching?
- Histogram is found under Data Analysis
on the Tools menu,
rather than under charts. This tool will do a frequency distribution and then graph it for
you. Find and select Histogram.
- Enter the Input Range: by typing or highlighting the cells with the data you wish
to analyze and chart. The Bin Range is optional.
- Check the Chart Output box, and click OK.
- Excel
will provide a frequency distribution, and a chart. The bars will not be
touching, though.
- To make the bars touch,
double-click on any of the bars. In the resulting Format
Data Series dialog box, click the Options tab.
- Set Gap width to 0. Click OK.
Copyright Paul Young, 2000