Prettier graphs using Excel

Excel is commonly used for processing data, but the default graphs lack a little something when it comes to scientific presentation (I guess perceptual accuracy and aesthetics are not a key criterion for business graphs, so we get stuck with ugly graphs).

I made these notes a few years ago using Office 2007, but the process is similar with the more recent versions.

Plotting graphs using Excel / Office 2007

First get your data: here is some I prepared earlier… we want to plot the data in the column under “y” with the sem under SEM

In this example I will do a column chart so I have put in a set of labels for the groups I am potting – this makes it easier to get the labels on the x-axis quickly. I have selected the labels and y data

Change to the “insert” Tab and select the graph type – here I will select a column plot

… and choose a simple plot type suitable for the data.

The graph is created with labels but no error bars:

I have made the plot narrower by dragging the right border to the left.

I have selected the data by clicking on one of the columns

Under the “Layout” tab choose “analysis and select “error Bars” and under this choose “more error bars”

Use the menu under “Error amount” to pick “custom”, and select the error data for both the plus error bar and the minus error bar. Your graph now should have error bars showing the SEM.

Now you can tidy up the graph (Layout tab), add axis labels (Layout::Axis titles) and graph title (Layout::Chart Title), remove or adjust the legend (Layout::Legend), format the axis numbering (Layout::Axis), add lines of best fit (Layout::Trendline), format/remove gridlines, etc etc.

With a bit of fiddling you can make the graph look reasonably good

You can even add adornments like markers to indicate statistical significances etc… (Insert::Shapes gives you lines, boxes etc – the usual suite of office drawing tools)

Alternatively you can paste the graph into PowerPoint  — if you use Paste::Special::Enhanced Metafile, then ungroup (twice) you convert the image of the graph into Microsoft office drawing objects which you can edit using the normal PowerPoint tools. I often find this approach makes it easier to set line thicknesses, colours, text fonts etc etc than doing the equivalent in Excel graph mode. It also allows you to lay out multiple graphs or other images onto a page, with easy resizing etc to make things fit together aesthetically. Of course doing it that way loses the ability for automatic recalculation of the graph in the presentation by changing the data etc that you get if you paste the graph in as an excel object (the default paste mode). Have a play and you can choose which ever approach is most appropriate for your needs.

Once you have a graph format in excel you can re-use it with different data too. Just copy and paste into a new location to get a duplicate, then under the Design tab choose Select data to feed in the new numbers. The formats, colours, fonts etc that you so laboriously chose will stay with the graph, so once you have changed the data used by the graph you should have a nice graph of your other data (you will probably need to change the graph axis ranges if you set these manually; you may need to redraw any adornments you added – P values, text, lines etc, and perhaps move the legend to a new location).