Adding and editing grouping variables
To include more information in your chart, you may want to:
- Cluster or stack graphic elements. An example is a clustered bar chart.
- Vary the color, shape, or pattern of the graphic elements depending on the value of another variable. An example is a grouped scatterplot, with the color of the points in the scatterplot corresponding to categorical values.
You perform these actions by adding a grouping zone to the chart. The grouping zone adds another dimension of information to the chart and requires a variable. Like other drop zones, you drag and drop a variable into the grouping zone. The grouping zone variable's values control how the grouping affects the graphic elements in the chart. For example, if you are using the grouping zone to cluster bars in a bar chart, the grouping zone variable's categories determine the number of bars in each cluster.
How to add a grouping variable
- Select the Groups/Point ID tab.
- Select an option for adding a clustering or grouping variable. Different options are enabled depending on the axis set and graphic element.
- Drag a variable into the new grouping drop zone that appears on the canvas.
How to delete an existing grouping zone
- Select the Groups/Point ID tab.
- Deselect the option for the clustering or grouping variable.
How to edit an existing grouping zone
- Right-click the grouping drop zone on the canvas and select Edit Grouping Zone. You can also double-click the zone.
- Use the Grouping Zone dialog box to select the attribute controlled by the variable in the drop zone and—if available—the graphic element arrangement associated with the drop zone.
You can also modify the categories in the grouping zone (for example, to change the order of the categories). See the topic Editing grouping zone categories for more information.
Using the grouping zone dialog box
Distinguish Groups by. Select an aesthetic that specifies how the variable in the grouping zone is used to distinguish each graphic element. For example, if you are adding clustering, you might use Color to create a different colored bar for each category in the grouping variable.
- Color. Use the values of the variable in the grouping zone to vary the color of the graphic elements. For example, if you were creating a stacked bar chart, you may want to vary the color of the stack segments by the categories in another variable.
- Pattern. Use the values of the variable in the grouping zone to vary the pattern or shape of the graphic elements. This option has effects similar to fill color, but it might be a better option for black and white printing.
Arrangement. Select an arrangement for the graphic elements in the zone. You typically need to specify an arrangement only to identify clustering or stacking. Arrangements are not available for all graphic element types. If no option is available, you can ignore this control.