Seafloor age contours in pygmt

Hello,

I am new to pygmt and trying to create an age contour map similar to Example 49 in the GMT gallery (https://docs.generic-mapping-tools.org/latest/gallery/ex49.html). My question is about makecpt and how to get the contours from ‘@earth_age_03m’ I don’t understand how to write makecpt for the color code contours and how to make the contours in pygmt.

Thank you!

I’ve pasted my script below (.txt files are lat longs to stations):

import pygmt

GISBORNE_COORDS = (178, -38.65)

KWARGS = dict(
    grid='@earth_relief_15s',
    region=[175,230,-45,-15],
    projection= 'M4i',
    frame= True,)

KWARGS = dict(
    grid='@earth_age_03m',
    region=[175,230,-45,-15],
    projection= 'M4i',
    frame= True,)

fig = pygmt.Figure() 
fig.grdimage(**KWARGS)
fig.grdimage(shading=True, **KWARGS)  # Add illumination!
with fig.inset(position = "jTL+w2.0c+o0.05c", margin = 0, box = "+pred"):
    fig.coast(region="g", projection = "G180/-35/2.0c",land = "gray", water = "white",dcw = "NZ+gred")

inventory = pd.read_csv("Good23ORCAdb.txt", sep='\s+')

pygmt.makecpt()

POINT_FILL = 'blue'
fig.plot(
    x = inventory.lon,
    y = inventory.lat,
    style='c0.05i',
    color=POINT_FILL,
    pen='black',
    label=f'{POINT_FILL}',)

fig.text(x=175, y=-37,position=None,text='Gisborne', angle=0, pen='black',
        font='7p,Helvetica-Bold,black', justify='LM')
fig.plot(*GISBORNE_COORDS, style='s0.15i', color='red', pen=True, label='Gisborne')
fig.show()

inventory = pd.read_csv("Bad7ORCAdb.txt", sep='\s+')
POINT_FILL = 'red'
fig.plot(
    x = inventory.lon,
    y = inventory.lat,
    style='c0.05i',
    color=POINT_FILL,
    pen='black',
    label=f'{POINT_FILL}',)

fig.show(method='external')