## Border

The set border and unset border commands control the display of the graph borders for the plot and splot commands. Note that the borders do not necessarily coincide with the axes; with plot they often do, but with splot they usually do not.

Syntax:

         set border {<integer>}
                    {front | back | behind}
                    {linestyle | ls <line_style>}
                    {linetype | lt <line_type>} {linewidth | lw <line_width>}
                    {linecolor | lc <colorspec>} {dashtype | dt <dashtype>}
                    {polar}
         unset border
         show border

With a splot displayed in an arbitrary orientation, like set view 56,103, the four corners of the x-y plane can be referred to as `"`front`"`, `"`back`"`, `"`left`"` and `"`right`"`. A similar set of four corners exist for the top surface, of course. Thus the border connecting, say, the back and right corners of the x-y plane is the `"`bottom right back`"` border, and the border connecting the top and bottom front corners is the `"`front vertical`"`. (This nomenclature is defined solely to allow the reader to figure out the table that follows.)

The borders are encoded in a 12-bit integer: the four low bits control the border for plot and the sides of the base for splot; the next four bits control the verticals in splot; the four high bits control the edges on top of an splot. The border settings is thus the sum of the appropriate entries from the following table:

Graph Border Encoding
Bit | plot | splot
1 | bottom | bottom left front
2 | left | bottom left back
4 | top | bottom right front
8 | right | bottom right back
16 | no effect | left vertical
32 | no effect | back vertical
64 | no effect | right vertical
128 | no effect | front vertical
256 | no effect | top left back
512 | no effect | top right back
1024 | no effect | top left front
2048 | no effect | top right front
4096 | polar | no effect

The default setting is 31, which is all four sides for plot, and base and z axis for splot.

In 2D plots the border is normally drawn on top of all plots elements (front). If you want the border to be drawn behind the plot elements, use set border back.

In hidden3d plots the lines making up the border are normally subject to the same hidden3d processing as the plot elements. set border behind will override this default.

Using the optional 4#4linestyle5#5, 4#4linetype5#5, 4#4linewidth5#5, 4#4linecolor5#5, and 4#4dashtype5#5 specifiers, the way the border lines are drawn can be influenced (limited by what the current terminal driver supports). Besides the border itself, this line style is used for the tics, independent of whether they are plotted on the border or on the axes (see set xtics (p. )).

For plot, tics may be drawn on edges other than bottom and left by enabling the second axes - see set xtics (p. ) for details.

If a splot draws only on the base, as is the case with `"`unset surface; set contour base`"`, then the verticals and the top are not drawn even if they are specified.

The set grid options 'back', 'front' and 'layerdefault' also control the order in which the border lines are drawn with respect to the output of the plotted data.

The polar keyword enables a circular border for polar plots.

Examples:

Draw default borders:

         set border

Draw only the left and bottom (plot) or both front and back bottom left (splot) borders:

         set border 3

Draw a complete box around a splot:

         set border 4095

Draw a topless box around a splot, omitting the front vertical:

         set border 127+256+512 # or set border 1023-128

Draw only the top and right borders for a plot and label them as axes:

         unset xtics; unset ytics; set x2tics; set y2tics; set border 12