6.9.4 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
This tutorial with the Grouped Box Plot and Axis Tick Table folder in the project <Origin EXE Folder>\Samples\Tutorial Data.opj.
Note: You can also access this sample graph by double-clicking on its thumbnail under the Box Plots - Grouped graph sample in the Learning Center dialog(select Help: Learning Center menu or press F11) .
Create Grouped Box Plot from Indexed Data
- 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 > Categorical : 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:
For another short tutorial on creating grouped box plots from indexed data, see Example 2.
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 > Categorical : 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 to open the Plot Details dialog. To customize Symbol style, select the Outlies 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, for the Border Color row, set the Increment as By One and Subgroup as Within Subgroup .
- Next, click the ... button on the right end of the Details column to open the Increment Editor. Click the first color to expand the color chooser, then click the last vacant color under Custom control to open the Colors dialog. In the dialog that opens, you can define a custom color by entering the HSL values (Hue=0, Sat=240, Lum=180). 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. OK out of the Increment Editor:
- In regard to the Box Color, select the first two colors of current color list to the ones we just defined at the previous step, and then select By One for Increment cell and Within Subgroup for Subgroup cell:
- 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:
You can click to select table labels and nudge them using the arrow keys on your keyboard.