As we all know, due to the existence of continental shelves and continental slopes, the ocean areas get smaller when it gets deeper. Below is my program to plot some contours in the ocean. It is mainly for the surface. In the surface, I use clip to draw the boundary of the land and ocean, but for the subsurface plots, the boundary of the land and ocean will move seaward correspondingly.
In my example, how do I allow the program to do the below?
(1) to continue to plot the land the same way as is,
(2) to plot the continental shelf/slope using a predefined color (For example, if I’m plotting a contour of my variable at 500m, this should be the region between the depth of 0 and -500m)
(3) to clip the contour using the new land/sea boundary at the deeper depth.
Below is my current code:
# Plot the land map, clipping water leaving land:
coast(region=(180,320,10,80), clip=:land)
grdimage!("@earth_relief_10m", shade=true)
coast!(clip=:end)
# Plot the contour of my variable, clipping land and leaving water
coast!(clip=:water)
cpt = makecpt(cmap=:jet, range=(0,5,0.02) );
grdimage!(G2, coast=true, color=cpt, frame=(annot=45,grid=45,title="test") )
coast!(clip=:end, show=1)
G2
above is the gridded data of my variable using mat2grid
.
For testing purposes, my G2 can be generated through:
lon = 20:0.25:379.75;
lat = -90:0.25:89.75;
Z = rand(0:5, 720, 1440);
G2 = mat2grid(Z, x=lon, y=lat);
Many thanks!