Domain of profile with gmt info

I make a profile like this from a data (@ship_15.txt). To get its exact “region” I use R=$(gmt info tmp_track -Ie). However I want to have an offset in the Y axis only so the line is over the frame. For this case I can get a practical solution with gmt info tmp_track -I0.001/100.

I would like to know if it is possible to get a region with the exact min/max in the X axis and offset in the Y axis.

gmt begin Profile png
	gmt mapproject @ship_15.txt -G+uk > tmp_track -o3,2 -fg -q0-100
	R=$(gmt info tmp_track -Ie)
	gmt plot tmp_track -W0.5,blue -JX10c/4c $R -Bxf+l"Distance (km)" -By+l"Depth (m)" 
gmt end

BTW I try:

gmt info tmp_track -I0/100
gmtinfo [ERROR]: Option -I: Must specify positive increment for column 0.

I see, so you are sort of looking for something like -Ie/100 (or I suppose -I0/100 is OK too). Will have a look.

1 Like

For the record, feature add in dev.

I have another doubt.

In the profile the depths valuers ranges from -1359 to -75. How can I do to extend those values a 5%, for example?

In this way, in the profile I will have a white space of 2.5% (above and below) between the extreme values and the frame.

I see that I can use gmt info -I0/100 but this works fine for depths. If I then change to Free Air Anomalies (for example) then I will have to change maybe to -I0/20. Si, Is there a way to have a fix gap in the Y axis?

Probably the idea would be something like -I0/5%

Interestingly, we have this for -R:

  1. -Ra[uto] or -Re[xact]. Under modern mode, and for plotting modules only, you can automatically determine the region from the data used. You can either get the exact area using -Re [Default if no -R is given] or a slightly larger area sensibly rounded outwards to the next multiple of increments that depend on the data range using -Ra.

But we do not have an approximate selection for gmt info. Perhaps combinations of -Ie, -Ia, -Ie/a -Ia/e could help. However, there is no user-selectable feature in the rounding (e.g., 5%) here, all auto.

I forgot that I could use -Ra or -Re and forget about gmt info.

This is with: gmt plot tmp_track -W0.5,blue -JX10c/4c -Ra -Bxaf+l"Distance (km)" -Bya

I would need something like -Re/a.

BTW, Why -Ra/e are only available for plotting modules?

I think it could be useful in cases for grdtrack and for remote data sets

gmt grdtrack profile -G@earth_relief -G@earth_mag ... -R"Region"

In the command above it is useful to define the region of the profile because otherwise the whole remote datasets are download.

Right now I am using: REGION=$(gmt info tmp_sample1d -I+e0.1) which I suspect it is similar to -Ra.

I wonder if it won’t be much work to allow -Ra for grdtrack

Should be doable under modern mode. Since -R is optional it would have to be -Re or -Ra. No point adding fluff since the BC pads will be filled with data anyway. If

gmt begin
gmt grdtrack … -Re …
gmt end

does not work then please make a feature request.


I think it doesn’t work. I get the plotting message. But I will check again and make the feature request if necessary.