Guide to Good Graphs: Scatter Graphs

Drawing graphs is an important part of presenting the results of your research. There are several types of graphs, but probably the most common are scatter graphs (also known as X-Y graphs). A good scatter graph has the following features:

  • a title at the top which summarizes what the graph is showing;
  • the independent variable on the x-axis (horizontal axis) and the dependent variable on the y-axis (vertical axis). The independent variable is the one that you manipulate, and the dependent variable is the one that you observe. For example, you might manipulate salt content in the diet and observe the effect this has on blood pressure. Sometimes you don't really manipulate either variable, you observe them both. In that case, if you are testing the hypothesis that changes in one variable cause changes in the other, put the variable that you think causes the changes on the x-axis. For example, you might plot "height, in cm" on the x-axis and "number of head-bumps per week" on the y-axis if you are investigating whether being tall causes people to bump their heads more often. Finally, there are times when there is no cause-and-effect relationship, in which case you can plot either variable on the x-axis; an example would be a graph showing the correlation between arm length and leg length.
  • labels on the x-axis and the y-axis. Where appropriate, these labels must include the units of measurement. Examples include "arm length, in cm," "time, in generations," and "number of head bumps per week."
  • numbers on the x-axis and the y-axis. These should be evenly spaced numbers, such as 0.4, 0.5, 0.6, 0.7.... Note that some graphing and spreadsheet programs give you a choice of two kinds of graphs that look similar; in Microsoft Excel they're called a "Line Graph" (which you don't want) and an "X-Y Graph." If the numbers on your x-axis aren't evenly spaced (for example, they go 0.45, 0.5, 0.6, 0.62, 0.63) it means you chose the wrong kind of graph. Each program seems to give different names to each kind of graph, so you may have to try different kinds of graphs until you get the right format.
  • symbols, connected by a line if appropriate. When there are more than one set of points, they should be labeled. This can be done by using different sets of symbols and then having a legend identifying the symbols, or by putting a label next to each line. If you only have one set of symbols, do not include a legend.
  • no fancy 3-dimensional USA Today-type effects. The clever use of 3-D effects can make things appear much bigger, smaller, more similar, or more different than they really are. These effects (which unfortunately are the default in CricketGraph) obscure information and are virtually never used in scientific graphs.
  • Drawing scatter graphs with a computer

    To draw a graph with a computer, you can either use a specialized graphing program such as DeltaGraph or CricketGraph, or you can use the graphing function of a spreadsheet such as Microsoft Excel, Lotus 1-2-3, or ClarisWorks. Graphing programs give you more flexibility and control over the appearance of your graph, but the graphs produced by a spreadsheet are perfectly adequate for all of your assignments. Here I'll give instructions for drawing a scatter graph using Excel, a spreadsheet program available on many of the Macintoshes and Windows computers on campus. The instructions for Excel will include drawing a regression line, necessary for Assignment 3.


    Drawing scatter graphs with Excel.

    For this example, we'll imagine that you're interested in finding out whether long-haired cats really do stay warmer in cold weather. You've measured the fur length of seven cats, measured their body temperature, put them outside on a cold day for one hour, then measured their body temperature again. You've done this twice for each cat, once on Wednesday and once on Friday.

    1. Open up Excel.
    2. Enter the names of the cats in column A (with two rows per cat). The first row should contain a heading, like "Cat names."
    3. Enter the fur length in column B. Note that each fur length gets entered twice.
    4. Enter the beginning body temperatures in column C and the final body temperatures in column D. Your spreadsheet should now look like this:
      Spreadsheet for scatter graph
    5. To calculate the change in body temperature, enter =d2-c2 in cell E2. Then copy that cell, drag your mouse across cells E3 through E15, and paste. The equation will be pasted into each cell, and the values will be automatically changed so that cell E3 contains =d3-c3, cell E4 contains =d4-c4, etc. This is one of the powerful features of spreadsheets.Your spreadsheet should now look like this:
      Spreadsheet for scatter graph
    6. Once you have all of your data entered, drag the mouse to select the data in column B (your independent variable), then hold down the Command key on a Mac or the Control key on a Windows machine and drag the mouse across column E (your dependent variable).
    7. Click on the "Chart Wizard" button. This is a tiny picture of a bar graph, or on some versions of Excel it's a tiny picture of a magic wand waving over a graph.
    8. The program will ask several questions. When it asks for a chart type, choose "X-Y (Scatter)" to get a scatter graph. Do not choose "Line"; the little picture may look like what you want, but it isn't.
    9. After you've answered a few more questions (make sure you give your graph a title, axis labels and no legend), you'll get a graph. To modify part of the graph, you can generally click on the part of the graph you want to modify to get a window giving you some choices.
    10. To add a regression line, click once on the graph to select it. The menu bar should now include a Chart menu. From that menu, choose Add Trendline, and then make sure the type of trendline you choose is Linear. (If you're using an older version of Excel, it may not have a way of automatically adding a regression line. In that case, see Graphing with older versions of Excel.
    11. Your final graph should look something like this:
      Scatter graph
    12. Once you've got the graph the way you like it, click once outside the graph window to get out of graph editing mode. You can now drag the graph around on the spreadsheet and make it bigger or smaller. You could print the whole spreadsheet, but it's more professional looking to include the graph in with your text. Click once on the graph to select it, choose Copy from the Edit menu, open up your word processing program (such as Microsoft Word), and Paste the graph in where you want it.

    Bar Graphs

    Another commonly used kind of graph is a bar graph. Graphing and spreadsheet programs often have a bewildering variety of formats for bar graphs, with the bars going vertically or horizontally, side-by-side or stacked on top of each other. It may take some trial and error until you find the format you want, so leave yourself some time for this. For the homework assignments in this class, you'll be doing bar graphs with different categories on the x-axis and numerical values for each category on the y-axis, so that there is one vertical bar per category.

    A good bar graph has the following features:

    Here is an example of a good bar graph:

    Graph of
plantain density vs. habitat


    Drawing bar graphs with a computer

    To draw a graph with a computer, you can either use a specialized graphing program such as DeltaGraph or CricketGraph, or you can use the graphing function of a spreadsheet such as Microsoft Excel, Lotus 1-2-3, or ClarisWorks. Graphing programs give you more flexibility and control over the appearance of your graph, but the graphs produced by a spreadsheet are perfectly adequate for all of your assignments. Here I'll give instructions for drawing a bar graph with Microsoft Excel, a spreadsheet program available on most of the public Macintoshes on campus. I imagine the instructions would be about the same for Excel for IBM-compatible computers, but I haven't tried it.

    1. Start the program by double-clicking on it.
    2. In the cells of column A, enter the category names ("site 1, site 2,..."). Next to them in column B enter the values (16, 23.6,...).
    3. Select the cells you've filled in by dragging the mouse over them.
    4. Click on the "Chart Wizard" button. This is a tiny picture of a magic wand waving over a graph. Then drag the cursor to form a rectangle somewhere on the spreadsheet. This is where your graph will be; you can always move it and change the size of it after you're done.
    5. The program will ask several questions. When it asks for a chart type, choose "Column" to get vertical bars. In the next window choose the format with bars next to each other; on the version of Excel I've seen, this is format 1.
    6. After you've answered a few more questions, you'll get a graph. It will need some modification. First, click on the graph and grab a corner. Drag this corner to make the graph window the size you want it.
    7. Next, double click on the graph. This will enable you to edit the graph by adding text, changing patterns, etc.
    8. To add text (such as the labels "goats" and "no goats"), click on the button that looks like this: Text button . Then drag the cursor where you want the text, and type it in. You can move the text around later by dragging it. To make room for the text at the bottom, you may need to make the graph smaller. Click on the graph, grab one of its corners, and make it smaller.
    9. To change the background pattern, double-click in the background (inside the graph but outside the bars). Choose a pattern that isn't solid, since a solid color will print black.
    10. To change the pattern of one bar, click once on the bar. Wait a few seconds. Click on the bar again. Wait a couple more seconds. Double click on the bar. Choose the pattern you want, then contemplate the question, "Does Bill Gates really deserve to be a billionaire, if this is how his software works?"
    11. Once you've got the graph the way you like it, you could print it. However, it's much less wasteful and more professional looking to include the graph in with your text. Choose Copy from the Edit menu, open up your word processing program (such as Microsoft Word), and Paste the graph in where you want it.


    Go to John McDonald's home page

    Send comments to mcdonald@udel.edu


    Last Updated: November 4, 1998
    URL of this document: http://udel.edu/~mcdonald /graphguide.html