Dear Experts,
I’ve been working with the example from:
1. https://flint.soest.hawaii.edu/t/help-me-with-cross-section-plot/2391/4
So my example it is like this:
# /// Hypocenters /// #
df_hyps = pd.read_csv('/home/asus/Documents/Pdoc_res/Catas/example.dat',
delimiter=',')
pygmt.makecpt(cmap='haxby', series=[df_hyps.Depth.min(),
df_hyps.Depth.max()], reverse = True)
fig.plot(x=df_hyps.Lon, y=df_hyps.Lat,
size=0.15*(1.45**df_hyps.Mag), style='cc',
color=df_hyps.Depth, cmap= True, pen='0.5p,black')
# /// The line projection ///
fig.plot(x=[-66.74, -65.52], y=[-17.57, -17.10], projection="M", pen=2)
fig.text(x=-66.78, y=-17.53, text="A", font="15,Helvetica")
fig.text(x=-65.38, y=-16.92, text="B", font="15,Helvetica")
# /// Stations /// #
df_pobbb = pd.read_csv(r'/home/asus/Documents/PyTools/places/POB_BB.dat')
fig.plot(x=df_pobbb.Lon, y=df_pobbb.Lat, style="t0.33c", pen="1.0p,yellow",
color='black')
df_pobsp = pd.read_csv(r'/home/asus/Documents/PyTools/places/POB_SP.dat')
fig.plot(x=df_pobsp.Lon, y=df_pobsp.Lat, style="t0.33c", pen="1.0p,yellow",
color='black')
fig.colorbar(frame=["x+lDepth", "y+lkm"], position="JMR+o0.5c/0c+w8c")
#%%
# --- The projection --- #
pygmt.project(
data="/home/asus/Documents/Pdoc_res/Catas/example.dat",
unit=True,
center=[-66.74, -17.57],
endpoint=[-65.52, -17.10],
convention="pz",
width=[-100, 100],
outfile="/home/asus/Documents/Pdoc_res/Catas/cross.dat",
)
fig.basemap(
projection="X10/-6",
region=[0, 250, -5, 70],
frame=['xafg50+l"Distance"', 'yafg25+l"Depth"', "WSen"],
yshift=-7,
)
fig.plot(data="/home/asus/Documents/Pdoc_res/Catas/cross.dat",
projection="X", style="c0.2", pen=1, color="red")
However, I have an empty cross section profile. What did I do wrong? (I attach the example.dat file and the result).
example.dat (2.4 KB)
Stay safe and b est regards