How to create 3D Stacked Histograms with their fitted Curves

If you have a group of multiple datasets, and want to draw and arrange their
histWEB-1674_3DStakedHistgrams in 2D so that you can contrast the differences of distributions visually, one way is to create a Stacked Histograms (Plot: Statistics: Stacked Histograms menu) like a sample at right. In addition, you can run the distribution fit (available in Origin 2015 version), and easily add the result fit curves to the layers.

However, what if you want to create a visually more compact 3D form like below? Although currently Origin doesn’t provide a straightforward built-in graph type for this kind of 3D graph, this article describes a work-around to create such a 3D graph. You can try the following procedure using the sample Origin file downloadable from this link .

WEB-1674_3DStakedHistR-3D

 

Procedure

1) Go to Sheet1 of Book1 window. Highlight the first column(“Americas”). Select Statistics: Descriptive Statistics: Frequency Counts: Open Dialog menu. Set the Recalculate mode to either Manual (or Auto), select only {“Bin Center”, “Count”} at Quantities to Compute, and set Output to [<input>]<new>.
==>FreqCounts1 sheet is created,

2) In the FreqCounts1 sheet, Left-click the Green lock icon, and choose Repeat this for All Y columns flyout.
==> FreqCounts2..5 are created..
Replace the “Count” long name each B column in sheets FreqCounts2..5 to the actual dataset name like Americas, Europe, Asia, etc.

3) First, make sure that in the active worksheet, no columns are highlighted, then choose Plot: 3D XYY: XYY 3D Bars menu to show the Plot Setup dialog. Click the double Arrows on right side of the dialog to make sure all 3 panels show in this dialog. In the top panel, using CTRL or SHIFT key, select 5 sheets of FreqCounts1..5. In the middle panel, check A for X, and B for Y; and press Add button to include all frequency results in the 3D Bar graph. Click OK.
=> The 3D histogram is created.
Double click on plot to open the Plot Details dialog, select Outline tab, and set the slider of Z Direction Bar Width (in %) to 1. Click OK.
==> The thickness of the bars becomes flat.

4) Now to create distribution fit curves of source datasets, go back to the original Sheet1 sheet, Select column A header and drag to highlight all columns. Choose Statistics: Descriptive Statistics: Distribution Fit: Open Dialog menu.
In the distfit tool dialog, under the Plots node, turn OFF the Box Chart check box (but Histogram check box should be checked). Click OK.
==> Two worksheets, Dist1 and Dist Plot Data1 are added in Book1.

5) Distribution Y data are all those Normal columns in Dist Plot Data1 sheet.To plot the distribution Y columns in the same graph as the 3D Histogram graph we just created, first enter 1, 2, 3, 4, and 5 (position number) in the Unit cell under each Normal columns from left to right.
Open Layer Contents dialog by double clicking Layer1 icon at the top left corner of the graph.
Click Long Name column header on left panel to sort ascending all columns by Long Name. If it’s descending, click the Long Name column header again. Select all Normal columns in the left panel, Click the down arrow next to A button in the middle panel and choose 3D Ribbon plot type. Press => button to move all Normal plots into the graph. Click OK.
==> Distribution curves are added at 3D histograms. (The Z axis tick labels changed to unwanted 1,2, 3, 4, 5. This is fixed in the next step.)

If you are using the coming Origin 2016 or newer, double click the plot in Plot Details dialog. Select the 1st plot in Dist Plot Data1 set on left panel. Go to Outline tab and set the Width (in %) to 1.

6) Right click Legend and choose Legend: Update Legend… context menu. Set Auto Legend Translation Mode to @LA: Long Name. Then right click the legend and choose Properties… context menu and delete all entries from \l(6) %(6) on.

7) To fix the text labels of Z axis, double-click a Z axis label to show the Axis dialog, select Tick Label tab, set the Type option to Column Name or Label. Click OK. You can do further customization of the curve such as the curve width, color, etc. (You may need to turn OFF the Add lighting effects by darkening sides check box  for the histogram plot setting in the Plot Details dialog to avoid the color change of the histogram bars.) Also, if you want to use only a single color for the distribution curves, select the Increment mode of the Border Color to None in the Group tab of the Plot Details dialog.

Note: If you simply want a 3D stacked column chart, instead of a 3D stacked histogram, you can prepare the raw dat, and run only the step 3).

Leave a Reply

Your email address will not be published. Required fields are marked *