Hello guys:
please help me
How to get the base map to be in the right position with plot3d?
The script bellow:
import pygmt
import pandas as pd
#Read Data
data = pd.read_csv(‘Sulut_Catalog.csv’)
#Region
minlon, maxlon = 119.009904, 129.543823
minlat, maxlat = -1.916803, 6.398782
mindepth, maxdepth = -1000,0
region = [minlon,maxlon,minlat,maxlat,mindepth,maxdepth]
#pygmt Figure
fig = pygmt.Figure()
#Set the azimuth and elevation angle
perspective=[165,15]
#make color ramp for depth
pygmt.makecpt(cmap=“jet”, series=[data.depth.min(),data.depth.max()])
#plot 3d
fig.plot3d (region = region,
x = data.longitude,
y = data.latitude,
z = data.depth * -1,
size = 0.002 * (2**data.magnitude),
projection =‘M8i’,
style=“u”,
pen=“black”,
color=data.depth,
cmap = True,
frame=[‘SEnwZ1+b+t""’,‘xafg+l"latitude"’,‘yafg+l"longitude"’,‘zafg+l"depth (km)"’,],
label=[‘z+w1p’],
#frame =[“WsNeZ3”,‘xafg+l"longitude"’,‘yafg+l"latitude"’,‘zafg+l"Depth (km)"’],
perspective=perspective,
zscale=“0.01”)
#Plot basemap
fig.coast(region=[minlon,maxlon,minlat,maxlat],
projection=‘M8i’,
shorelines=‘0.25p,black’,
land=‘grey’,
#water=‘lightblue’,
perspective=perspective,
yshift=24.3)
#Plot colorbar
fig.colorbar(frame=‘af+l"Depth (km)"’,xshift=3.1,yshift= -25.3)
