COLOR, STYLE, and SIZE Subcommands (IGRAPH command)

COLOR, STYLE, and SIZE specify variables used to create a legend. Each value of these variables corresponds to a unique property of the chart. The effect of these variables depends on the type of chart.

  • Most charts use color in a similar fashion; casewise elements draw each case representation using the color value for the case, and summary elements draw each group representation in the color that represents a summarized value in the color data dimension.
  • For dot-line charts, dot charts, and scatterplots, symbol shape is used for style variables and symbol size is used for size variables.
  • For line charts and lines in a scatterplot, dash patterns encode style variables and line thickness encodes size variables.
  • For bar charts, pie charts, boxplots, histograms, and error bars, fill pattern encodes style variables. Typically, these charts are not sensitive to size variables.

CATEGORICAL legend variables split the elements in the chart into categories. A categorical legend shows the reader which color, style, or size is associated with which category of the variable. The colors, styles, or sizes are assigned according to the discrete categories of the variable.

SCALE legend variables apply color or size to the elements by the value or a summary value of the legend variable, creating a continuum across the values. COLOR and SIZE can create either scale legends or categorical legends. STYLE can create categorical legends only.

Scale variables have the following keywords:

MIN. Defines the minimum value of the scale.

MAX. Defines the maximum value of the scale.

  • The keywords MIN and MAX and their assigned values must be enclosed in parentheses.

In addition, the following keywords are available for COLOR, STYLE, and SIZE:

LEGEND. Determines if the legend is displayed or not. The legend explains how to decode color, size, or style in a chart.

TITLE. Specifies a string used to title the legend.

The following keywords are available for COLOR and STYLE:

CLUSTER. Creates clustered charts based on color or size variables.

STACK. Creates stacked charts based on color or size variables.

CLUSTER and STACK are mutually exclusive. Only one can be specified. Also, CLUSTER should not be used for both COLOR and STYLE.

Example

IGRAPH
 /VIEWNAME='Scatterplot'
 /Y=VAR(sales96) TYPE=SCALE
 /X1=VAR(sales95) TYPE=SCALE
 /X2=VAR(region) TYPE=CATEGORICAL
 /COLOR=VAR(tenure) TYPE=SCALE
 /STYLE=VAR(vol94)
 /SCATTER.
  • The chart contains a three-dimensional scatterplot.
  • COLOR defines a scale legend corresponding to the variable TENURE. Points appear in a continuum of colors, with the point color reflecting the value of TENURE.
  • STYLE defines a categorical legend. Points appear with different shapes, with the point shape reflecting the value of VOL94.