Scanorder

    set pm3d {scansautomatic | scansforward | scansbackward | depthorder}

By default the quadrangles making up a pm3d solid surface are rendered in the order they are encountered along the surface grid points. This order may be controlled by the options scansautomatic3#3scansforward3#3scansbackward. These scan options are not in general compatible with hidden-surface removal.

If two successive scans do not have same number of points, then it has to be decided whether to start taking points for quadrangles from the beginning of both scans (flush begin), from their ends (flush end) or to center them (flush center). Note, that flush (center3#3end) are incompatible with scansautomatic: if you specify flush center or flush end and scansautomatic is set, it is silently switched to scansforward.

If two subsequent scans do not have the same number of points, the option ftriangles specifies whether color triangles are drawn at the scan tail(s) where there are not enough points in either of the scans. This can be used to draw a smooth map boundary.

Gnuplot does not do true hidden surface removal for solid surfaces, but often it is sufficient to render the component quadrangles in order from furthest to closest. This mode may be selected using the option

     set pm3d depthorder
Note that the global option set hidden3d does not affect pm3d surfaces.

The depthorder option by itself tends to produce bad results when applied to the long thin rectangles generated by splot with boxes. It works better to add the keyword base, which performs the depth sort using the intersection of the box with the plane at z=0. This type of plot is further improved by adding a lighing model. Example:

    set pm3d depthorder base
    set pm3d lighting
    set boxdepth 0.4
    splot $DATA using 1:2:3 with boxes