Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gnuplot error (label has coord of 0) for histogram with logscale

Tags:

gnuplot

I'm trying to plot an histogram with a Y logscale. Here is my code:

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

I'm getting the following error:

"io_time.gp", line 11: label has y coord of 0; must be above 0 for log scale!

Although it seems unrelated to the content of the data file, this data file (io_time.dat) contains 4 columns: the first one for the label of each box, the second one for the box's height (all values are > 0), and the 3rd and 4th columns contain ylow and yhigh values (also > 0).

I'm using gnuplot 4.6 patchlevel 5 installed via MacPort on Mac OS X 10.7.5.

Any idea how to solve this problem?

EDIT: After investigation, it appears that a line in my $HOME/.gnuplot configuration file is causing the problem:

set label  textcolor rgb text_color font my_font

text_color and my_font are defined earlier as follows:

text_color = "#000000"
my_font = "Helvetica, 18"

Here is also a sample data file:

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
like image 502
sunmat Avatar asked Dec 08 '25 21:12

sunmat


1 Answers

So you basically already found the source of your problem: You set a label without giving explicit coordinates, in which case 0,0 is used. And this doesn't work with logarithmic scale. Since the labels are placed only when you plot, the line number of the plot command is reported.

BTW: Why do you set an empty label inside a configuration file?

like image 193
Christoph Avatar answered Dec 12 '25 00:12

Christoph



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!