Syntax:
set object <index> rectangle {from <position> {to|rto} <position> | center <position> size <w>,<h> | at <position> size <w>,<h>} {front|back|behind} {fc|fillcolor <colorspec>} {fs <fillstyle>} {default} {lw|linewidth <width>}
The position of the rectangle may be specified by giving the position of two diagonal corners (bottom left and top right) or by giving the position of the center followed by the width and the height. In either case the positions may be given in axis, graph, or screen coordinates. See coordinates (p. ). The options at and center are synonyms.
Setting front will draw the rectangle in front of all plot elements, but behind any labels that are also marked front. Setting back will place the rectangle behind all plot curves and labels. Setting behind will place the rectangle behind everything including the axes and back rectangles, and can be used to provide a colored background for the entire graph or page.
The fill color of the rectangle is taken from the 5#5colorspec6#6. fillcolor may be abbreviated fc. The fill style is taken from 5#5fillstyle6#6. See colorspec (p. ) and fillstyle (p. ). If the keyword default is given, these properties are inherited from the default settings of at the time a plot is drawn. See set style rectangle (p. ).
Examples:
# Force the entire area enclosed by the axes to have background color cyan set object 1 rect from graph 0, graph 0 to graph 1, graph 1 back set object 1 rect fc rgb "cyan" fillstyle solid 1.0
# Position a red square with lower left at 0,0 and upper right at 2,3 set object 2 rect from 0,0 to 2,3 fc lt 1
# Position an empty rectangle (no fill) with a blue border set object 3 rect from 0,0 to 2,3 fs empty border 3
# Return fill and color to the default style but leave vertices unchanged set object 2 rect default