我在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
答案 0 :(得分:5)
这适用于gnuplot 4.6:
set grid ztics
看一下这篇文章:http://gnuplot.sourceforge.net/docs_4.2/node188.html
对于一个复杂的例子:http://www.phyast.pitt.edu/~zov1/gnuplot/html/bargraphs.html
答案 1 :(得分:3)
遗憾的是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
结果:
您可能希望使用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
结果是:
您可以替换:
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 tics axis
set zeroaxis lt 1 lw 2 lc rgb "black"