Subplot GMT 6, help please

Hi, for my internship works I have to display gravity variation and disturbance. I successfully display it separately, one script for each, like this ( for disturbance) :

awk ‘{print $3180/3.14159 ,$2180/3.14159, $7}’ $FIC >disturbance.txt

gmt psbasemap -JQ25.0 -B30mf15m:Longitude:/15mf15m:Latitude:SEwn:.“Abs_dist_Pyr_65”: -R-1:30/2:00/42:35/43:20 -Xa2.0 -Ya11.5 -K -V> $PLOT
gmt pscoast -JQ -R -W1/0.01 -Slightblue -N1/255/255/255 -G200/200/200 -Df -X -Y -O -K -V>> $PLOT

gmt psxy disturbance.txt -R -JQ -Sc0.09 -C$CPT -O -K -X -Y >> $PLOT
gmt psscale -B20f5:“mGal”: -D0/0/24/0.3h -C$CPT -Xa14.5 -Ya10.0 -O -V >> $PLOT

But I can’t to display two figures in the same page, It appears in my research that I have to use subplot I read the documentation about subplot but to be honest I don’t understand how I can apply the recommendation for my work, I will appreciate if someone can help me please

If you’re using GMT 6, then creating subplots is much easier. The source of your problem is: you’re using classic mode. GMT 6 is most suitable for modern mode. See any of Examples 1, 2, 3 or 4 on

1 Like

Thank you very much for your answer. i read the example and try to adapt it to my case like this:


      awk '{print $3*180/3.14159 ,$2*180/3.14159, $6}' $FIC >gravipoints.txt
      awk '{print $3*180/3.14159 ,$2*180/3.14159, $7}' $FIC >disturbance.txt

     gmt begin panels 
     gmt subplot set

gmt subplot begin 2x1 -JQ25.0 -Bx30m  -By15m -R-1:30/2:00/42:35/43:20 -Fs16c/9c -A+JTL -T"Safire" -M0

    gmt subplot set 0,0 -Ce3c
    gmt makecpt -Cjet -T9.7/9.9/0.000001 -D 
    gmt plot -Sc0.09 -C  gravipoints.txt 
    gmt subplot set 1,0 -Ce3c
    gmt makecpt -Cjet -T-80/80/1 -D 
    gmt plot -Sc0.09 -C disturbance.txt

   gmt subplot end
   gmt end show

I get figures but also these error messages, can you help me understand what it means

    subplot [ERROR]: No subplot information file found!
    subplot [ERROR]: Unable to open file /home/shemsse/.gmt/sessions/gmt_session.22890/gmt.subplotorder.0!

Thank you in advance for your help and your time

  1. There is a mistake in your -R option of the subplot module. You’re using colon, :, instead of point, ., as decimal.
  2. Also, you didn’t specify any margin, -M, between the subplots.
  3. Delete the second line (gmt subplot set).
  4. Add an image format, such a png, jpg or pdf, to the GMT begin module.

If your dataset is not huge, upload it so that one can attempt debugging the error.

1 Like

The ddd:mm[:ss] syntax for geographical data is fine; it is that extra subplot command that needs to go

1 Like