29.10.2 Grouped Columns
grouped-column-index-data
Data Requirements
You need to have at least one Y column as input data. Optionally, you can have an additional associated Y error column for each Y column. Another column provides grouping information.
Creating the Graph
Open the plot_gindexed dialog by one of three methods:
- Select Plot > Categorical: Grouped Columns... menu items
- Click the button in the 2D Graphs toolbar
In the dialog that opens, select the input data range. Add at least one group column and determine where to put the calculated data. You can then generate a grouped column plot.
You can refer to the section below for the detailed dialog controls:
The plot_gindexed Dialog Box
Data Column(s)
|
This branch is used to specify the input data.
|
Group Column(s)
|
This part includes a display box and a toolbar with five buttons :
- Display Box
- The group range(s) selected using Add button will display in this box. The first selected group ranges will be set set primary categorization and form the bottom line of the column plot's group table; the secondary groups selected would continue grouping based on the primary categorization and forming the second layer of the group table, and so forth.
- Add button
- Click this button then choose a column from menu; or click Select Columns to open the Column Browser and add column(s) to the Display Box as grouping range(s). You can add up to 5 grouping ranges.
- Remove button
- Remove the selected data range(s) from the Display Box. This button is available when you select one or more data ranges in the Group Column(s) box.
- Move Up button
- Move the selected data range(s) up in the Display Box. This changes the grouping sequence.
- Move Down button
- Move the selected data range(s) down in the Display Box. This changes the grouping sequence.
- Select All button
- Select all data range(s) down in the Group Column(s).
|
Label
|
Specify a column as label.
|
Plot Type
|
Specify the plot type, column plot, bar plot or scatter.
|
Graph Template
|
Specify a user template if needed. By default, the Auto check box is checked and the built-in template GBOX is used.
|
Output Data
|
Specify where to output the calculated data.
|
In addition, you can preview the final graph in this dialog.
Note:
- In order not to sort the grouping range with default alphabetical order, set it(them) as categorical and modify the orders in the Categories tab.
- By default, we divide the columns into subsets by the first group column when we create a group column plot in this dialog. You can change the default properties of subset in the (Plot Details) Spacing Tab.
|
Examples
|
- Create a new workbook and click the button to import the Categorical Data.dat file under <Origin EXE Folder>\Samples\Graphing path.
- Highlight column B and select Plot > 2D: Bar: Grouped Columns... from top menu to open the plot_gindexed dialog.
- In the Group Column(s) section, click the Add button in the top right corner and add column D as the first grouping range, then similarly add column C as the second grouping range.
- Click OK to generate the plot.
|
| For a more extensive tutorial, you can try Grouped Column with Error Bars and Data Labels. The tutorial addresses such things as Fill Pattern and the use and customization of tick label tables (seen in the above graph) for labeling the X axis.
|
Template
GBOX.otp
(installed to the EXE folder of Origin)
Notes
- If there is more than one grouping range (in the Group Column(s) box), X axis tick labels will, by default, display as tables. You can control this behavior and formatting of the tick labels table, in general, by opening the Table tab in the Tick Labels tab of the Axis dialog.
- By default, this plot uses Indexing to apply fill color, but there are other options. The following figure shows three variations of the same graph, the difference being in the way that color is applied to the bars:
- In the graph on the left, bar color is indexed to subgroup (Gender). This is the default and should work for most situations including unbalanced plots.
- In the middle graph, bar color is indexed to main group (Drug).
- In the graph on the right, bar color is set to increment, with subset size of 8.
- For more information, see:
- You can modify the spacing between columns or column groups using controls on the Spacing tab of Plot Details as well.
- If you want to create a grouped bar plot, just change the Plot Type to Bar in the plot_gindexed dialog. Alternately, you can create a grouped column plot using the menu command, then choose Graph: Exchange X-Y Axis.
- If you want to created a grouped scatter plot, just change the Plot Type to Bar in the plot_gindexed dialog. The source data will be sugrouped according to your Grouping column.
|