Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gnuplot bad data on line 1

Tags:

plot

gnuplot

Well, I am getting the error

    gnuplot> plot "plot_error.p"
                  ^
             Bad data on line 1

when trying to execute the plotting script plot_error.p on the following datafile (tesc_error.dat)

    2       0.02373300      0.00187922
    3       0.12182900      0.01080161
    4       0.30066000      0.02936487
    5       0.88415600      0.07882007
    6       1.70864800      0.14576794
    7       4.11814900      0.44127670
    8       8.79967900      0.84273207
    9       22.09179700     2.25049799
    10      54.13644000     5.28557289
    11      164.75478299    20.67593118
    12      376.32501997    39.98897077
    13      807.50995700    82.47956624

The script is

    set encoding iso_8859_1
    set terminal postscript eps enhanced color solid
    set xrange[1:14] 
    set yrange[0:900] 
    set title "1D MFPT" 
    set xlabel "{/Symbol G}" 
    set ylabel "t_{esc}" 
    unset key

    set output "tesc_error.eps" 

    y(x)=1/(9*x**(2/3))*exp(x-1)

    plot "tesc_error.dat" with yerrorbars, y(x) lt rgb "blue" 

    set key

The most weird thing is that I have recently plotted it without errors, but suddenly it pops that error. I've inspected line 1 of the datafile and nothing seems strange in it.

like image 232
Jesús Ros Avatar asked Mar 24 '14 16:03

Jesús Ros


1 Answers

The issue is that you call a script with the plot command.
Try:

load "plot_error.p"

instead.
The plot command expects a data file and not a script.

like image 160
Schorsch Avatar answered Oct 02 '22 01:10

Schorsch