Min and max from 2 columns together?


I make a graph of bathymetric profiles from two datasets.

My input file has 3 columns:

Distance Depth1 Depth2
0	-152.55	-117.873054095
0.0123720339307	-152.925	-117.851942863
0.0247440673746	-153.375	-117.830842926
0.037116100334	-153.675	-117.809752555


I use gmt info to automatically get the values for the Y axis but since I am ploting two profiles in the same axis, I need to search in columns 2 and 3 at the same time.

tmp_data-1: N = 5592 <0/69.1658529801> <-153.975/-138.525> <-156.889846945/-23.048061925>

Is it possible to analyze both colunm 2 and 3 together, so I could get something like:
tmp_data-1: N = 5592 <0/69.1658529801> <-156.889846945/-23.048061925>

Work around

I find this trick to get the values, but I wonder if there is a direct way to do it with gmt info.

gmt convert tmp_data -I2 > new_file
gmt convert tmp_data -I3 >> new_file
gmt info new_file

using bash simple one liner:
awk ‘{print $1, $2; print $1, $3}’ datafile | gmtinfo

Thanks. I am not sure but I think it is similar a solution.

The bash command is probably the most efficient …
However, if you reeeaaaalllyy want pure GMT (and flexibility) :slight_smile: :

gmt math -Q $(gmt math -i1,2 data.txt LOWER -Sf  =) MIN =
1 Like