Guide to good graphs with Calc
Drawing graphs is an important part of presenting the results of your research. Here I describe the features of clear, effective graphs, and I outline techniques for generating good graphs using Calc, part of the free OpenOffice.org suite of programs. (I've also got a page on good graphs with Excel). Calc can produce graphs suitable for presentations and publication; the biggest deficiencies are the lack of a function for adding error bars, and a limited selection of symbols. The error bar function may be added to the next version of Calc; in the meantime, I've outlined tedious and clumsy ways to trick it into adding error bars.
General tips for all graphs
- Don't clutter up your graph with unnecessary junk. Grid lines, background patterns, 3-D effects, unnecessary legends, excessive tick marks, etc. all distract from the message of your graph.
- Do include all necessary information. Both axes of your graph should be clearly labelled, including measurement units if appropriate. Symbols and patterns should be identified in a legend on the graph, or in the caption. If the graph has "error bars," the caption should explain whether they're 95 percent confidence interval, standard error, standard deviation, or something else.
- Don't use color in graphs for publication. If your paper is a success, many people will be reading photocopies or will print it on a black-and-white printer. If the caption of a graph says "Red bars are mean HDL levels for patients taking 2000 mg niacin/day, while blue bars are patients taking the placebo," some of your readers will just see gray bars and will be confused and angry. For bars, use solid black, empty, gray, cross-hatching, vertical stripes, horizontal stripes, etc. Don't use different shades of gray, they may be hard to distinguish in photocopies. There are enough different symbols that you shouldn't need to use colors.
- Do use color in graphs for presentations. It's pretty, and it makes it easier to distinguish different categories of bars or symbols. But don't use red type on a blue background (or vice-versa), as the eye has a hard time focusing on both colors at once and it creates a distracting 3-D effect. And don't use both red and green bars or symbols on the same graph; from 5 to 10 percent of the males in your audience (and less than 1 percent of the females) have red-green colorblindness and can't distinguish red from green.
Exporting graphs to other formats
Once you've drawn a graph, you'll probably want to export it to some other program. For a print document or a presentation, you should be able to copy the graph and paste it directly into the file. For other uses, copy the graph into a graphics program (such as Adobe Illustrator, Adobe Photoshop, GIMP, or OpenOffice.org Draw) and save the file in .gif format (for use on the web) or .eps or .tiff formats (which some journals require for submitted manuscripts).
Choosing the right kind of graph
There are many kinds of graphs--bubble graphs, pie graphs, doughnut graphs, radar graphs--and each may be the best for some kinds of data. By far the most common graphs in scientific publications are scatter graphs and bar graphs.
A scatter graph (also known as an X-Y graph) is used for graphing data sets consisting of pairs of numbers. These could be measurement variables, or they could be nominal variables summarized as percentages. The independent variable is plotted on the x-axis (the horizontal axis), and the dependent variable is plotted on the y-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.
There are a few situations where it makes sense to put the independent variable on the Y-axis. For example, in oceanography it is traditional to put "distance below the surface of the ocean" on the Y-axis, with the top of the ocean at the top of the graph, and the dependent variable (such as chlorophyll concentration, salinity, fish abundance, etc.) on the X-axis. Don't do this unless you're really sure that it's a strong tradition in your field.
A bar graph is used for plotting means or percentages for different values of a nominal variable, such as mean blood pressure for people on four different diets. Usually, the mean or percentage is on the Y-axis, and the different values of the nominal variable are on the X-axis, yielding vertical bars.
Sometimes it is not clear whether the variable on the x-axis is a measurement or nominal variable, and thus whether the graph should be a scattergraph or a bar graph. This is most common with measurements taken at different times. In this case, I think a good rule is that if you could have had additional data points in between the values on your x-axis, then you should use a scatter graph; if you couldn't have additional data points, a bar graph is appropriate. For example, if you sample the pollen content of the air on January 15, February 15, March 15, etc., you should use a scatter graph, with "day of the year" on the x-axis. Each point represents the pollen content on a single day, and you could have sampled on other days. When you look at the points for January 15 and February 15, you connect them with a line (even if there isn't a line on the graph, you mentally connect them), and that implies that on days in between January 15 and February 15, the pollen content was intermediate between the values on those days. However, if you sampled the pollen every day of the year and then calculated the mean pollen content for each month, you should plot a bar graph, with a separate bar for each month. This is because the mental connect-the-dots of a scatter graph of these data would imply that the months in between January and February would have intermediate pollen levels, and of course there are no months between January and February.
Drawing scatter graphs with Calc
- Put your independent variable in one column, with the dependent variable in the column to its right. You can have more than one dependent variable, each in its own column; each will be plotted with a different symbol.
- If you are plotting 95 percent confidence intervals, standard error, or some other kind of error bar, copy each X-value twice into the first column. Put the confidence limits in the same rows as the two duplicated X-values. The confidence limits for each point should be in their own column. These should be confidence limits, not the confidence interval; thus if your first data point has an X-value of 7 and a Y-value of 4 ±1.5, you'd have three rows with 7 in the first column; the first row would have 4 in the second column, the second row would have 2.5 in the third column, and the third row would have 5.5 in the third column.

