Gnuplot负x范围和对数刻度

Gnuplot负x范围和对数刻度,gnuplot,Gnuplot,我正试图用Gnuplot绘制一些数据,并希望在x轴上使用logscale。这不起作用,Gnuplot给出错误“对数刻度的x范围必须大于0”。我看到一些例子,在y轴上使用带有负值的对数刻度,并尝试对x轴进行类似的操作,但似乎我无法让它工作。起初我以为是零值,但即使我删除它们,也不起作用 这是一个小例子: stats 'stat_data1' num1=STATS_records stats 'stat_data2' num2=STATS_records set terminal pdf set

我正试图用Gnuplot绘制一些数据,并希望在x轴上使用logscale。这不起作用,Gnuplot给出错误“对数刻度的x范围必须大于0”。我看到一些例子,在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 (-$3) : ((100.0/num1)) title 'Node 1' smooth cumulative,\
'stat_data2' u (-$3) : ((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
设置中给出的数字也受实际轴变换的影响


删除
设置xrange[0:110]
可修复此错误。

日志刻度
的“
x范围必须大于0”错误是因为您为
x
定义了一个包含零的范围(
设置xrange[0:110]
)。要修复此错误,您可以删除
设置xrange
行或为xmin定义一个非零值(例如
设置xrange[0.1:110]
)。这样就解决了问题,是的。最小值使它看起来有点尴尬,因为我无法删除该行,因为需要反转..这确实修复了它,但是xrange也没有反转。如果我使用正x值作为最小值,它会起作用,不过,它看起来确实有点奇怪,因为轴上显示的是最小值。那么
设置xrange[*:*]reverse
?同样的问题是,x轴没有反转。我的问题是,我需要从最小的负值开始,直到零。相反,设置xrange[:]reverse。