如何调整gnuplot中的matics-number?

时间:2019-01-07 08:12:08

标签: gnuplot

gnuplot自动获取合理的x / y范围和x / y-tic数(如附图中的大约5)会很有帮助。

但是,有时我想增加/减少抽烟次数。

当然,更改抽签的数量很容易。我想做的是利用gnuplot“自动抽动选择”的优势,但是调整抽动的数量。有什么办法可以解决这个问题?

谢谢!

2 个答案:

答案 0 :(得分:3)

好的,现在我明白了。特别是在多作图中,或者当图形相对于tic标签的大小变小时,tic太多。 在下面找到一种变通方法,该变通方法似乎在演示的案例中有效。如果它一直都能正常工作,则需要进行测试。缺点是您必须先绘制到一个虚拟表,才能得到gnuplot关于gnuplot放入GPVAL_...变量中的最小和最大抽动的建议,然后再次重新绘制。

在下面的图形中,第一行是gnuplot auto-tic,第二行是尝试进行半自动近似。也许这是进一步调整的起点。

### semi-automatic tics
reset session

Round(n) = gprintf("%.0e",n)
# or alternatively with less approximate tics: 
# Round(n) = gprintf("%.0e",n) + sgn(n)*10**gprintf("%T",n)
SemiAutoTicX(ApproxTicN) = Round((GPVAL_X_MAX - GPVAL_X_MIN)/ApproxTicN)
SemiAutoTicY(ApproxTicN) = Round((GPVAL_Y_MAX - GPVAL_Y_MIN)/ApproxTicN)

set multiplot layout 2,3 rowsfirst

### with gnuplot auto-tic
set xrange [-10:10]
plot x

set xrange [-100:100]
plot x**2

set xrange [-90:90]
plot x

### now with semi-auto tics
set style line 1 lc rgb "red"
set xrange [-10:10]
set table $Dummy
    plot x ls 1
unset table
set xtics SemiAutoTicX(5)
set ytics SemiAutoTicY(5)
replot

set xrange [-100:100]
set table $Dummy
    plot x**2 ls 1
unset table
set xtics SemiAutoTicX(5)
set ytics SemiAutoTicY(5)
replot

set xrange [-90:90]
set table $Dummy
    plot x ls 1
unset table
set xtics SemiAutoTicX(5)
set ytics SemiAutoTicY(5)
replot

unset multiplot

enter image description here

答案 1 :(得分:0)

不确定我是否正确理解了“更改抽签数量很容易”,也许我已经给出了您已经知道的答案-但无论如何:

来自$('#save_menu_button').click(function(){ var textFieldVal = $("#menu_value").val(); alert(textFieldVal); });

  

默认情况下,或者如果   help set xics选项已给出;否则,它们可能在   两种形式之一:

     

隐式,形式指定一系列   抽动将被绘制在值和之间的轴上   增量为。如果未给出,则假定   无穷大。增量可能为负。如果既不    给定,假定为负无穷大,为   假定为正无穷大,抽奖将在   的整数倍。

因此,首先-您可以自己进行设置:

autofreq

给你

enter image description here