Problem with the cross section

I guess I have a problem with pygmt.project

import pygmt

fig = pygmt.Figure()

pygmt.makecpt(cmap="red,green,blue", series="0,70,300,10000", output="quakes.cpt")

fig.coast(

    region=[25.0, 25.5, 35.0, 35.5],

    projection="M4i",

    frame=["xa2g2", "ya2g2pf3", '+t"Sumatra"'],

    land="lightbrown",

    shorelines="0.25p",

)

fig.plot(data="crosssection.dat", pen="faint", style="c0.15", cmap="quakes.cpt")

fig.plot(x=[25.140133, 25.363331], y=[35.175001, 35.109202], projection="M", pen=2)

fig.text(x=25.140133, y=35.175001, text="A", font="15,Helvetica")

fig.text(x=25.363331, y=35.109202, text="A'", font="15,Helvetica")

pygmt.project(

    data="crosssection.dat",

    unit=True,

    center="25.140133/25.363331",

    endpoint="25.363331/35.109202",

    convention="pz",

    width=[0, 10],

    outfile="cross_AA.dat",

)

fig.basemap(

    projection="X10/-6",

    region=[0, 21.57331168885003, 0, 30],

    frame=['xafg100+l"Distance"', 'yafg50+l"Depth"', "WSen"],

    yshift=1,

)

fig.plot(data="cross.dat", projection="X", style="c0.2", pen=1, color="red")

fig.text(x=10, y=10, text="A", font="13,Helvetica")

fig.text(x=490, y=10, text="B", font="13,Helvetica")

fig.savefig(fname="Arkaloxori.png")

fig.show()

crosssection.dat (30.3 KB)

???

I think i have problem to understand the width and of course with the subplot of the plots.

import pygmt

fig = pygmt.Figure()

# Make color palette for topography

pygmt.makecpt(cmap='geo', series='-500/2000/100', continuous=True)

# Plot high-resolution topography

region = [25.0, 25.5, 35.0, 35.5]  # Replace with the appropriate region for your data

# Add coastlines to the map

fig.grdimage(

    grid='@earth_relief_01s',  # Change to 30m for higher resolution

    region=region,

    projection='M4i',

    shading=True,

    frame=True

)

fig.plot(data="crosssection.dat", pen="faint", style="c0.15", cmap="quakes.cpt")

fig.plot(x=[25.14, 25.36], y=[35.17, 35.10], projection="M", pen=2)

fig.text(x=25.14, y=35.17, text="A", font="15,Helvetica")

fig.text(x=25.36, y=35.10, text="A'", font="15,Helvetica")

pygmt.project(

    data="crosssection.dat",

    unit=True,

    center=[25.14, 35.17],

    endpoint=[25.36, 35.10],

    convention="pz",

    width=[0, 2],

    outfile="cross_AA.dat",

)

fig.basemap(

    projection="X10/-6",

    region=[0, 21.57331168885003, 0, 30],

    frame=['xafg100+l"Distance"', 'yafg50+l"Depth"', "WSen"],

    yshift=-5,

)

fig.plot(data="cross_AA.dat", projection="X", style="c0.2", pen=1, color="red")

fig.text(x=10, y=10, text="A", font="13,Helvetica")

fig.text(x=490, y=10, text="B", font="13,Helvetica")

fig.savefig(fname="Arkaloxori.pdf")

fig.show()

crosssection.dat (30.3 KB)

It is not clear what kind of plot you are trying to make. Do you want to plot the cross-section in a 3-D perspective view under the topography? Or do you want to show the topographic map in map view with the cross-section plotted on top?