hi, i’m trying to set the paper size of the map, but when I’m create the pdf the map is in the left bottom corner of the paper. Also I’d like to know if you can help by setting the north arrow on the map 
gmt begin map1_3 pdf
gmt set PS_MEDIA A4 FONT_LABEL = 10p MAP_FRAME_TYPE plain FONT_ANNOT_PRIMARY = 10p FONT_ANNOT_SECONDARY = 10p FONT_TITLE = 12p
gmt basemap -R116/123/16/19 -Jt120/1:10000000 -Ba5f --B+t"Mapa de batimetría y topografía"
gmt makecpt -Cbukavu -T-5402,-4000,-3500,-3000,-2000,-1500,-1000,-900,-800,-700,-600,-500,-400,-300,-200,-100,0,100,1000,2168.5 -Z -H> Topomap1.cpt
grdimage %Map1% -Jt120/1:10000000 -CTopomap1.cpt -Bxa3g3 -Bya1g1 -R116/123/16/19 -I-0.25
gmt coast -Jt120/1:10000000 -R116/123/16/19 -Df -W1p
gmt colorbar -Dx3.5c/-1c+w6c/0.2c+jTC+h -CTopomap1.cpt -Baf -I0 -R116/123/16/19 -Jt120/1:10000000
gmt end show
- Setting paper/PS size is not normally needed in modern mode, since it uses a huge canvas (10x10meter I think).
- You’re using
--B
(--B+t"Mapa de batimetría y topografía"
). GMT will use two dashes with longoptions; you’re not using longoptions here, so change --B
→ -B
. Curious how you were able to create the map…
- I don’t have your input grid that you’re using (
%Map1%
). If you need further help, you need to create a script that other people not having the %Map1%
grid can run.
- The grdimage call lacks the gmt prefix.
Anyway, I replaced your %Map1%
with @earth_relief_02
just to have something to work with. Removing PS_MEDIA A4
, and fixing some other stuff mentioned above, gives me this map:
gmt begin map1_3 png
gmt set FONT_LABEL = 10p MAP_FRAME_TYPE plain FONT_ANNOT_PRIMARY = 10p FONT_ANNOT_SECONDARY = 10p FONT_TITLE = 12p
gmt basemap -R116/123/16/19 -Jt120/1:10000000 -Ba5f -B+t"Mapa de batimetría y topografía"
gmt makecpt -Cbukavu -T-5402,-4000,-3500,-3000,-2000,-1500,-1000,-900,-800,-700,-600,-500,-400,-300,-200,-100,0,100,1000,2168.5 -Z -H> Topomap1.cpt
gmt grdimage @earth_relief_02m -Jt120/1:10000000 -CTopomap1.cpt -Bxa3g3 -Bya1g1 -R116/123/16/19 -I-0.25
gmt coast -Jt120/1:10000000 -R116/123/16/19 -Df -W1p
gmt colorbar -Dx3.5c/-1c+w6c/0.2c+jTC+h -CTopomap1.cpt -Baf -I0 -R116/123/16/19 -Jt120/1:10000000
gmt end show
Yes, that’s exactly the map i’m getting with the code, now that I know about the paper size I won’t struggle with it.
I’m also trying to set de north arrow but when I add the code in the line of gmt basemap it doesn’t show me the title or the arrow.
gmt grdcut @earth_relief_03m_g -Gearthrelief3m.grd -R116/123/16/19
Set Map1=earthrelief3m.grd
echo %Map1%
gmt begin map1_3 png
gmt set FONT_LABEL = 10p MAP_FRAME_TYPE plain FONT_ANNOT_PRIMARY = 10p FONT_ANNOT_SECONDARY = 10p FONT_TITLE = 12p
gmt basemap -R116/123/16/19 -Jt120/1:10000000 -B5g1 -B+t"Mapa de batimetría y topografía" -Tfx5c/5c+l[n]
gmt makecpt -Cbukavu -T-5402,-4000,-3500,-3000,-2000,-1500,-1000,-900,-800,-700,-600,-500,-400,-300,-200,-100,0,100,1000,2168.5 -Z -H> Topomap1.cpt
gmt grdimage %Map1% -Jt120/1:10000000 -CTopomap1.cpt -Bxa3g3 -Bya1g1 -R116/123/16/19 -I-0.25
gmt coast -Jt120/1:10000000 -R116/123/16/19 -Df -W1p
gmt colorbar -Dx3.5c/-1c+w6c/0.2c+jTC+h -CTopomap1.cpt -Baf -I0 -R116/123/16/19 -Jt120/1:10000000
gmt end show
Remember also that in mdoern mode, you don’t have to specify -J
and -R
more than once.
Given the way you have made your script, you need a call to basemap after grdimage to plot the north arrow, e.g.
gmt begin map1_3 png
gmt set FONT_LABEL = 10p MAP_FRAME_TYPE plain FONT_ANNOT_PRIMARY = 10p FONT_ANNOT_SECONDARY = 10p FONT_TITLE = 12p
gmt basemap -R116/123/16/19 -Jt120/1:10000000 -Ba5f -B+t"Mapa de batimetría y topografía"
gmt makecpt -Cbukavu -T-5402,-4000,-3500,-3000,-2000,-1500,-1000,-900,-800,-700,-600,-500,-400,-300,-200,-100,0,100,1000,2168.5 -Z -H> Topomap1.cpt
gmt grdimage @earth_relief_02m -CTopomap1.cpt -Bxa3g3 -Bya1g1 -I-0.25
gmt coast -Df -W1p
gmt basemap -Tdn0.95/0.82+w0.6c+f2
gmt colorbar -Dx3.5c/-1c+w6c/0.2c+jTC+h -CTopomap1.cpt -Baf -I0
gmt end show