void bar (nxdiv, x, y, npts, bwid, mode, carray, typearray) BAR.C Level 3
 
int nxdiv  The number of bar positions along x.
float *x  The array of values for bar centers.
float *y  The array of values for bar heights.
int npts  The dimension of the x and y arrays.
float bwid  The bar width expressed as a fraction of the x interval. If bwid = 1 the bars will be joined on the sides.
int mode  = 0  Standard bar chart.
= 1 The bars will be stacked for repeated values of x[ ].
= 2 The bars will be drawn in groups for repeated values of x[ ]. Successive bars in a group will be behind the previous bar and offset to the right.
Use mode + 10 if you want bars based on y = 0.
int carray[npts]  An array of color values to be used for coloring each bar. If this array is NULL, the currently active color will be used for all of the bars. This argument is ignored when the automatic legend feature is used.
int typearray[npts] An array of panel filling options to be used sequentially.
  • If typearray[n] is between 1 and 16 inclusive (a vector pattern), the pattern will be drawn in the carray[n] color. 
  • If typearray[n]  < 0, the bar will be filled with the solid color corresponding to the |typearray[n]|.
  • If the typearray is NULL the bars will be hollow with the outline in the carray[n] color. 
  • Otherwise, typearray[n] represents the GraphiC color for the bar (range is 50174, 200447).
See panel() for the panel filling patterns.
 
bar() draws a bar chart. Bars are centered on the x datum values. They may be based on the lower edge of the grid space or on the y = 0 line. Segmented bars, showing the addition of several components, or offset bars can be made by using repeated x[ ] values. In these cases, npts is greater than nxdiv; otherwise these two arguments should be equal. To prevent the bars from being drawn on the axes and overhanging the end of the axes, be sure that the first value in the x array is not the same as the x origin, and in the call to graf(), make xmax one x interval greater than the actual maximum x value.