Layers

A gnuplot plot is built up by drawing its various components in a fixed order. This order can be modified by assigning some components to a specific layer using the keywords behind, back, or front. For example, to replace the background color of the plot area you could define a colored rectangle with the attribute behind.
    set object 1 rectangle from graph 0,0 to graph 1,1 fc rgb "gray" behind
The order of drawing is
    behind
    back
    the plot itself
    the plot legend (`key`)
    front
Within each layer elements are drawn in the order
    grid, axis, and border elements
    pixmaps in numerical order
    objects (rectangles, circles, ellipses, polygons) in numerical order
    labels in numerical order
    arrows in numerical order
In the case of multiple plots on a single page (multiplot mode) this order applies separately to each component plot, not to the multiplot as a whole.