My goal is to plot a subsurface contour of a variable in the ocean, as well as the land and the continental shelf/slope area at that water depth. In order to do that, I would need to clip my data along the isobath of 500m, for example.
Below is my code to grdclip
both the land and my variable contour. Unfortunately, it is not working. I only see the plot for the contour, and can not really see the land part properly (no land contour color). Is that because grdclip
does not really cut a hole on the image as clip
does? What would be the solution then? Many thanks!
# grdclip the land:
G_land = grdclip("@earth_relief_10m", low=[-500 NaN]);
coast(region=(180,320,10,80));
grdimage!(G_land, shade=true, cmap=:geo, coast=true);
# grdclip the variable contour:
E_grid = mat2grid(Array(transpose(E)), x=lon, y=lat); # E is a grid data set of the global ocean:
mask1 = grdclip(E_grid, low=[-500 1], high=[-500 NaN]);
G2_clip = G2 * mask1;
cpt = makecpt(cmap=:jet, range=(0,5,0.02));
grdimage!(G2_clip, coast=true, color=cpt, frame=(annot=45,grid=45,title="test"), show=1);