Gnuplot x 轴分辨率
我正在尝试在 gnuplot 中绘制一个对数周期函数: cos((log(abs(t-Tc))*PI/log10(lambda) ) + phi)
但由于 log(x) 接近 x=0 的性质,绘图变得很难看。
如何在 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
我得到了更好的结果看图:
I'm trying to plot in gnuplot a log-periodic function: cos((log(abs(t-Tc))*PI/log10(lambda) ) + phi)
But because of the nature of log(x) near to x=0, the plot is getting ugly.
How to plot a log-periodic function in gnuplot so it looks nice?
My plot script looks like this:
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
After setting:
set samples 10000
I got a much better looking graph:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想提高分辨率,请尝试
其中
为整数。默认情况下,该整数设置为 100。根据需要增加该数字。不过,选择的整数越高,gnuplot 绘制图形所需的时间就越长。
If you want to increase the resolution try
where
<X>
is an integer. Per default this integer is set to 100. Increase that number to your needs.Though, the higher the integer is chosen the longer it will take gnuplot to plot the graph.