Logging gnuplot所有点y值未定义日志
我想绘制文件“hmax.txt”第一列和第二列的日志。 但是我收到了这个错误信息,我不明白为什么? 我在第二列中没有任何0Logging gnuplot所有点y值未定义日志,logging,gnuplot,Logging,Gnuplot,我想绘制文件“hmax.txt”第一列和第二列的日志。 但是我收到了这个错误信息,我不明白为什么? 我在第二列中没有任何0 plot 'hmax.txt' u (log($1)):(log($2)) ^ "plot", line 18: all points y value undefined! 我的打印文件: set term png size 800,800 set output "lois.png" set sty
plot 'hmax.txt' u (log($1)):(log($2))
^
"plot", line 18: all points y value undefined!
我的打印文件:
set term png size 800,800
set output "lois.png"
set style line 1 lc rgb "blue" lw 0.5
set title 'hmax en fonction de t' font ",20"
set xlabel 'temps t'
set ylabel 'hmax'
plot 'hmax.txt' u 1:2 with lp ls 1
unset key
set term png size 800,800
set output 'loiss.png'
set style line 1 lc rgb "blue" lw 0.5
set title 'log(hmax) en fonction de log(t)' font ",20"
set xlabel 'log(t)'
set ylabel 'log(hmax)'
set logscale xy
plot 'hmax.txt' u (log($1)):(log($2)) with lp ls 1
这里是我的数据文件“hmax.txt”
多谢各位 第2列中的值范围为
0.316
到1
。和log(1)=0
和log(0.316)=-1.15
。
因此,使用lp ls 1绘制'hmax.txt'u(log($1)):(log($2))中的所有y值均为零或负
如果将x轴和y轴都设置为对数比例,如何在对数绘图中绘制负值
根据您想做什么,可能:
set logscale xy
plot 'hmax.txt' u 1:2 with lp ls 1
或
如果要以对数比例绘制log($2)
,则取绝对值abs()
set logscale xy
plot 'hmax.txt' u (log($1)):(abs(log($2))) with lp ls 1
set logscale xy
plot 'hmax.txt' u (log($1)):(abs(log($2))) with lp ls 1