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.9 Notched Boxes with Variable Width Control


Origin's box plot is highly customizable. This tutorial shows how to create a notched box plot and control the box width by another dataset.

Tutorial Box Plot 01.png

Minimum Origin Version Required: 2015 SR0

What you will learn

  • Customize box plot settings
  • Use a dataset to control the box width
  • Customize the axis dialog for box plots
  • Add a fill area plot to a box plot as background

Steps to Control Box Width by Variable

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

  1. Open the Tutorial Data.opj and browse to the Box Variable Width folder.
  2. Activate workbook Book1CAA, go to Sheet1. Highlight columns B to I (do not select column C) and then select Plot: Statistics: Box Chart. Next, select and delete the legend object from the graph.
  3. Double-click on one of the boxes to open the Plot Details dialog and go to the Box tab. Set Style to Notched Box. Select the Box Width by Parameter box and then set Box Width (%) to Units and enter 1.2 for Scaling Factor. Select the Outliers box. Outliers in Line is automatically checked.
    Tutorial Box Plot 04.png
  4. Click OK button. The graph will look as below.
    Tutorial Box Plot 01 2.png

More Box Style Customization Steps

The following steps can further customize the box plot.

  1. To use the same color for each box, double-click on any box to open the Plot Details dialog box. Go to the Group tab and change the Increment of Border Color to None:
    Tutorial Box Plot 02.png
  2. Go to the Pattern tab. Set Border Color as Orange. Set Width as 1.5.
    Tutorial Box Plot border pattern.png
  3. To fill the boxes with color, click Fill Color drop down list and choose Define Custom Color. Add a custom color as below.
    Tutorial Box Plot pattern fill.png
    Tutorial Box Plot 03.png
  4. Note that checking Outliers checkbox in Box tab added a Symbol tab. Use controls on this tab to customize the outlier symbol as shown below:
    Tutorial Box Plot 05.png
  5. To hide the 99% and 1% symbols, go to the Percentile tab and clear the symbol for both 99% and 1%. Select the 2nd symbol in the first row for Mean:
    Tutorial Box Plot 06.png
  6. Click OK button to accept all the changes.

More Axis Customization Steps

  1. To show solid grid lines between each boxes, double click on the X axis to open the Axis dialog box. Go to the Scale tab with Horizontal icon selected and set the Count of Minor Ticks to 1:
    Tutorial Box Plot 11.png
  2. Select the Grids tab and select the Vertical icon. Check Show under Minor Grid Lines branch and set the Style as Solid.
    Tutorial Box Plot 12.png
  3. Go to the Line and Ticks tab and set the tick styles for X axis (Bottom):
    Tutorial Box Plot 14.png
  4. Hold Ctrl key and multiple select the Top and Right icons. Check the Show Line and Ticks box to also display line and ticks of top X and right Y axis:
    Tutorial Box Plot 13.png
  5. Go to the Scale tab again and select Vertical icon. Set the following:
    Tutorial Box Plot 15.png
  6. Go to the Tick Labels tab, make sure Left icon is selected and enter a prefix of $.
    Tutorial Box Plot 16.png
  7. Go to the Title tab, make sure Left icon is selected and change the text of Y axis title to Gasoline Prices.
  8. Click OK to close the Axis dialog.
  9. To add a title and footnote in the graph, right click in white area of the graph and select Add/Modify Layer Title context menu. Type US Weekly Retail Gasoline Prices. Select the title and use the Format toolbar to set font size as 26. Right click below the X axis tick labels and choose Add Text... context menu. In in-place edit mode, click I button on Format toolbar and then type Box width indicates number of vehicles in each area as a footnote. It will show in italics.

Steps to Add National Average Line and Min&Max Range

Note: If you right-click on status bar and select Min and Max, then highlight column C (with long name national) of Book1CAA Sheet1, you can see the Average=3.54, Min=3.198 and Max=3.877 of this column on status bar of Origin. Min and Max values have been put to Sheet2 so we can plot them as filled area in box chart.

  1. To add a National Average line in graph, select Graph:Add Straight Line to add a horizontal line to represent the national average value = 3.54 and click OK button.
    Tutorial Box Plot 09b.png
  2. Right click 3.54 label and choose Properties... context menu. Enter the text and set style as below.
    Tutorial Box Plot 09c.png
  3. To add national average range as a filled area in the graph, double click Layer1 icon on top-left corner of the graph to open Layer Contents dialog. Select B(Y) and C(Y) from Sheet2. Choose Plot Type to be Line. And click -> button to add two line plots into the box chart.
    Notched Box LC.png
  4. Double click the newly added line to open the Plot Details dialog. Go to the Line tab and set the line transparency to be 100 so the lines will not display in graph.
    Notched Box line.png
  5. The Pattern tab is added when fill area is enabled. Set the Fill color and Transparency as below and then click OK button.
    Tutorial Box Plot 10.png
  6. We can use Graph theme to change all text font in the graph to Verdana. Select Tools:Theme Organizer menu.
  7. There is no Graph theme called Verdana Font. But there is a Times New Roman Font theme. You can create a Verdana Font theme based on it.
  8. Right click Times New Roman Font theme and choose Duplicate.
    Notched box theme.png
  9. Double click the Duplicated theme and rename it as Verdana Font.
  10. Right click Verdana Font theme and choose Edit...
  11. In Theme Editing dialog that opens, change the Face to Verdana and click Save button. Also, you can update the Description on this dialog. Then click on the Save button to save the setting and close the dialog.
    Notched box vernada.png
  12. With Verdana Font still selected in Theme Organizer, click the Apply Now button to apply the font to all text objects in the graph.
    Notched box theme apply.png
  13. Manually reposition the text objects, as needed, so that your graph looks like the one in Summary.

© OriginLab Corporation. All rights reserved.