6.7.7 Grouped Column with Error Bars and Data Labels
Origin supports grouped column graphs with indexed data. Multiple group levels are supported. Grouping information can be shown in tick label tables on the X or Y axes.
Minimum Origin Version Required: 2015 SR0
What will you learn
This tutorial will show you how to
- Plot grouped column and error bar with indexed data
- Customize tick labels, colors, gaps, error bars and data labels
- Update legend to show grouping information.
This tutorial is associated with <Origin EXE Folder>\Samples\Tutorial Data.opj.
Also, you can refer to this graph in Learning Center. (Select Help: Learning Center menu or press F11 key , and then open Graph Sample: Column and Bar)
- Open Tutorial Data.opj and browse to the Grouped Column with Error Bars and Data Labels folder in Project Explorer (PE).
- In the following steps, we want to customized the order of values shown in the graph but not change the source data. Right click Column B in workbook, select Set As Categorical in the list menu, double click the literal "Unsorted" to open the Categories tab. Then select Ascending in Sort list and click OK to close the dialog.
- Do the same operation for Column C and F to set the Column C and Fas categorical data as well and set the order of categorical values as Ascending.
- We are going to create a grouped column chart from worksheet. Highlight column D(Y2) and E(yErr) and select Plot > Categorical : Grouped Columns - Indexed Data... from the main menu.
- In plot_gindexed dialog, click in the "Group Column(s)" to add columns B, C, and F (in that order) to the Group List. Click the OK button.
A grouped column plot with error bar is created. The 3-row tick label table at the bottom shows the grouping information. Note that a worksheet is created to contain the data used to create this graph.
- To hide the first tick label row, double-click on any tick label in the row, e.g. EC2. The Axis dialog box will open with the Bottom 3 icon selected in the left panel. uncheck the Show box and click Apply.
- We want to customize the appearance of the Bottom 2 tick label row. Select the Bottom 2 icon on the left panel. On the Table tab, clear the Auto box, clear all Border check boxes then click the OK button.
Two tick label rows remain, each with different layout.
The tutorial steps that follow, further customize the graph so that it looks like the image in the Summary section.
- With the graph window active, choose Format: Axis Tick Labels: Y Axis Tick Labels. Click the Grids tab. With Horizontal highlighted in the left panel, under Major Grid Lines, check the Show box. Click Apply to show horizontal grids.
- To turn on frames for both X and Y axes, hold the CTRL key and select both Horizontal and Vertical in left panel. Under Additional Lines, check the Opposite box and click OK.
- From the menu, choose Format: Plot. In Plot Details, click the Label tab and check the Enable box. Duplicate the settings as shown below.
You can use the Numeric Display Format drop-down to format the label values. For instance, to show a single decimal place for each label, enter ".1", then click Apply. For more information, see Custom Numeric Formats
- To adjust the gap between each week, go to the Spacing tab and set the Gap Between Subsets(%) to 15 (hint: you can type into the box).
- We are going to use the data in column F to set fill pattern and add a color gradient fill to the column plot. Go to the Pattern tab of Plot Details and set as follows. The gradient fill direction should be Horizontal Center Out.
To set fill Color to White, click the drop-down, click the Single tab and click the White cell. Similarly, for fill Pattern, click the drop-down, click the By Points tab, click the Use Column Values button and choose Col(F) from the list.
- To customize the pattern list, click on the Pattern drop-down list again and then click the pencil icon to the right of the pattern list. This opens the Increment Editor, where you create your custom pattern list. Rearrange the top three entries in your custom list as shown, by dragging the numbered buttons to the left side of the pattern gallery.
- To remove negative error bars, select the error bar plot in the left panel of Plot Details, (The second dataset under Layer1), then go to the Error Bar tab and clear the Minus check box.
- To change the graph page background color, select the Graph icon in the left panel of the Plot Details dialog box. Go to the Display tab and set color to LT Gray.
- To change layer background color to white, select Layer1 node on left panel of the Plot Details dialog. Go to the Background tab and set Color to White. Click OK to close Plot Details.
- To show pattern information in the legend, right click the legend and choose Legend: Categorical Values. Check the Fill Pattern and Show All Categories boxes and click OK.
- To arrange the legend horizontally, select the legend, press the CTRL key and drag one of the green handles along the sides of the legend until the legend entries are arranged in a horizontal fashion.
- Drag the legend to an appropriate position. Select and press Delete to remove the Y axis title.
To center and adjust margins on a finished graph, click on the graph to activate it, then choose Graph: Fit Layers to Page. Enter your Margin and determine whether to Maintain Layer Aspect Ratios, then click OK.