29.10.3 Grouped Box Charts-Indexed Data

Grouped Box Charts-Indexed Data.png

Data Requirements

The input data should be from worksheet column(s), and it is also required to have at least one different data range as grouped column(s).

Creating the Graph

Select required data.

From the menu, select Plot > Categorical: Grouped Box Charts - Indexed Data.

or

Click the Grouped Box Charts - Indexed Data button Button Grouped Boxes-Indexed Data.png on the 2D Graphs toolbar.

In the dialog that opens, select the group range and graph theme to create the grouped box chart.

Please see more details on creating and customizing box charts in the Creating Box Charts page.


The plot_gboxindexed Dialog Box

Plot gboxindexed dialog box.png

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 Group List Toolbar.png:
  • Display Box
    The selected group range(s) will display in this box. To plot, you must select something other than <none>. The sequence of data ranges determines the grouping order, with the first range supplying the primary groups, the second range supplying the secondary groups within the primary groups, and so forth.
  • Add button Button Group List Add.png
    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 Button Group List Remove.png
    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 Button Group List Move Up.png
    Move the selected data range(s) up in the Display Box. This changes the grouping sequence.
  • Move Down button Button Group List Move Down.png
    Move the selected data range(s) down in the Display Box. This changes the grouping sequence.
  • Select All button Button Group List Select All.png
    Select all data range(s) down in the Group Column(s).
Graph Template Select a template to apply the formats and settings on the graph. By default, the built-in template gbox.optu is selected by Auto box checked.
Graph Theme Choose from a list of built-in graph theme for the grouped box plot
Data Points Color by When Graph Theme includes data point display (e.g. Box_Column_Scatter), add a Data Points Color by control for coloring of individual points using worksheet column values. Optional.
UG gbox indexed data points color by.png
Output Data Specify where to output the calculated data.

In addition, you can preview the final graph in this dialog.

Note: The recalculate option in this dialog is set to Auto by default.

Note: When the selected Group Column(s) will result in the creation of more than 200 groups, the plot_gboxindexed dialog displays an attention message warning that the calculation might be slow and prompting the user to confirm that the calculation should proceed (graph previews are also disabled). This threshold value of 200 groups is modified by changing the value of LabTalk System Variable @NC.

Example 1

  1. Create a new workbook
  2. Click the Button Import Single ASCII.png button to import the Categorical Data.dat file under <Origin EXE Folder>\Samples\Graphing path.
  3. Hight Col(C) and Col(D), and check on the "Set as Categorical" in Main Menu: Column
  4. double click the "Unsorted" in Categories Row to open the Categories dialog (the same as The Categories Tab ) and sort the Col(C) and Col(D) ascending.
    Unsorted.png
  5. Highlight column B and select Plot: Categorical: Grouped Box Charts - Indexed Data from top menu to open the plot_gboxindexed dialog.
  6. In the Group Column(s) section, click the triangle button at the top right corner and select Col(C) and Col(D) in sequence.
  7. Select Box_Filled Diamond for Graph Theme. Please note, if you have already saved a graph template and wants to use them on your graph, you can uncheck Auto box and click ... button to browse and select the template in the Graph Template option.
  8. Make sure the Output Data is set to <new> so that the calculated data will be output to a new worksheet.
  9. Click OK to create the plot.
    Grouped Box Indexed Data EX.png

Example 2

This short tutorial will show you how to plot Grouped Box Chart - Indexed Data, while using date-time data to define groups.

  1. Begin by selecting and copying the x and y data below this tutorial. Include the header row information Dates and Values in your selection.
  2. Open a new workbook and paste the copied data into the first cell in Sheet1.
  3. Right-click on the first data row in the worksheet and choose Set As Long Name, to promote the text to the Long Name column label row. Your worksheet should look something like this:
    GBC-Indexed dateX 1.png
  4. While the data in column A look like date data, by default they are treated as text until you set the column Format. Highlight column A, right-click and choose Properties. Click the Properties tab and under Options, set Format to Date and Display to MM/dd/yyyy (the first option in the drop-down list - e.g. 8/2/2018), then click OK. The date data should now be right-aligned indicating that Origin recognizes it as numeric data.
  5. Highlight column B and click Plot>2D: Group Plot: Grouped Box Charts - Indexed. In the plot_gboxindexed dialog box, click the arrow to the right side of the Group Column(s) control and choose A(X): Dates, then click OK.
  6. Double-click on the X axis tick labels to open the X-Axis dialog box. On the Scale tab, set the date range as 12/1/2016 00:00:00.000 to 6/1/2017 00:00:00.000. Under Major Ticks, beside Value, enter 1month.
  7. Click the Tick Labels tab and on the Format sub-tab, set Alignment to Center and click OK. Your graph should look something like this:
GBC-Indexed dateX 2.png
Note that the date data are plotted on a true date scale, with proportional spacing and no data plotted at tick label 2/1/2017.
Dates Values
1/1/2017 0.63336
1/1/2017 0.09768
1/1/2017 0.04968
1/1/2017 0.70547
1/1/2017 0.80247
3/1/2017 0.76977
3/1/2017 0.64009
3/1/2017 0.38742
4/1/2017 0.67097
4/1/2017 0.6313
4/1/2017 0.40885
4/1/2017 0.50818
4/1/2017 0.23556
4/1/2017 0.64873
4/1/2017 0.45731
5/1/2017 0.86434
5/1/2017 0.65003
5/1/2017 0.71796

Template

gBox.otp (installed to the EXE folder of Origin)

Notes

  • If there are more than 1 grouping range, the X axis tick label will be by default displayed as tables, you can control this format in the Table tree node in the Tick Labels page of the Axis dialog.
  • By default Subgrouping will be turned on based on the calculation from grouping range, and you can control the gap between or within subgroups separately in the Spacing tab.
  • You can create/customize the legend specified for box chart components by selecting Graph:Legend:Box Chart Components... menu items when the box chart graph is active.
  • It is also possible to create grouped box chart from raw data.
  • If you select Box_Column Scatter as Graph Theme, you can create a grouped column scatter plot.
  • If you select Box_Connect Mean Line as Graph Theme, you can create a grouped box chart with a connect mean line.
  • If you select Box_Interval Plot as Graph Theme, you can create a grouped interval plot.
  • If you select Box_Mean Bar with SE as Graph Theme, you can create a statistical bar plot with SE error bar.