A Calc spreadsheet set up for a scatter graph including confidence intervals. - Select the cells that have the data in them, including the cells that contain confidence limits.
- From the "Insert" menu, choose "Chart" (or click on the little picture of a graph in the task bar). Choose "XY Chart" (the picture of a graph with dots on it) as your chart type. Do not choose "Lines"; the little picture with lines may look like an XY graph, but it isn't.
- On the "Choose a variant" screen, choose "Lines with symbols" if you're adding error bars, and unclick the grid lines; they're ugly and unnecessary.
- On the "Display" screen, enter titles for the X axis and Y axis, including the units. A chart title is essential for a graph used in a presentation, but optional in a graph used for a publication (since it will have a detailed caption). Get rid of the legend if you only have one set of Y values. If you have more than one set of Y values, get rid of the legend if you're going to explain the different symbols in the figure caption; leave the legend on if you think that's the most effective way to explain the symbols.
- Click the "Create" button, but you're not done yet. Click on the white area outside the graph to select the whole image, then drag the sides or corners to make the graph the size you want.
- Choose "Chart Wall" from the "Format" menu, and then choose "White" on the "Area" tab. This will get rid of the ugly gray background. Under "Lines," make style "Continuous" and the color "Black," to give you a border around the graph.
- Choose "Axis" from the "Format" menu, then "Y axis", and make modifications to the tick marks, font and number format. Most publications recommend sans-serif fonts (such as Arial, Geneva, or Helvetica) for figures. On the "Scale" tab, set the minimum and maximum values of Y. The maximum should be a nice round number, somewhat larger than the highest point on the graph. If you're plotting a binomial percentage, don't make the Y-scale greater than 100 percent. If you're adding error bars, the maximum Y should be high enough to include them. The minimum value on the Y scale should usually be zero, unless your observed values vary over a fairly narrow range. A good rule of thumb (that I just made up, so don't take it too seriously) is that if your maximum observed Y is more than twice as large as your minimum observed Y, your Y scale should go down to zero. If you're plotting multiple graphs of similar data, they should all have the same scales for easier comparison.
- Format your X-axis the same way you formatted your Y-axis.
- Choose "Title" from the "Format" menu, then "Y axis title", and adjust the font. Do the same for the X-axis title.
- Pick one of the symbols, click on it, and choose "Object properties" from the "Format" menu. On the "Line" tab, choose the kind of line you want connecting the points, if any. Then choose the symbol under "Icon." On the "Statistics" tab, choose whether you want a regression line.
Calc uses the same color for the background of the symbols, the line connecting them, and the regression line. You can change the color of the regression line by clicking on it, then choosing "Object properties" from the "Format" menu. But the only way to make the connect-the-dot line a different color from the symbol background (such as a black line connecting open symbols, or an invisible line connecting filled symbols) is to double-click on each individual symbol, choose "Object properties" from the "Format" menu, and change the Line color. This will change the background color of one symbol at a time. If you know of a way to change all the symbol background colors at once, please let me know, as this is really stupid. - Repeat the above for each set of symbols.
- If you've added error bars, click on one of them and choose "Object Properties" from the "Format" menu. Get rid of the symbols and make the line the color you want. Do this for each error bar; they should all be the same color and thickness. If an error bar is too small to click on it (you keep selecting the symbol instead), put a fake number in the spreadsheet to make the error bar larger, then replace it with the real number once you've formatted the error bar.
- Choose "Chart Area" from the "Format" menu. On the "Lines" tab, you'll probably want to make the border be "Invisible."
- You should now have a fairly beautiful graph. You can click once on the graph area, copy it, and paste it into a word processing document, graphics program or presentation.

