6.10.8 Grouped Box Plot
In Origin, a grouped box chart can be created from either indexed data or raw data. The indexed data is arranged as one data column and one or more group columns, while the raw data is arranged as multiple data columns grouped according to the column label row(s).
Once a grouped box plot has been created there are many options to customize the box plots and the axes. The customization options are the same for grouped box plots created from raw data as well as those created using indexed data.
Minimum Origin Version Required: 2015 SR0
What You Will Learn
This tutorial will show you how to:
- Create a grouped box plot from indexed data
- Create a grouped box plot from raw data
- Customize the box plot using the Plot Details dialog
- Customize the table-style axis tick labels
Create Grouped Box Plot from Indexed Data
This tutorial is associated with the Tutorial Data project:<Origin EXE Folder>\Samples\Tutorial Data.opj.
- Open the Tutorial Data project, browse to the folder Grouped Box Plot and Axis Tick Table and activate the workbook Book4G-CC.MI-Index.
- The data in the CC.MI-Index worksheet is indexed data. Column E is the data column and columns C and D can be used as grouping columns.
- Highlight column E and select Plot:Statistics:Grouped Box Charts - Indexed Data to open the plot_gboxindexed dialog.
- Beside Group Column(s), click the triangle button at the top right corner and click the context menu item Select Columns. This opens the Column Browser for selecting grouping ranges.
- In the column browser, highlight columns C and D simultaneously by holding down the Ctrl key while selecting them. Click the Add button to add them to the bottom panel. Click OK to apply the selection and close the column browser.
- Make sure the dialog settings the same as the image below:
- Click OK to create a grouped box plot, the plot will resemble the image below:
Create Grouped Box Plot from Raw Data
In the previous section, when the grouped box plot was created, an Output Data worksheet was generated as well. The data in this worksheet is arranged as raw data. A box plot graph will created from the raw data as well.
- Highlight all the columns in the worksheet Output Data. Select Plot:Statistics:Grouped Box Charts - Raw Data from the main menu to open the plotgboxraw dialog.
- We will use the labels in the SEG and Type label rows to group our data into 2 subgroups: Set Group Number to 2, 1st Group Row to SEG and 2nd Row Group to Type.
- Enable, Sort by Group Labels and accept the default Graph Theme.
- Click OK to create another grouped box plot, the plot should resemble the image below:
Customization by Plot Details Dialog
Both the graphs created in the previous two sections can be customized in the same manner. In the following sections, the graph created from the indexed data will be used as an example for customization.
- Activate the graph window created from the indexed data. Select and delete the legend object.
- Select Format:Plot Properties to open the Plot Details dialog.
- On the Box tab, check the Outliers box. Note that Outliers in Line will also be checked automatically. Outlier points will be shown in the graph.Click Apply to apply settings first and the Symbol tab will appear.
- To customize Symbol style select the Symbol tab and set the following:
- On the Spacing tab change Gap Between Subgroups (in %) to 5.
- On the Lines tab change the line colors as shown below:
- On the Percentile tab in order to set the Max/99%/1%/Min to none, select the last option in the symbol map. Set the rest of the options as shown below:
- On the Group tab set the Increment for Border Color as By One.
- Next, click the ... button on the right end of the Details column to open the Increment Editor. Select the first color and click on Define Custom Colors. In the Color dialog that opens set Hue=0, Sat=240, Lum=180, Red=255, Green=128 and Blue=128. OK to close the dialog. Follow the same procedure for the second color in the Increment Editor dialog with the settings Hue=160, Sat=240, Lum=164, Red=94, Green=94 and Blue=255. OK out of the Increment Editor:
- Choose the same settings for Box Color. The Group tab will appear as shown below:
- Click OK to apply all the previous settings and close the Plot Details dialog. The graph should resemble the image below:
Customization by Axis Dialog
- Continue with the graph from the previous section. Select Format:Axes:X Axis to open the Axis dialog.
- Go to the Tick Labels tab, right click on the Bottom 1 icon and select Move to Opposite to move it to the top axis.
- Now the previous Bottom 1 becomes Top 1, and Bottom 2 becomes Bottom 1.
- Click the new Bottom 1 icon and set the tick label format and table layout as shown below:
- Click the Top 1 icon and set the following:
- Click the Left icon (for Y axis) and change the display format for the Y tick labels:
- To turn on major and minor grid lines, go to the Grids tab and set as following for X(Vertical) and Y(Horizontal) grids respectively:
- Click OK to apply the settings and close the Axis dialog. The final graph should appear as shown below: