Skip to main content
Print

How to add Error Bars

Several plotting commands have the option of adding error bars including: Plot, Points, Bar, and Bars.

Key Features:

  • Control the style of the error bars.
  • Control the direction of the error bars.
  • Vary the magnitude of the bars in any direction.

Note: These examples assume you have the value for the error as a column in the data table. If you have raw data, you can compute the mean & SD using the Pivot command or the Box command. In the Pivot command, the error bar can be displayed in the graphic, without having to extract to the data table.

Adding Error Bars

All of the commands with an error bar option, work in a similar way.

  1. Finding the Error bar option (bottom of command), set to ‘No Error’ by default.
  2. Use this menu to select the style of the error bars.
  3. Use the additional options below to select the values for the error bars.

For Example, here is where you would add error bars in the Plot command.

Here are the additional options that appear once you select the bar style.


Bar Graphs

The Bar and Bars commands only have the error in the y direction (or x direction if the bars are oriented horizontally). For the Bars command, each data column will have a place to specify the error column.

Example:

Create a Bar Graph

  1. Download + Import the following file: Mean+SD
  2. Click the header to highlight the Mean column
  3. Add a Bar command

Add the Error Bars

  1. Expand the command
  2. Select the type of Error bars
  3. Set the Error menu to the SD column.

Exercise:

Try downloading the raw data and computing the mean and sd.

  1. Download the RawData and Import into DataGraph
  2. Add an Expression column
  3. Compute the mean with a Function
  4. Repeat for the SD
  5. Use the computed values in the Bar graph

Once you have the update graph, try changing the raw data and see how the computed values and the graph all update.


Points

The options described in this section, apply to error bars on points in the Plot command and the Points command.

One Direction

The simplest case is to have error bars in one direction where the error is uniform around the point.

For example, consider data where you have a mean and standard deviation in the data table.

  1. Highlight the first two columns and add a Plot command. This will give you the following graph, where the point style has also been changed to a solid point.
  1. Expand the Plot command and navigate to the bottom of the command.
  2. Change Error bars from ‘No Bars’ to ‘Small Bars’.
  3. Change Error in Y from ‘Nothing’ to ‘s’.

Two Directions

Error Bars can also be represented in the x and y direction. These can be the same values or chose a separate column for each.

For example, here is a dataset with the error in x and y.

Each can be specified separately.

Now you will have error bars in both directions.

In addition to having several the bar size options, the error bars can be represented as a single line, diamond, or ellipsoid.


Non-uniform

By default, the error is assumed to be uniform in the negative and positive direction. You can also represent errors the vary in each direction.

For example, here are data where the error varies in every direction.

Change the negative error to ‘Different’. Then specify a column for the negative error.

In this example, the error line color and fill have also been customized.

Note that when you chose the ellipsoid or the diamond a Fill color tile will appear in the bottom right. Use the Fill color tile to remove the fill, change the color, or add an opacity.

On This Page