OriginLab Corporation - Data Analysis and Graphing Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis     
 
Skip Navigation Links
All BooksExpand All Books
TutorialsExpand Tutorials
GraphingExpand Graphing
StatisticsExpand Statistics

6.10.2 Grouped Box Chart with Color Indexed Data Points


Summary

Origin can be used to create grouped box plots from raw data with data points and distribution curves.

Box Chart Raw Data Indexed Data Plot Box chart with indexed data plot.png


Minimum Origin Version Required: 2015 SR0

What you will learn

This tutorial will demonstrate how to:

  • Create a grouped box plot from raw data
  • Add a data plot with indexed symbol color
  • Add and customize a distribution curve
  • Customize the table-axes

Steps

Creating the Box Plot from Raw Data

This tutorial is associated with <Origin EXE Folder>\Samples\Tutorial Data.opj.

  1. Open Tutorial Data.opj and browse to the folder Grouped Box with Index Color DataPoint.
  2. Activate the workbook Book 5.
  3. Highlight col(E) - col(J):
    Box Chart Raw Data Indexed Data Plot Highlight columns.png
  4. On the 2D Graphs toolbar click the small triangle at the bottom of the sixth button to reveal the fly out menu. Select Grouped Box Charts - Raw Data as shown below:
    Box Chart Raw Data Indexed Data Plot box chart button.png
  5. In the Plotting: plotgboxraw dialog, set the Group Number to 2, the 1st Group Row to Comments and the 2nd Group Row to Long Name. This will create a box chart with the column data arranged in three groups of two, with X axis row names derived from the Comments and the Long Names on the worksheet:
    Box Chart Raw Data Indexed Data Plot plotgboxraw.png
  6. Click the OK button. The grouped box chart from raw data is created with two grouping levels as shown below:
    Box Chart Raw Data Indexed Data Plot box chart1.png
  7. To add data points in the graph, double click the plot to open the Plot Details dialog. Expand the Layer1 option on the left panel and select the first plot under it.
  8. On the Box tab, set Type to Box[Right] + Data [Left]. Click the Apply button. This will add two new tabs to the dialog: Data and Symbol
    Box Chart Raw Data Indexed Data Plot box tab type.png
  9. To add a Distribution Curve, on the Data tab, set Distribution Curve Type to Normal. Set Bins Alignment to Right to orient the curve.
    Box Chart Raw Data Indexed Data Plot data tab curve.png
  10. Click the OK button. The data points and distribution curves will appear on the graph as shown below:
    Box Chart Raw Data Indexed Data Plot box basic.png

Customizing the Boxes and Statistical Markers

  1. Double click on the any one of the boxes to re-open the Plot Details dialog.
  2. On the Group tab set both Border Color and Box Color to increment By One so each box in subgroup has a different color.
  3. Click the GUI Elements the browse button.png button on the Details section of Border Color. In the Increment Editor dialog that opens, click the first color and change it to be Red. Change the second color to Gray. Click OK.
  4. Click the GUI Elements the browse button.png button on the Details section of the Box Color to open the Increment Editor dialog. Click 1st color and click Define Custom Color button.
    :Box Chart Raw Data Indexed Data Plot custom colour.png
  5. Set RGB values in Red, Green, Blue boxes on bottom right to be 255, 51 and 51, and click OK to close dialog.
  6. Do the same for the 2nd color. Set Define RGB value to be 143, 143 and 143, and click OK to close dialog. Then click OK to close Increment Editor dialog and apply settings.
  7. This step is to customize the descriptive statistic markers whether to show on the plot such as the 99%, 1%, Max and Min marks.
    Go to the Percentile tab, and set the Edge Color to White and click Apply button. Since background of the graph is also white, Max, Min, 99%, 1% will look like disappeared in graph.

    On Percentile tab, users can also hide a Marker by setting the Type as None(the last shape) in the dropdown list.

  8. On the Lines tab set the Color for the Whisker and the Caps to Gray and Median Line to White.
    Click OK. The plot should appear as shown below:
    Box Chart Raw Data Indexed Data Plot box chart2.png

