6.1.1 3D Bar with Labels

Video Image.png Video Text Image.png Website blog icon circle.png Blog Image 33x33px.png


This tutorial will show you how to create the following graph:

3D Bar With Labels first final.png

Minimum Origin Version Required: 2015 SR0

What You will learn

This tutorial will demonstrate how to:

  • Create and customize a flat Color Fill surface.
  • Use Plot Setup to add a 3D bar plot to the original graph.
  • Add and customize labels on the 3D bars.


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

Creating a Flat Color Fill Surface from a Matrix

Open Tutorial Data.opj and browse to the folder 3D Bar with Labels.

  1. Activate the Matrix MBook1B.
  2. From the Origin menu select Plot > 3D: 3D Color Fill Surface to create a 3D plot that will have Speed Mode turned on:
    3D Bar With Labels graph1.png
  3. On the Origin menu, click Format: Layer.
  4. On the Size/Speed tab, clear Matrix data, maximum points per dimension. This turns off Speed Mode allowing for full display of the dataset. Click Apply.
    3D Bar With Labels Plot Details1.png
  5. Expand Layer1 and select the plot under it.
  6. To flatten the plot of the US, click on the Surface tab and enable the Flat option.
    3D Bar With Labels Plot Details2.png
  7. On the Fill tab, click the Contour fill from matrix radio button to set the colors according to the matrix information. Deselect the Fill back surface check box as well.
  8. Next click the Colormap/Contours tab to set the matrix colors and click Level....
  9. In the Set levels dialog that opens, select the #Major Levels radio button and set it to 2. Set the Total # of Levels to 2 and click OK to close the dialog.
    3D Bar With Labels Set Levels dialog.png
  10. Click on each color level under the Fill... heading to open the Fill dialog and choose the color. Set the three colors to Black, Gray and a customized blue with an RGB of 0, 64, 128 as shown below:
    3D Bar With Labels Fill Color.png
  11. On the Mesh tab, clear the Enable box and click OK to close the dialog box.
  12. The graph will resemble the image below:
    3D Bar With Labels graph2.png

Adding and Customizing 3D bars and labels

  1. With the graph active select Graph: Plot Setup on the Origin menu. This opens the Plot Setup dialog box.
  2. In the upper-left corner set Available Data to Worksheets in Folder. This will make the data in Book2B available for plotting on the same graph.
  3. Select Book2B, set Plot Type to 3D - Bars. In the middle panel set X, Y and Z as columns A1, G1 and D, respectively. Click Add to add the plot to the current layer:
    3D Bar With Labels Plot setup.png
    Click OK to exit the dialog box.

    In order to show all three panels in Plot Setup dialog, please expand Plot Type panel by clicking Button Expand Preview Up.png and expand Available Data panel by clicking Button Expand Preview Up.png again.

    Please refer to Plotting using Plot Setup for more information.

  4. To customize the 3-D bars, double-click on them to open the Plot Details dialog box. On the Pattern tab, set the border color to Wine and the fill color to Red. On the Outline tab set the Width (in %) to 10. Click Apply
  5. Next, select the Label tab and check the Enable box.
  6. Set the Label Form as Col(B):"City" so that labels display the city name located in Col(B) of the worksheet.
  7. Set the Position in Z as Top Outside with an Offset of 10 and set the Orientation in the YZ plane. Set the other controls as shown below and click OK to close dialog.
    3D Bar With Labels Label Settings.png
  8. At this point the labels will not show as the axes scale is too small for them to be in the graph range. Double-click the vertical axis (Z Axis) and go to the Scale tab, set From to 0 and , To to 8000000. Click OK to exit.
    Tutorial 3D Bar with Labels 09.png
  9. Double-click on the graph again and in the Plot Details dialog box, select the Graph1 option in the left panel. On the Display tab set the Color to LT Gray. Click OK to close dialog.
  10. Double-click the Z axis title and change it to Population (Million).
  11. The final graph should resemble the one shown below:
    3D Bar With Labels first final.png
  12. Since this is a 3D OpenGL Graph, use the GUI Elements rotate button.png Rotate Tool button on the Tools toolbar or hold down the R key and use the mouse, to rotate. You can also click the graph and select the GUI Elements rotate button2.png button to enter rotation mode as shown below, or use the controls in the 3D Rotation toolbar:
    3D Bar With Labels rotate mode.png