%BAR, %BAR2 Annotate Macros

Draws a rectangle using two sets of X/Y coordinates, which specify diagonal corners. You can specify the rectangle's line type, line color, fill type, and fill color.

Updates:XLAST, YLAST
Variables written out:COLOR, FUNCTION, LINE, STYLE, X, Y
Requirement:You must run the %ANNOMAC macro before using this or any of the other SAS/GRAPH annotate macros. See Making the Macros Available.

Table of Contents

Syntax

%BAR (x1, y1, x2, y2, color, line, style);
%BAR2(x1, y1, x2, y2, color, line, style, width);

Parameters

x1, y1

specify the location of the first corner of the bar. Values can be numeric coordinates, numeric constants, or numeric variables.

SeeX Variable and Y Variable

x2, y2

specify the location of second corner of the bar, which is drawn diagonal to the first corner. Values can be numeric coordinates, numeric constants, or numeric variables.

SeeX Variable and Y Variable

color

specifies the outline color and optional fill color using a character string without quotation marks.

SeeCOLOR Variable

line

specifies which of the outlines of the bar are to be drawn. The value can be a number, a numeric constant, or a numeric variable.

SeeLINE Variable for the BAR function for valid line values.

style

specifies the fill pattern for the bar using a character string without quotation marks.

SeeSTYLE Variable: Patterns for the BAR function for valid style values.

width

specifies the width of the outline and optional fill lines. The value can a number, a numeric constant, or a numeric variable.

SeeSIZE Variable for the DRAW function for valid width values.
Last updated: January 17, 2025