Gnuplot 负 x 范围和对数刻度

Gnuplot negative x range and logscale

我正在尝试使用 Gnuplot 绘制一些数据,并希望在 x 轴上使用对数刻度。这不起作用,Gnuplot 给出错误 "x range must be greater than 0 for log scale"。我看到在 y 轴上使用负值的对数刻度的示例,并尝试对 x 轴进行类似的操作,但似乎我无法让它工作。最初我以为它会是零值,但即使我删除它们,它也不起作用。

这是一个小例子:

stats 'stat_data1'
num1=STATS_records
stats 'stat_data2'
num2=STATS_records

set terminal pdf
set output "Cumulative_noise.pdf"
set autoscale yfix
set autoscale xfix
set key bottom right
set xlabel 'Noise in dB'
set ylabel 'Percent'
set xrange [0:110] reverse
set logscale x

set style increment user
set style line 2  lc rgb '#FF0000' lt 1 pt 1 ps 1
set style line 3  lc rgb '#008000' lt 2 pt 2 ps 2
set style line 4  lc rgb '#0000FF' lt 3 pt 3 ps 3

plot 0/0 notitle,\
'stat_data1' u (-) : ((100.0/num1)) title 'Node 1' smooth cumulative,\
'stat_data2' u (-) : ((100.0/num2)) title 'Node 2' smooth cumulative

还有一些数据。第一个文件:

1437818411 -54 -95 85.2 0.0
1437818425 -54 -95 78.0 0.0
1437818440 -71 -95 38.7 0.0
1437818456 -70 -95 51.7 0.0
1437818471 -71 -95 42.0 0.0

第二个文件:

1437818545 -50 -95 43.7 100.0
1437818561 -51 -95 52.0 100.0
1437818576 -50 -94 79.4 0.10744142234781584
1437818592 -51 -94 16.6 0.308927509416507
1437818605 -49 -95 85.2 0.04368438558438699

我希望有人有想法,因为这会很方便。提前致谢!

xrange设置中给出的数字也以实际轴变换为准。

删除 set xrange [0:110] 修复错误。