The number of bird species observed in the Christmas Bird Count vs. latitude at seven locations in Delaware. Data points are the mean number of species for the counts in 2001 through 2006, with 95 percent confidence intervals.
Back-transformed axis labels
If you have transformed your data, don't plot the untransformed data; instead, plot the transformed data. For example, if your Y-variable ranges from 1 to 1000 and you've log-transformed it, you would plot the logs on the Y-axis, which would range from 0 to 3 (if you're using base-10 logs). If you square-root transformed those data, you'd plot the square roots, which would range from 1 to about 32. However, you should put the back-transformed numbers (1 to 1000, in this case) on the axes, to keep your readers from having to do squaring or exponentiation in their heads.
I've put together three spreadsheets with graphs that you can use as templates: a spreadsheet graph with log-transformed or square-root transformed X values, a spreadsheet graph with log-transformed or square-root transformed Y values, or a spreadsheet graph with log-transformed or square-root transformed X and Y values. While they're set up for log-transformed or square-root transformed data, it should be pretty obvious how to modify them for any other transformation. Although these graphs put the tick marks in the right places, I couldn't figure out how to label the tick marks automatically in Calc; you'll have to copy the graph to a graphics program and add the tick mark labels there.
![]() |
| Abundance of the longnose dace, in number of fish per 75 linear meters of stream, versus nitrate concentration. Fish abundance was square-root transformed for the linear regression. |
Drawing bar graphs without error bars using Calc
- Put the values of the independent variable (the nominal variable) in one column, with the dependent variable in the column to its right. The first column will be used to label the bars or clusters of bars. You can have more than one dependent variable, each in its own column; each will be plotted with a different pattern of bar.
- Select the cells that have the data in them, including the first column, with the values of the nominal variable.
- From the "Insert" menu, choose "Chart" (or click on the little picture of a graph in the task bar). On the "Choose a chart type" screen, choose "Columns." On the "Choose a variant" screen, choose "Normal," the one with columns next to each other. Unclick the grid lines; they're ugly and unnecessary.
- On the "Display" screen, enter titles for the X axis and Y axis, including the units. A chart title is essential for a graph used in a presentation, but optional in a graph used for a publication (since it will have a detailed caption). Get rid of the legend if you only have one set of Y values. If you have more than one set of Y values for each value of the nominal variable, get rid of the legend if you're going to explain the different bar patterns in the figure caption; leave the legend on if you think that's the most effective way to explain the bar patterns.
- Click the "Create" button, but you're not done yet. Click on the white area outside the graph to select the whole image, then drag the sides or corners to make the graph the size you want.
- Choose "Chart Wall" from the "Format" menu, and then choose "White" on the "Area" tab. This will get rid of the ugly gray background. Under "Lines," make style "Continuous" and the color "Black," to give you a border around the graph.
- Choose "Axis" from the "Format" menu, then "Y axis", and make modifications to the tick marks, font and number format. Most publications recommend sans-serif fonts (such as Arial, Geneva, or Helvetica) for figures. On the "Scale" tab, set the minimum and maximum values of Y. The maximum should be a nice round number, somewhat larger than the highest point on the graph. If you're plotting a binomial percentage, don't make the Y-scale greater than 100 percent. The minimum value on the Y scale should usually be zero, unless your observed values vary over a fairly narrow range. A good rule of thumb (that I just made up, so don't take it too seriously) is that if your maximum observed Y is more than twice as large as your minimum observed Y, your Y scale should go down to zero. If you're plotting multiple graphs of similar data, they should all have the same scales for easier comparison.
- Format your X-axis the same way you formatted your Y-axis.
- Choose "Title" from the "Format" menu, then "Y axis title", and adjust the font. Do the same for the X-axis title.
- Pick one of the bars, click on it, and choose "Object properties" from the "Format" menu. On the "Borders" tab, choose the kind of border you want for the bars, then choose the pattern inside the bar on the "Area" tab. Then choose the symbol under "Icon." On the "Options" tab, adjust the width of the bars.
- Repeat the above for each set of bars.
- Choose "Chart Area" from the "Format" menu. On the "Lines" tab, you'll probably want to make the border be "Invisible."
- You should now have a beautiful, beautiful graph. You can click once on the graph area (in the blank area outside the actual graph), copy it, and paste it into a word processing document, graphics program or presentation.
Drawing bar graphs with error bars using Calc
Unlike Excel, Calc does not have an easy way to set confidence intervals or other kinds of error bars on bar graphs. Here I describe a way to trick Calc into giving you error bars, using a graph format designed for stock price and volume information. This works fine for bar graphs with a single nominal variable. (If you want clusters of bars, follow these instructions for setting up the data, leaving a blank row between each cluster of values. You'll have to set the pattern for each bar individually, and you'll have to delete the bar labels and add text labels for the clusters of bars.)
- Put the values of the independent variable (the nominal variable) in the first column, with the dependent variable in the second column. The third and fourth columns should contain the upper and lower confidence limits. These should be confidence limits, not the confidence interval; thus if your first data point has a Y-value of 4 ±1.5, you'd have a row with the label in the first column, 4 in the second column, 2.5 in the third column, and 5.5 in the fourth column.

A Calc spreadsheet set up for a bar graph including confidence intervals. - Select the cells that have the data in them, including the first column, with the values of the nominal variable.
- From the "Insert" menu, choose "Chart" (or click on the little picture of a graph in the task bar). On the "Choose a chart type" screen, choose "Stock chart" (it has little rectangle with error bars). On the "Choose a variant" screen, choose "Stock chart 3," the one with blue columns and little error bars. Unclick the grid lines; they're ugly and unnecessary.
- On the "Display" screen, enter titles for the X axis and Y axis, including the units. A chart title is essential for a graph used in a presentation, but optional in a graph used for a publication (since it will have a detailed caption). Get rid of the legend.
- Click the "Create" button, but you're not done yet. Click on the white area outside the graph to select the whole image, then drag the sides or corners to make the graph the size you want.
- The stock graph has two Y-axes, one for stock prices and one for stock volume. Choose "Axis" from the "Format" menu, then "Y axis," and make modifications to the tick marks, font and number format. Most publications recommend sans-serif fonts (such as Arial, Geneva, or Helvetica) for figures. On the "Scale" tab, set the minimum and maximum values of Y. The maximum should be a nice round number, somewhat larger than the highest point on the graph. If you're plotting a binomial percentage, don't make the Y-scale greater than 100 percent. The minimum value on the Y scale should usually be zero, unless your observed values vary over a fairly narrow range. A good rule of thumb (that I just made up, so don't take it too seriously) is that if your maximum observed Y is more than twice as large as your minimum observed Y, your Y scale should go down to zero. If you're plotting multiple graphs of similar data, they should all have the same scales for easier comparison.
- Format the right Y-axis the same way you formatted the left by choosing "Axis," then "Secondary Y axis" from the "Format" menu. Make sure the scale is the same as for the left Y-axis. On the "Scale" tab, unclick all the interval marks. On the "Label" tab, unclick "Show labels" to get rid of the numbers.
- Choose "Chart Wall" from the "Format" menu, and then choose "White" on the "Area" tab. This will get rid of the ugly gray background. Under "Lines," make style "Continuous" and the color "Black," to give you a border around the graph.
- Format your X-axis the same way you formatted your Y-axis.
- Choose "Title" from the "Format" menu, then "Y axis title", and adjust the font. Do the same for the X-axis title.
- Pick one of the bars, click on it, and choose "Object properties" from the "Format" menu. On the "Borders" tab, choose the kind of border you want for the bars, then choose the pattern inside the bar on the "Area" tab. Then choose the symbol under "Icon." On the "Options" tab, adjust the width of the bars.
- Choose "Chart Area" from the "Format" menu. On the "Lines" tab, you'll probably want to make the border be "Invisible."
- You should now have a beautiful, beautiful graph. You can click once on the graph area (in the blank area outside the actual graph), copy it, and paste it into a word processing document, graphics program or presentation.

The number of bird species observed in the Christmas Bird Count at seven locations in Delaware. Data points are the mean number of species for the counts in 2001 through 2006, with 95 percent confidence intervals.
Back-transformed axis labels in bar graphs
If you have transformed your data, don't plot the untransformed data; instead, plot the transformed data. For example, if you've done an anova of log-transformed data, the bars should represent the means of the log-transformed values. Calc has an option to make the X-axis of a bar graph on a log scale, but it's pretty useless, as it only labels the tick marks at 1, 10, 100, 1000…. The only way I know of to get the labels at the right place is to format the axis to not have labels or tick marks, then use the drawing and text tools to put tick marks and labels at the right positions. Get the graph formatted and sized the way you want it, then put in dummy values for the first bar to help you position the tick marks. For example, if you've log-transformed the data and want to have 10, 20, 50, 100, 200, on the Y-axis, give the first bar a value of LOG(10), then use the drawing tools to draw a tick mark even with the top of the bar, then use the text tool to label it "10". Change the dummy value to LOG(20), draw another tick mark, and so on.
⇐ Previous topic | Next topic ⇒
This page was last revised August 13, 2008. Its address is http://udel.edu/~mcdonald/statgraphcalc.html.
©2008 by John H. McDonald. You can probably do what you want with this content; see the permissions pagefor details.
