在图层3dPlot上绘制网格(Gnuplot 5)

时间:2015-10-14 12:26:04

标签: gridview gnuplot

我的情节看起来像这样: enter image description here

为了更好地改善情节,我想在这样的图层上查看网格(对不起油漆工作感到抱歉): enter image description here

我检查了文档中的网格章节。 有没有办法为每个z tic设置网格,然后只在显示数据的彩色部分显示

到目前为止,这个帮助还不行,我的数据看起来像这样:

2015-03-22 06:00    0.00    0.58    0.00    0.58    9   8.2 8.2 8.2 64  1.8 1.8 NNW 0.11    3.6 NNW 7.2 7.8 6.8 4.7 1016.8  0.00    0.0 0   0.00    0   0.0 0.00    0.0 0.007   0.000   21.4    28  2.2 19.4    0.05    15  1   65.2    1   1.8823831042606498  659.801927242555

2015-03-22 06:01    0.00    0.58    0.00    0.58    9   8.2 8.2 8.2 64  1.8 0.4 NNW 0.03    1.8 NNW 8.2 7.8 7.8 5.6 1016.9  0.00    0.0 0   0.00    0   0.0 0.00    0.0 0.007   0.000   21.4    28  2.2 19.4    0.00    16  1   69.6    1   1.926984097278376   644.530487695342

2015-03-22 06:02    0.00    0.58    0.00    0.58    9   8.2 8.2 8.2 64  1.8 2.7 NNW 0.16    3.1 NNW 6.5 7.8 6.1 3.9 1016.9  0.00    0.0 0   0.00    0   0.0 0.00    0.0 0.007   0.000   21.4    28  2.2 19.4    0.00    11  1   47.8    1   1.8741943892130313  662.6847285150141

有多个文件,全部包含一天 在这个情节中,我使用3:43:1 所以一个数据:数据:日期(%Y%m%d)

1 个答案:

答案 0 :(得分:1)

编辑:我发现在发布之后,这对每种类型的数据集都不起作用。这将取决于您的数据结构,但我把它留在这里,因为它可能会帮助您进一步。我建议你提供一些样本数据,这样可以更容易地提供解决方案。

我认为最简单的方法是使用相同的绘图语句重复生成彩色曲面的绘图,但使用线而不是pm3d。 (假设您使用了pm3d)。您可以通过更改等值样本来更改曲面上网格的密度。

set isosamples 20,20

sp "data.txt" w pm3d notitle,\
   "data.txt" w l lt 1 lc rgb "grey50" notitle

完整的工作示例

set terminal postscript enhanced color
set output "plot.eps"

# Change these two values to rotate
set view 50,50

# Density of grid for functions
# Higher numbers here will change density if the grid in the surface
set isosamples 20,20 

# Axis labels
set xlabel "x"
set ylabel "y"
set zlabel "z"

# Axis ranges
set xrange[0:5]
set yrange[0:5]
set zrange[0:5]
set cbrange[0:5]

# Defining functions as I have no data
f(x,y)= (x > 0 && x < 2 && y > 1 && y < 3 ) ? 3 : 1/0
g(x,y)= (x > 3 && x < 4 && y > 1 && y < 3 ) ? 4 : 1/0
h(x,y)= (x > 2 && x < 5 && y > 0 && y < 2 ) ? 1 : 1/0
i(x,y)= (x > 4 && x < 5 && y > 3 && y < 5 ) ? 2 : 1/0

# Grid on xy plane
# Change xtics for denser grid
set xtics 1.0
set ytics 1.0

set grid ytics lc rgb "#bbbbbb" lw 1 lt 0
set grid xtics lc rgb "#bbbbbb" lw 1 lt 0

# No colorbox
unset colorbox

# Plotting
sp f(x,y) w pm3d notitle,\
   f(x,y) w l lt 1 lc rgb "grey50" notitle,\
   g(x,y) w pm3d notitle,\
   g(x,y) w l lt 1 lc rgb "grey50" notitle,\
   h(x,y) w pm3d notitle,\
   h(x,y) w l lt 1 lc rgb "grey50" notitle,\
   i(x,y) w pm3d notitle,\
   i(x,y) w l lt 1 lc rgb "grey50" notitle

产生以下结果

result