Dear everyone, I am a beginner in Gmt. This is the code I wrote :
import pandas as pd
import pygmt
fig = pygmt.Figure()
df1 = pd.read_csv (‘data1.csv’,sep=‘;’)
df2 = pd.read_csv (‘data2’, sep=‘;’)
#Définition de la Région d’étude
region=[12.7,15.3,3,6.5]
Interpolation par la méthode de courbure minimale, Tension = 0
grid1 = pygmt.surface(data=df1, region=region, spacing=0.0089, tension=0)
grid2 = pygmt.surface(data=df2, region=region, spacing=0.0089, tension=0)
#Définir la palette de couleurs
pygmt.makecpt(cmap=“rainbow”, series=[-120, -12, 4])
#Définition du subplot 1 ligne et 2 colonnes
with fig.subplot(
nrows=1,
ncols=2,
figsize=(“12c”),
autolabel=True,
sharex=“b”, # shared x-axis on the bottom side
sharey=“l”, # shared y-axis on the left side
frame=[“WSne”],
margins=[“6.5c”],
):
#Première carte
fig.basemap(region=region, projection="U33N/12c", panel=0)
#Représentation de la carte des anomalies de Bouguer XGMe_2019
fig.grdimage(grid=grid1, region=region, projection="U33N/12c",
cmap=True, panel=[0, 0])
#Ajout de l'échelle : Transparence 30, contour noirgris (gray30) épaisseur 0.5
# Cadre de forme arrondis
fig.basemap (frame=['lSENt', "xa0.2", "ya0.1"],
map_scale="jBL+o1c/1c+c-7+w50k+f+lkm+ar",
box="+gwhite@30+p0.5p,gray30,solid+r3p",)
#Ajout de la barre des couleurs
fig.colorbar(position="JML+o0.5c/0c+w12c/0.5c",
frame=["xa5f2+lAnomalies de Bouguer", "y+lmGal"])
#Seconde carte
fig.basemap(region=region, projection="U33N/12c", panel=1)
#Représentation de la carte des anomalies de Bouguer EIGEN6C4
fig.grdimage(grid=grid2, region=region, projection="U33N/12c",
cmap=True)
#Ajout de l'échelle : Transparence 30, contour noirgris (gray30) épaisseur 0.5
# Cadre de forme arrondis
fig.basemap (frame=['lSENt', "xa0.2", "ya0.1"],
map_scale="jBL+o1c/1c+c-7+w50k+f+lkm+ar",
box="+gwhite@30+p0.5p,gray30,solid+r3p",)
fig.show()
When using the subplot option to draw my maps, I can’t properly set up the options for an optimal display of my map, including figsize=(“12c”), fig.basemap (xxxxx). Here is the result it displays, can you help me?