set size xsize, ysize
where xsize and ysize are relative to the canvas size. If, e.g., you type
set size 1, 0.5then the figure will be just as wide as it was originally, but the height will be reduced by a factor of two. Now, the problem is that in 3D the above-mentioned instruction will lead to a figure whose height (i.e., the z coordinate axis) is reduced by a factor of two, but the width is unchanged. However, the width is determined by x
The original problem on the discussion board was to set the xrange as [-6:6], the yrange as [-3:3], and the zrange as [-2:2], while keeping the units on each axis equal, i.e., have aspect ratios 6:3:2. What we can do is the following: we can easily change the z:x ratio, simply setting the size. Then, instead of plotting over the whole y range, we will only plot over one part of it, and yes, you've guessed correctly, we will use the ternary operator for that. The only trick is that we specify a yrange which is actually larger than the one that we want to plot. So, here is our script, and we will discuss it below
reset set iso 100,100 set xrange [-6:6] set yrange [-3:9] # We should have [-3:3], but do not rush! set zrange [-2:2] set ticslevel 0 unset key unset colorbox set xtics nomirror set ytics -3,2,3 set ztics -2,2,2 set xtics -6,2,6 set border 1+16 set xlabel 'x-label' set zlabel 'z-label' offset graph 0.05,0,-0.1 set ylabel 'y-label' offset graph -0.05,-0.25,0 f(x) = (x<3?x:1/0) set size 1,0.7 set arrow 1 from -6,-3,-2 to -6,3,-2 nohead set arrow 2 from 6,-3,-2 to 6,3,-2 nohead set arrow 3 from -6,3,-2 to 6,3,-2 nohead set palette rgbformulae 33,13,10 splot sin(x)*cos(f(y)) with pm3d
In the beginning, as usual, we set up the figure. The only thing to watch out is the unusual yrange: we specify more than we actually will use. On the border, we draw only the x, and z axes, but not the x2, y, and y2 axes. We will do that by hand, where we draw 3 headless arrows. Before we plot anything, we define a function which we will use to restrict the plotted yrange to [-3:3]. In the plotting function we pass not y, but f(y), so that nothing will be plotted beyond y=3. Having done the heavy work, we plot the function, and get the following image
Now, a couple of comments are in order here. One is that, since we set the y axis by hand, we have got to set the ylabel by hand, too. This is why we specified the offsets for the labels. (For the zlabel it wouldn't have been necessary, it just made the figure look a bit tidier.) The second remark is that it really depends on the view what looks the same on the 3 axes: that is why there is no generally applicable number can be given in the set size command. You have to try and determine it on a case-by-case basis.