Colouring a bathymetry plot based on the slope degrees

Dear GMT developers and users,

Any idea how to colour a bathymetry plot based on their slope degrees like the one attached?

Help is greatly appreciated

bathymetry_slopes.pdf (156.9 KB)

You can create a slope grid from the bathymetry with these commands:

gmt grdgradient -D -Stemp_grid -fg
gmt grdmath ATAN R2D =

It works. Thank you.