3
votes

Is it possible to add a black rectangle (in the z = 0 plane) to a splot in gnuplot? I've tried splotting:

splot 0

which led to (with different parameters) all sorts of different colours when adjusting the range and the pm3d option. I did find the option to plot rectangles in 2d:

set object rectangle from 0,0,0 to my maximum

Does the 3d environment also have a draw tool somehow?

Thanks in advance.

1

1 Answers

4
votes

To add a rectangle, you can add a polygon object (a rectangle object isn't supported in 3d):

max_x = 7
max_y = 4
set object 1 polygon from 0,0,0 to max_x,0,0 to max_x, max_y,0 to 0, max_y,0 fillstyle solid noborder fillcolor rgb 'dark-green'

set ticslevel 0
set xrange [0:10]
set yrange [0:10]
set xlabel 'xlabel'
set ylabel 'ylabel'
set view 40,30

splot x

The splot x is only examplary, in any case you need a plotting command to show the object.

Example output with a filled polygon at z=0