BAR Subcommand (IGRAPH command)

BAR creates a bar element in a chart, corresponding to the X1, X2, and Y axis assignments. Bars can be clustered by assigning variables to COLOR or STYLE. Horizontal or vertical orientation is specified by the COORDINATE subcommand.

summary function. Defines a function used to summarize the variable defined on the Y subcommand. If the Y axis assignment is $COUNT or $PCT, the BAR subcommand cannot have a summary function. If the Y subcommand specifies TYPE=CATEGORICAL, then BAR can specify only MODE as the summary function.

LABEL. Bars can be labeled with the actual values corresponding to the dependent axis (VAL) or with the number of cases included in each bar (N). The default is no labels. The placement of the labels is inside the bars (INSIDE) or outside the bars (OUTSIDE).

SHAPE. This keyword is no longer supported and is ignored. Bars are always drawn as rectangles.

BARBASE. This keyword is no longer supported and is ignored.

BASELINE. The baseline value determines the location from which the bars will hang (vertical) or extend (horizontal). The default value is 0.

Example

IGRAPH
 /X1=VAR(volume96) TYPE=CATEGORICAL
 /Y=$count
 /COORDINATE=VERTICAL 
 /EFFECT=THREE
 /BAR LABEL INSIDE N.
  • X1 assigns the categorical variable volume96 to the X1 axis.
  • Y assigns the built-in dimension $count to the range axis.
  • VERTICAL defines the counts to appear along the vertical dimension.
  • BAR adds a bar element to the chart.
  • LABEL labels the bars in the chart with the number of cases included in the bars. These labels appear inside the bars.

Example

IGRAPH
 /X1=VAR(volume94) TYPE=CATEGORICAL
 /Y=VAR(sales96) TYPE=SCALE
 /COORDINATE=HORIZONTAL
 /EFFECT=NONE
 /BAR (MEAN) LABEL OUTSIDE VAL BASELINE=370.00.
  • X1 assigns the categorical variable volume94 to the X1 axis.
  • Y assigns the scale variable sales96 to the range axis.
  • HORIZONTAL defines sales96 to appear along the horizontal dimension.
  • EFFECT defines the chart as two-dimensional.
  • BAR adds a bar element to the chart.
  • MEAN defines the summary function to apply to sales96. Each bar represents the mean sales96 value for the corresponding category of volume94.
  • LABEL labels the bars in the chart with the mean sales96 value. These labels appear outside the bars.
  • BASELINE indicates that bars should extend from 370. Any bar with a mean value above 370 extends to the right. Any bar with a mean value below 370 extends to the left.