我试图绘制Y对数刻度的直方图。这里是我的代码:Gnuplot错误(标签具有0的坐标)用于具有对数刻度的直方图
input_file = "io_time.dat"
output_file = "io_time.eps"
set terminal postscript eps size 4.0,3.5 enhanced color font "Helvetica,18" solid
set output output_file
set style data histogram
set style histogram cluster errorbars gap 1
set boxwidth 0.8
set logscale y
set ylabel 'I/O Duration (sec)'
set xtics mirror rotate by 45 right
plot input_file u 2:3:4:xtic(1) notitle fs pattern 1 lt 1
,我发现了以下错误:
"io_time.gp", line 11: label has y coord of 0; must be above 0 for log scale!
虽然看起来无关的数据文件的内容,此数据文件(io_time.dat)包含4列:第一个用于每个盒子的标签,第二个用于盒子的高度(所有值都大于0),第三个和第四个列包含ylow和yhigh值(也> 0)。
我在Mac OS X 10.7.5上使用通过MacPort安装的gnuplot 4.6 patchlevel 5。
不知道如何解决这个问题?
编辑:经过调查,似乎在我的$ HOME/.gnuplot配置文件中的行导致了问题:
set label textcolor rgb text_color font my_font
text_color和my_font如下早先定义:
text_color = "#000000"
my_font = "Helvetica, 18"
这里还有一个示例数据文件:
A 50.79841091632843 36.28489899635315 69.23793005943298
B 0.11200199127197266 0.032312870025634766 0.42415809631347656
C 0.10992197990417481 0.0323939323425293 0.41459178924560547
D 0.10762600898742676 0.03207087516784668 0.39806699752807617
E 0.03831331729888916 0.03720998764038086 0.04118704795837402
F 0.043952775001525876 0.04250597953796387 0.04720902442932129
G 0.03883504867553711 0.03631401062011719 0.04176783561706543
嗨!在Linux上运行v4.6 patchlevel 3,我从脚本中获得预期的输出。此外,我添加了一行零到我的数据文件,但gnuplot不在乎:留下新记录的空间并打印标签,但没有绘制框(当然),也没有打印错误消息。看起来数据文件并不重要。你如何运行这个代码?可能是,一些旧的设置是问题。 – sweber 2014-11-03 15:55:42
我只是运行“gnuplot io_time.gp”。我在我的$ HOME中有一个.gnuplot文件来配置一堆东西,但从来没有任何问题(过去,我在许多其他类型的地块中使用过一个logscale,但我不记得尝试过用直方图)。它在我的电脑上工作,所以我明天会检查它(并在必要时发布)。 – sunmat 2014-11-03 21:35:44
然后请发布一个最小的数据集,它允许重现您遇到的错误。 – Christoph 2014-11-04 08:11:10