
However, as far as the plottings of this type of figure are concerned, I am dissatisfied with the following points.ġ) Splot (3d plotting command) is not intuitive for drawing 2D data.Ģ) We need to use a parametric representation (u,v) to superimpose other 2D curves on top of the mesh diagram.ģ) We have to take into account dummy data to construct the grid (see inline data in the above script).Ĥ) We can not construct the desired grid with data containing NaN for pm3d Set palette maxcolors 5 set xrange set yrange set cbrange set size ratio 1 unset key set pm3d map corners2color c1 set style fill transparent solid 0.9 noborder set parametric set urange splot "-" using 1 : 2 : 3 with pm3d, u, 4 / u, 1 with lines lw 3 lc rgb 'black' 0 0 0 1 0 1 3 0 2 6 0 3 # 3rd column '3' is dummuy value not used 0 1 1 1 1 2 3 1 3 6 1 4 # 3rd column '4' is dummuy value not used 0 3 2 1 3 3 3 3 4 6 3 5 # 3rd column '5' is dummuy value not used 0 6 3 # 3rd column '3' is dummuy value not used 1 6 4 # 3rd column '4' is dummuy value not used 3 6 5 # 3rd column '5' is dummuy value not used 6 6 6 # 3rd column '6' is dummuy value not used e pause -1 If we don't have any NaN value for meshes, we can plot a similar figure with the combination of 'set pm3d map corners2color c1' and 'plot. For me, this is just a workaround to the straightforward approach because it's more like drawing of objects than plotting of data. This figure is exactly the kind of figure we want, but we need to embed a lot of 'set object rectangle. The figure is drawn by the enumerates of the command 'set object rectangle. Set terminal pngcairo size 400, 400 set output "image-rectangles.png" set palette maxcolors 5 set style fill transparent solid 0.9 noborder set xrange set yrange set cbrange set size ratio 1 unset key set object rectangle from 0, 0 to 1, 1 fill noborder fc palette cb 0 back set object rectangle from 1, 0 to 3, 1 fill noborder fc palette cb 1 back set object rectangle from 3, 0 to 6, 1 fill noborder fc palette cb 2 back set object rectangle from 0, 1 to 1, 3 fill noborder fc palette cb 1 back set object rectangle from 1, 1 to 3, 3 fill noborder fc palette cb NaN back set object rectangle from 3, 1 to 6, 3 fill noborder fc palette cb 3 back set object rectangle from 0, 3 to 1, 6 fill noborder fc palette cb 2 back set object rectangle from 1, 3 to 3, 6 fill noborder fc palette cb 3 back set object rectangle from 3, 3 to 6, 6 fill noborder fc palette cb 4 back plot 4 / x with lines lw 3 lc rgb 'black' It is probably always desirable to use ` set pm3d depthorder`.

Pm3d sort order and lighting are applied to the faces. This restriction may be removed in a later gnuplot version. Due to limitations in the pm3d code, a single border line style from ` set pm3d border` is applied to all polygons. The fill style and color may be specified in the splot command, otherwise the global fillstyle from ` set style fill` is used. A blank line separates one polygon from the next.

Vertices defining individual polygons are read from successive records of the input file.
Pm3d gnuplot code#
The code assumes that the vertices lie in a plane.

These may be facets of a 3 D surface or isolated shapes. ` splot with polygons` uses pm3d to render individual triangles, quadrangles,Īnd larger polygons in 3 D. Gnuplot > help with polygons plot DATA with polygons
