Gnuplot bad data in row 1

Well, I get an error

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

when trying to print a script plot_error.pin the following data file ( 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

script -

    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 strangest thing is that I recently built it without errors, but suddenly it throws this error. I checked line 1 of the data file, and there is nothing strange about that.

+4
source share
1 answer

The problem is that you are calling the script with the command plot.
Try:

load "plot_error.p"

instead of this.
The command plotexpects a data file, not a script.

+5
source

Source: https://habr.com/ru/post/1533190/


All Articles