Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the maximum entry in large array data file gnuplot?

Tags:

plot

gnuplot

There is a data file data.dat which contains:

1   1   1   2   2   6   1
2   4   1   4   1   7   1
3   1   1   6   1   6   1
4   1   1   8   9   76  1
5   1   1   16  1   1   1
6   6   1   9   1   2   1
7   1   1   7   1   99  1
8   8   1   5   8   1   1
9   1   1   3   1   0   1
10  1   1   2   1   1   1

Using gnuplot we can find maximum value for a particular column (say 4th column) by using

stats "data.dat" u 4

My original file has more than 100 rows and columns, it's a large array of numbers. I need to find the maximum value from the entire array (here it is 99). Is there some trick in gnuplot to do so?

like image 394
Batfan Avatar asked Feb 05 '26 01:02

Batfan


1 Answers

To get the maximum valueof a matrix use

stats "data.dat" matrix
like image 98
Christoph Avatar answered Feb 12 '26 14:02

Christoph