A standard deviation graph is typically a bar chart or line chart with error bars extending above and below each data point to show how spread out your data is. You can create one in Excel, Google Sheets, Python, or R by calculating your means and standard deviations first, then adding error bars to a basic chart. The process takes just a few extra clicks in spreadsheet tools or a couple lines of code in programming languages.
What You Need Before You Start
Every standard deviation graph requires two things for each group or category you’re plotting: the mean (average) and the standard deviation. The mean becomes the height of your bar or the position of your point, and the standard deviation determines how far the error bars extend above and below it. If you have raw data, you’ll calculate these first. If you already have summary statistics from a report or paper, you can skip straight to graphing.
In most tools, you’ll create a regular bar chart or line chart using your means, then layer standard deviation error bars on top. The error bars stretch equally in both directions from each data point, creating a visual range that represents the spread in your data.
How to Add Error Bars in Excel
Start by organizing your data with group names in one column, means in the next, and standard deviations in a third column. Select your means and create a bar chart (Insert > Chart > Bar). Once the chart appears, right-click on any of the bars and choose “Format Data Series.” Click on the Y-Error Bars tab, then select “Both” to display error bars extending up and down.
Under the Custom Error amount section, enter the cell range containing your standard deviations for both the positive and negative values. For example, if your standard deviations are in cells C2 through C5, enter that range in both the “+” and “−” fields. Click OK, and your bars will now display matching error bars. You can adjust the line thickness and cap style by right-clicking the error bars themselves.
How to Add Error Bars in Google Sheets
Google Sheets handles error bars through its Chart Editor. Create a bar or line chart from your means, then click on the chart and open the editor. Under the “Customize” tab, look for the “Series” section, where you’ll find an option to add error bars. You can set the type to “Custom” and point it to your standard deviation values.
One limitation worth knowing: the current version of the Google Sheets Chart Editor does not let you assign different error bar values to individual data points within a single series. If each of your groups has a different standard deviation (which is common), you may need a workaround, such as plotting each group as its own data series. This is a known gap that users have reported to Google.
How to Create One in Python
Python’s Matplotlib library has a built-in errorbar function that handles this cleanly. You pass in your x positions, your mean values, and your standard deviations as the yerr parameter.
The yerr argument accepts several formats. A single number applies the same error bar size to every point. An array of values (one per data point) gives each point its own symmetric error bar. If your positive and negative errors differ, you can pass a two-row array where the first row holds the lower errors and the second holds the upper errors. For standard deviation graphs, you’ll typically use one array of SD values.
A minimal example looks like this: call plt.bar() to draw your bars, then call plt.errorbar() with the same x and y values plus your yerr set to your list of standard deviations. Set fmt='none' if you only want the error bars without additional markers. You can control cap size with the capsize parameter.
How to Create One in R with ggplot2
In R, the ggplot2 package uses geom_errorbar() to add standard deviation bars. You need a data frame with columns for your group variable, the mean, and the standard deviation. The key mapping is aes(ymin = mean - sd, ymax = mean + sd), which tells ggplot2 where each error bar starts and ends.
A typical call combines geom_bar(stat="identity") for the bars with geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2) for the error bars. The width argument controls how wide the caps are. If you’re comparing groups side by side, add position=position_dodge(0.9) to both the bar and error bar layers so they align properly.
R also offers a shortcut: stat_summary(fun.data=mean_sdl, fun.args=list(mult=1)) will calculate the mean and standard deviation directly from raw data and plot them automatically. The mult=1 argument specifies one standard deviation in each direction. Change it to 2 for two standard deviations.
Standard Deviation vs. Standard Error: Which to Graph
This is the most common source of confusion in standard deviation graphs, and picking the wrong one changes what your graph communicates. Standard deviation (SD) describes how spread out the individual data points are in your sample. Standard error of the mean (SEM) describes how precisely you’ve estimated the true average.
SD is a fixed property of your data. It stays roughly the same whether you measure 20 subjects or 200. SEM shrinks as your sample size grows, because more data gives you a more precise estimate of the mean. This means SEM error bars will always look smaller than SD error bars, sometimes dramatically so with large samples.
If your goal is to show how variable your measurements are, use SD. If your goal is to compare means between groups and suggest whether differences are statistically meaningful, SEM is more appropriate because it’s closely related to confidence intervals and p-values. In published research, SEM is more common for group comparisons. The important thing is to label your graph clearly so readers know which one you’re displaying.
Reading a Standard Deviation Graph
Once your graph is built, the error bars follow a predictable pattern tied to the normal distribution. About 68% of your data falls within one standard deviation above and below the mean. That’s what a single SD error bar represents. If you extend the bars to two standard deviations, they capture about 95% of the data. Three standard deviations cover 99.7%. This is called the 68-95-99.7 rule.
When comparing two groups on your graph, look at whether their error bars overlap. With SD bars, overlapping bars don’t tell you much about statistical significance, because SD reflects spread rather than precision of the mean. With SEM bars, substantial overlap generally suggests the difference between groups is not statistically significant, while a clear gap suggests it may be. Neither replaces a proper statistical test, but SEM bars give you a quicker visual read.
Common Mistakes to Avoid
The most frequent error is displaying error bars without labeling what they represent. Readers have no way to interpret your graph if they don’t know whether the bars show SD, SEM, or a confidence interval. Always label this in your axis title, legend, or figure caption.
Another common issue is using one-sided error bars. Standard deviation is symmetric around the mean, so your bars should extend equally above and below each data point. Showing only the upper half misrepresents the spread and can make differences between groups look smaller than they are.
Watch your y-axis scaling too. If your axis doesn’t start at zero for a bar chart, the visual proportions of your error bars relative to the bar heights become misleading. And if you’re plotting multiple groups with very different sample sizes, keep in mind that SD won’t reflect those differences but SEM will, so your choice between them matters even more.

