您可以向下移动上表面并手动重新标记 z tics。以这张图为例:
让我们来研究一下 gnuplot 魔法吧:
# Make sure that there are no data points exactly at the corners
# of the xy plane (it affects the vertical borders)
set xrange [-1.001:1.001]
set yrange [-1.001:1.001]
zmin = -2
zmax = 5
dz = zmax - zmin
set zrange [zmin:zmax]
# Remove vertical borders
set border 15
# Some functions to plot
f(x,y)=x**2+y**2+10.
g(x,y)=-x**2-y**2
# Draw vertical borders by hand leaving empty space where the
# axis is broken. I have used variables zmin etc. for transparency
set for [i=-1:1:2] for [j=-1:1:2] arrow \
from i,j,zmin-dz*0.5 to i,j,1 lw 1 nohead
set for [i=-1:1:2] for [j=-1:1:2] arrow \
from i,j,2 to i,j,zmax lw 1 nohead
# Draw zig-zag line to denote broken axis
set for [i=-1:1:2] for [j=-1:1:2] arrow \
from i,j,1 to i-0.05,j,1+0.25 lw 1 nohead
set for [i=-1:1:2] for [j=-1:1:2] arrow \
from i-0.05,j,1+0.25 to i+0.05,j,1+0.75 lw 1 nohead
set for [i=-1:1:2] for [j=-1:1:2] arrow \
from i+0.05,j,1+0.75 to i,j,2 lw 1 nohead
# Add ztics by hand. Use "for" if you have many tics
set ztics (-2, 0)
# We print the z value - 7, which is the amount we are shifting the
# upper surface
set ztics add ("10" 3, "12" 5)
# Plot shifting the surface
splot f(x,y)-7, g(x,y)
请注意,使用set arrow 定义的新边框将绘制在表面后面。如果您希望某个特定的位于前面,请将其从 set for 循环中取出并添加 front 关键字。