6.1.1 3D Bar with Labels
This tutorial will show you how to create the following graph:
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.
- Activate the Matrix MBook1B.
- From the Origin menu select Plot: 3D Surface: Color Fill Surface to create a 3D plot that will have Speed Mode turned on:
- On the Origin menu, click Format: Layer Properties.
- 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.
- Expand Layer1 and select the plot under it.
- To flatten the plot of the US, click on the Surface tab and enable the Flat option.
- 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.
- Next click the Colormap/Contours tab to set the matrix colors and click Level....
- 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.
- 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:
- On the Mesh tab, clear the Enable box and click OK to close the dialog box.
- The graph will resemble the image below:
Adding and Customizing 3D bars and labels
- With the graph active select Graph: Plot Setup on the Origin menu. This opens the Plot Setup dialog box.
- 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.
- 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:
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 and expand Available Data panel by clicking again.
Please refer to Plotting using Plot Setup for more information.
- 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
- Next, select the Label tab and check the Enable box.
- Set the Label Form as Col(B):"City" so that labels display the city name located in Col(B) of the worksheet.
- 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.
- 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.
- 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.
- Double-click the Z axis title and change it to Population (Million).
- The final graph should resemble the one shown below:
- Since this is a 3D OpenGL Graph, use the 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 button to enter rotation mode as shown below, or use the controls in the 3D Rotation toolbar: