2016-03-06 46 views
2

有大量资源可以在线教你如何绘制带有断轴的二维图,例如, http://www.phyast.pitt.edu/~zov1/。基本上使用什么策略是使用多槽模式绘制两个图,并将它们组合在一起。瑕疵中的z轴

不过,我希望做的是打破了Z轴,考虑这两个表面:

Potential Energy Surface Example

因为两个表面之间的能隙大的,地面能量表面几乎是“平“在这个情节,但如果我们只绘制地面能量表面,我们可以看到它是不是‘平’的说法:

enter image description here

是否有打破Z轴做出的Gnuplot的一种方式显示表面的更多细节?多槽在这里不起作用,因为它是一个3d图。

+0

为什么你不想并排情节?即使您成功打破了z轴,两者也会叠加,一旦混合出现差异将很难发现它 – bibi

回答

4

您可以将上表面向下移动,并手动重新标记标签。以这个数字作为一个例子:

enter image description here

让我们的工作出了一些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) 

enter image description here

注意与set arrow定义新的边界将表面背后绘制。如果您希望某个特定的人位于前面,请将其从set for循环中取出,并将front关键字添加到该循环中。

+0

不错的锯齿形线条法。 – bibi