Hello,
Here is the script :
import pygmt
#pygmt.show_versions() ;
import pandas as pd
#pandas.version ;
from pygmt.src import whichdef Massin_M4_clean():
fname = which("Massin_M4_clean.dat") data = pd.read_csv(fname, header=1, sep=r"\s+") data.columns = [ "year", "latitude", "longitude", "depth_km", "magnitude", ] return datadata = pd.DataFrame(Massin_M4_clean())
region = pygmt.info(
data=data[[“longitude”, “latitude”, “depth_km”]],
per_column=True,
)R = [-64, -58, 11, 19]
Perspective = [135, 25]
fig = pygmt.Figure()
pygmt.makecpt(cmap=“rainbow”,A = 10, series=[data.depth_km.min(), data.depth_km.max()])
fig.plot3d(
x=data.longitude, y=data.latitude, z=-(data.depth_km), size=0.02 * (2 ** data.magnitude), projection="M8i", style="u", pen="black", color=data.depth_km, cmap=True, region=[ data.longitude.min(), data.longitude.max(), data.latitude.min(), data.latitude.max(), -(data.depth_km.max()), data.depth_km.min(), ], frame=[ 'SEnwZ1+b+t"French Antilles seismicity"', 'xafg+l"latitude (cm)"', 'yafg+l"longitude (cm)"', 'zafg+l"depth_km"', ], label=['z+w1p'], perspective= Perspective, zscale=0.1,)
fig.coast(shorelines=“1p,black”, region=region, projection=“M8i”, land=“#ffe398”,perspective=Perspective,yshift=24.3)
fig.colorbar(frame=‘af+l"Depth (km)"’,xshift=3.1,yshift= -25.3)
fig.show()
fig.savefig(“central-america-shorelines.png”)
And the resulting figure:
1 - I would like to know how to enlarge the font of the axes
2 - How do I add scaling to my X and Y axes?
3- Is it possible to replace the cubes by spheres? I have searched the GMT instructions “-S[symbol][size]”, but the only 3D figure is a cube, the rest is 2D…
thank you in advance for the help! ![]()