Customizing Data Symbols and Distribution Curves

  1. Double click any box in the graph to open the Plot Details dialog.
  2. On the Symbol tab. Set the Size to 5, the Shape to 2 Circle and the Interior to Open.
  3. Click the Edge Color dropdown list and choose Indexing: Col(B):Machines. The symbol's edge colors will be indexed to column B. All symbols with Machine value A386 will be one color and the ones with C334will be a different color:
    Box Chart Raw Data Indexed Data Plot Symbol Color.png
  4. When symbol color is indexed, another tab Color List will appear in the dialog. To set a user defined color increment list, go to the Color List tab. Enable the Use custom increment list box and set the first two Color Values as Blue and Dark Cyan.
    Box Chart Raw Data Indexed Data Plot Color List.png
  5. To customize the distribution curve color, on the Lines tab, set the Distribution Curve Color to Gray.
  6. Click OK to close the dialog.
    Box Chart Raw Data Indexed Data Plot box basic2.png

Customizing the Axes

For grouped plots support multi-row tick label tables. The corresponding axis icons in the Tick Labels tab of Axis dialog starts from the last table row, e.g. Bottom 1, Bottom 2, ..., Bottom N. This means the first row from the bottom will correspond to Bottom1 and so forth.

  1. To move the tick label row with SEG 1, SEG 2 and SEG 3 to the top X axis, double click on this tick label row.
  2. This opens the Axis Dialog with the Bottom 1 axis icon selected. Right click the Bottom 1 icon on the left panel and choose Move to Opposite.
    Tutorial Grouped Box Axis 01.png
  3. Click the Apply button. The SEG 1, SEG 2 and SEG 3 tick label row will now appear at the top X axis on the graph, and as the axis icon is renamed as Top 1 on the left panel in the dialog.
  4. The previous Bottom 2 icon will become the Bottom 1 icon. Select the Bottom 1 icon. Go to the Table tab. Set the Number of Rows to 3. Click the Apply button. Three identical bottom tick label tables will appear on the graph and they are Bottom 1, Bottom 2 and Bottom 3.
  5. To fill first bottom tick label row with light gray, select the Bottom 3 icon on the left panel, make sure you are still at the Table tab and clear the Auto check box to enable separate control of tick label table layout. Set Fill Color as LT Gray and deselect the Inside Border check box under Table Layout node.
  6. The second row derives the labels from col(C) of the second worksheet A386_CC.MI. Select the Bottom 2 icon and go to the Display tab, set the Type to Text from dataset and set the Dataset Name from the drop down as [Book5]"A386_CC.MI"!C"N".
  7. Go to the Format tab and clear the Auto check box, change the Color to White. Then go to the Table tab and set as the following:
    Tutorial Grouped Box Axis 02.png
  8. Select the icon Bottom 1, go to the Display tab, set the Type to Text from dataset and then set the Dataset Nameas [Book5]"C334_CC.MI"!C"N" since it uses col(C) from the third worksheet C334_CC.MI.
  9. Go to the Table tab and set the table layout as below:
    Tutorial Grouped Box Axis 03.png
  10. Select the Top 1 icon, go to the Table tab and set the table layout for top axis as below:
    Tutorial Grouped Box Axis 04.png
  11. Then go to the Format tab, set Font Size to 22 and change the tick labels to Bold:
    Tutorial Grouped Box Axis 04b.png
  12. For the Y Axis change to the following settings:
    • Scale tab (Vertical icon): Set Increment to 5000
    • Tick Labels tab >> Display tab (Left icon): Set Display to Scientific 10^3
  13. Click OK to close the dialog.
  14. Select Y axis title Range and press the Delete key to remove it.

Updating the Legend and Adding Text Objects

  1. Right click the box chart legend and select Legend: Box Chart Components... to open the Enhanced Box Legend: legendbox dialog. Deselect all the components except for Data:
    Group Box Chart Legend 01.png
  2. Click the OK button. The legend will show only the data symbols. Double click the legend text to go into in-place edit mode. Delete the first row of the legend. Select and drag to move the legend object to a better location.
  3. To remove the black line around the legend, right click the legend object and choose Properties.... In the Object Properties dialog, go to Frame tab to set Frame to None.
  4. Origin doesn't support tick label table titles yet. But users can add text objects manually. Right click on the white space to the left of the second bottom tick label row and choose Add Text... from the context menu that appears. Type NA386=. Then, still in in-place edit mode, highlight A386 and click the GUI Elements lower case letters button.png button on the Format toolbar to change it into subscript. Select and drag to adjust the positioning.
  5. Add another text object NC334= to the left of the third tick label row and change C334 into subscript.
    Box Chart Raw Data Indexed Data Plot text object.png


The final graph should appear as shown below:

Box Chart Raw Data Indexed Data Plot Box chart with indexed data plot.png

You can click to select table labels and nudge them using the arrow keys on your keyboard.

 

© OriginLab Corporation. All rights reserved.