Plot Jitter Chart with Mean and SE Bar in Origin

posted in: Graphing | 0

Jitter chart, called column scatter in Origin, is a variation of vertical scatter plot which is often used to display individual data points.This blog will show how to customize a jitter chart to show data points with mean line and SE error bars on top.preview image

 

The project is available to download from here. Go to “Data” workbook window you will see it has two levels of group. One is Control vs Treatment in Long Name header row, the other is Group A, B, C in Comments.

 

First, let’s make a two-level grouped box chart from the data. Highlight Col(A) through Col(F), plot from menu Plot:Statistics: Grouped Box Charts- Raw Data. In the dialog specify group levels according to the data layout, shown as below. Origin provides many types of box charts in Graph Themes dropdown list. Here we choose Box_Column Scatter.

Hint: the Auto Preview on bottom and Preview tab on the right panel is helpful for making selections in the dialog.

grouped box raw data dialog

This Column Scatter template plots individual data point as jitter chart but only shows mean line. The other statistics including SD, SE, percentiles, outliers etc belong to a box chart component (our document here describes how box chart components represent statistics in Origin). In order to show SE error bars, we are going to switch to show both data and box, let whiskers to show as plus and minus one SE, and hide interquartile box.

 

Double click on the plot, and in the Plot Details – Plot Properties dialog with the first dataset selected, go to Box tab. First, select Box + Data Overlap from Type drag-down menu. Once you selected, there will be two additional tabs Percentile and Pattern appeared specifically for customizing the box.

show box

Now the Box and Whisker are enable to customize and with separate controls. So for Box Style change to No Box to hide interquartile, and for whisker choose SE as Range, and 1 time Coef. We also want to uncheck Draw Data On Top of Box checkbox so that this special box (only with mean line and whisker) will show on top of the jittered data.

whisker dialog

Then go to Percentile tab, uncheck all the symbols for percentiles.

percentile

 

Then go to Lines tab to change color and width for mean line and whisker (in this case it is actually SE error bar), and uncheck Median Line. (When options (Style, Width and Color) of cap line are set to Auto, the cap will match the whisker.)

lines dialog

Click Apply button on the bottom, and you will see mean and SE bars shows on top of jitter chart with customized color and width.

draft

You can go to Symbol tab to customize the jitter data shape and color. E.g. Choose Open for Interior.

 

symbol

Since it’s a grouped plot, some formats for example colors, patterns or styles can be customized at once for all the data plots. Here for example the symbol color, we can go to Group tab, and in the table for Symbol Color choose By One for Increment. If to change color as a group, just click on “…” button on the same row to open increment list and pick colors.

group dialog

 

Hint: There has other useful controls we didn’t mention in this blog. For example, under Data tab you can add a distribution curve, change bin settings, and choose a customized data width instead of Jitter, and under Spacing tab to change gaps between or within subgroups etc.

 

Now the data plot part is done. Let’s customize the bottom axis tick label table to show only Group A, B, C since the Control and Treatment already shows in legend. Double click on text “Control” to open Axis dialog, and Bottom 2 will be selected on the left panel. Right click Bottom 2 and choose Delete.

delete_bottom2

For Group A, B, C tick label table row (Bottom1), we can hide vertical frames by unchecking Inside Border and Outside Border. Uncheck Far Parallel Border to hide the table frame at bottom. Check Gap Between Subgroups/Subsets to show some gap between Group A, B, C.

bottom1_customization

 

The default legend already displays for data plots. To add legend for mean and SE bar, just right click on the legend box and choose Legend: Box Chart Component. In the open dialog, make sure Whisker, Mean Line and Data are checked and click OK. 

legend dialog

 

Somehow it only shows 1st jitter data in legend also it doesn’t show it as column long name such as Control. You can right click the legend box and choose Properties… context menu. and modify the 3rd row text part to be %(1,@L) to use column long name. Also add 4th row as well. Click OK.

properties

You can hold down Ctrl key and drag the handles around it to arrange legends in 2 columns, to get something similar as Graph1 in the opj file.

Leave a Reply