Credits Overview Plotting Styles Commands Terminals

polygons

2D plots:

     plot DATA {using 1:2} with polygons

plot with polygons is treated as plot with filledcurves closed except that each polygon's border is rendered as a closed curve even if its first and last points are not the same. The border line type is taken from the fill style. The input data file may contain multiple polygons separated by single blank lines. Each polygon can be assigned a separate fill color by providing a third using specifier and the keywords fc variable (value is interpreted as a linetype) or fc rgb variable (value is interpreted as a 24-bit RGB color). Only the color value from the first vertex of the polygon is used.

3D plots:

     splot DATA {using x:y:z} with polygons
           {fillstyle <fillstyle spec>}
           {fillcolor <colorspec>}

splot with polygons uses pm3d to render individual triangles, quadrangles, and larger polygons in 3D. These may be facets of a 3D surface or isolated shapes. The code assumes that the vertices lie in a plane. Vertices defining individual polygons are read from successive records of the input file. A blank line separates one polygon from the next. For the case of binary input files, see binary blank.

Note: Previous gnuplot versions suffered from a limitation that all 3D polygons shared a single set of fill border proporties taken from set pm3d border. This limitation is no longer present. Polygon fill style, border color, and border linewidth may now be specified in the splot command, otherwise they are taken from the global settings of set style fill (not from set pm3d). The fill style, border color, and border linewidth for polygon objects are specified in the set object command.

Each polygon may be assigned a separate fill color by providing a fourth using specifier and the keywords fc variable (value is interpreted as a linetype) or fc rgb variable (value is interpreted as a 24-bit RGB color). Only the color value from the first vertex of the polygon is used.

pm3d sort order and lighting are applied to the faces. It is probably always desirable to use set pm3d depthorder.

figure_polygons

     set xyplane at 0
     set view equal xyz
     unset border
     unset tics
     set pm3d depth
     splot 'icosahedron.dat' with polygons fc background \
           fs transparent solid 0.8 border lc "black" lw 2