我在xzplane中显示网格时遇到问题.我改变了我的z轴位置,如下所示:
http://s14.directupload.net/images/130425/s9hi6ybj.png
现在我想在我的xz平面中有一个类似于xy平面的网格,但由于我对gnuplot很新,我找不到正确的命令.
我的代码看起来像这样:
set parametric
set xlabel "Abweichung"
set ylabel "Dosis [%]"
set zlabel "Volumen [%]"
set xrange [-1:1]
set yrange [0:100]
set zrange [0:100]
set xtics 0.2
set ytics 10
set ztics 10
set grid
set border 4095 ls 1 lc rgb "black"
set xtics axis
set ytics axis
set ztics axis
set xzeroaxis lt 1 lw 2 lc rgb "black"
set yzeroaxis lt 1 lw 2 lc rgb "black"
set zzeroaxis lt 1 lw 2 lc rgb "black"
set xyplane 0
splot [t=0:100] 0, t, t
Run Code Online (Sandbox Code Playgroud)
这适用于gnuplot 4.6:
set grid ztics
Run Code Online (Sandbox Code Playgroud)
看看这篇文章:http://gnuplot.sourceforge.net/docs_4.2/node188.html
对于一个复杂的例子:http://www.phyast.pitt.edu/~zov1/gnuplot/html/bargraphs.html
遗憾的是,该命令目前不支持此功能grid,可能应该发布功能请求。
无论如何,按照mgilson的建议,您可以使用 for 循环和命令手动添加网格线set arrow。例如添加以下两行:
set for [x = -10:10:2] arrow from x/10.0, 0, 0 to x/10.0, 0, 100 nohead lt 0
set for [z = 0:100:10] arrow from -1, 0, z to 1, 0, z nohead lt 0
Run Code Online (Sandbox Code Playgroud)
结果是:

您可能想使用 旋转绘图set view。除以十是因为浮点增量似乎不起作用。
或者,如果您希望网格位于盒子的背面,请执行以下操作:
set for [x = -10:10:2] arrow from x/10.0, 100, 0 to x/10.0, 100, 100 nohead lt 0
set for [z = 0:100:10] arrow from -1, 100, z to 1, 100, z nohead lt 0
set for [y = 0:100:10] arrow from -1, y, 0 to -1, y, 100 nohead lt 0
set for [z = 0:100:10] arrow from -1, 0, z to -1, 100, z nohead lt 0
Run Code Online (Sandbox Code Playgroud)
结果是:

您可以替换:
set xtics axis
set ytics axis
set ztics axis
set xzeroaxis lt 1 lw 2 lc rgb "black"
set yzeroaxis lt 1 lw 2 lc rgb "black"
set zzeroaxis lt 1 lw 2 lc rgb "black"
Run Code Online (Sandbox Code Playgroud)
与等效:
set tics axis
set zeroaxis lt 1 lw 2 lc rgb "black"
Run Code Online (Sandbox Code Playgroud)