Frage

so I'm fairly new to gnuplot and I'm stumped by an invaild command error I get when I try to use stats on a file in gnuplot.

The command in question:

gnuplot> stats "file.dat" using 1
stats "file.dat" using 1
         ^
         invalid command

The file works just fine with the plot command, as in:

gnuplot> plot "file.dat" using 1 with lines
plot "file.dat" using 1 with lines

The data file file.dat looks like this:

125.48  262.31
0.85    215.18
0.85    175.29
0.85    132.11
0.85    78.72
0.74    33.92
0.74    15.98
0.28    9.63
0.28    7.28
0.28    6.24
0.10    5.76
0.10    5.08
0.01    5.02
0.01    4.93
0.01    4.77

Thanks for any help you can offer!

War es hilfreich?

Lösung

The stats command is available only since version 4.6.0. In previous versions it is possible to access some data information only after plotting. That includes e.g. the exact data ranges, which are available through the variables GPVAL_DATA_X_MIN, GPVAL_DATA_X_MAX etc. Use

plot 'file.dat' using 1
show variables all

To see the available variables. Then you can do something like

plot 'file.dat' using 1
# do something with GPVAL_*
replot
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top