# Modifying bars on a graph

In Minitab, the height of each bar on a graph represents a statistic for a category (categorical data) or interval (continuous data).

### Graphs that display bars as an option

You can display bars in marginal plots, interval plots, and individual value plots

## Modify the colors of bars on a graph

Suppose your bar chart summarizes the following data:

C1 C2 C3 C4
Operator Machine Data Colors
1 1 6 4
2 1 7 4
3 1 8 4
4 1 9 3
1 2 6 2
2 2 7 2
3 2 7 2
4 2 7 2

### Change the color of all bars or an individual bar

1. Create a bar chart of the data in the example worksheet:
1. Choose Graph > Bar Chart.
2. From the Bars represent, choose Values from a table.
3. Under One column of values, choose Cluster. Click OK.
4. Under Graph variables, enter Data. Under Categorical variables for grouping (1-4, outermost first), enter Machine and Operator.
5. Click OK
2. Select the bar or bars that you would like to change. Click a bar one time to select all bars. Click a second time to select an individual bar.
3. Double-click a selected bar.
4. On the Attributes tab, under Fill Pattern, choose Custom.
5. From Background color, choose the color.
6. Click OK.

### Create a graph with each cluster of bars a different color

1. Choose Graph > Bar Chart.
2. From the Bars represent, choose Values from a table.
3. Under One column of values, choose Cluster. Click OK.
4. Under Graph variables, enter Data. Under Categorical variables for grouping (1-4, outermost first), enter Machine and Operator.
5. Click Data View.
6. In Categorical variables for attribute assignment, enter Machine.
7. Click OK in each dialog box.

### Use an attribute column to specify colors

1. Choose Graph > Bar Chart.
2. From Bars represent, choose Values from a table.
3. Under One column of values, choose Cluster. Click OK.
4. In Graph variables, enter Data and in Categorical variables for grouping (1-4, outermost first), enter Machine Operator Colors.
5. Click Data View
6. In Categorical variables for attribute assignment, enter Colors.
7. Click OK in each dialog box.
8. Double-click the x-axis of the bar chart. On the Scale tab, under Space Between Scale Categories, deselect Gap within clusters and enter -1.
9. Deselect Gap between clusters and enter 0.
10. Click the Show tab. In Show Labels By Scale Level, deselect Tick Labels for Colors. Click OK in each dialog box.

### Use an attribute column to specify the colors (with session commands)

1. Choose Edit > Command Line Editor.
2. Enter the following:
```Chart Sum(Data)*Machine;
Group Operator;
Bar;
Color Colors.```
3. Click Submit Commands.

## Change the base position of bars

The base position is a value from which the bars originate. Graphed values greater than the base position project up from the line; graphed values less than the base position project down from the line. You can change the base position, for example, to show distance from a target value.

1. Double-click a bar and click the Box Options tab.
2. Under Base Position, click Custom and enter a y-scale value for the base position.
3. Click OK.

### Example of changing the base position of bars

Suppose each person on your sales team has a goal of \$12,000 for a month. The base position 0 makes it easy to compare total sales. To emphasize the relationships to the target value of \$12,000 (12 on the y-scale), you set the base for the bars to 12 and draw a reference line there. Now, you can see that Steve's totals are below the goal, Mary's are slightly above, and Roberto and Bill's are the highest.

By using this site you agree to the use of cookies for analytics and personalized content.  Read our policy