我试图在 gnuplot 中绘制一个对数周期函数:cos((log(abs(t-Tc))*PI/log10(lambda) ) + phi)
但是由于接近 x=0 的 log(x) 的性质,情节变得丑陋。
如何在 gnuplot 中绘制一个对数周期函数使其看起来不错?
我的剧情脚本是这样的:
phi = 1
TcFormated = 9.67e+8
lambda = 2
PI = 3.1415
g(t) = abs(cos((log(abs(t-TcFormated))*PI/log10(lambda) ) + phi))
set tmargin at screen 0.01
set bmargin at screen 0.99
set lmargin at screen 0.01
set rmargin at screen 0.99
set xrange [8.4e+8:1.04e+9]
set yrange [0:1]
unset xtics
unset ytics
plot g(x) t '' w l
pause -1
设置后:
set samples 10000
我得到了一个更好看的图表:
最佳答案
如果你想提高分辨率试试
set samples <X>
哪里<X>
是一个整数。默认情况下,此整数设置为 100。根据需要增加该数字。
不过,选择的整数越大,gnuplot 绘制图形所需的时间就越长。
关于Gnuplot x 轴分辨率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36900133/