Reading Matlab help for contours in general plots I find examples like this:
Z = peaks;
figure
[C,h] = contour(Z,8);
clabel(C,h)
====
Then the contours can be customized, using the handles(? I don't really understand handles) C & h.
But I'm using geoshow. I was doing a color plot:
geoshow(newLat, newLon, pavrainData(:,:,i)', 'DisplayType','surface') % plot % values
colormap (flipud(parula))
colorbar
caxis([camin1 camax1]) % set colorbar axis
====
In that case I have control of the scale using colormap, and caxis and that's working fine. But I want to use contours instead *and* control which contour lines are displayed, e.g 0 50 100 150 200.
1. I tried to grab handles but that doesn't work:
[C,h]=geoshow(newLat, newLon, pavrainData(:,:,i)', 'DisplayType','contour'); % plot % values
clabel(C,h)
2. I tried to include the set contours in the geoshow command (trying similar syntax to the contour command) but that doesn't work:
geoshow(newLat, newLon, pavrainData(:,:,i)', 'DisplayType','contour',[0 50 100 150 200])
Really appreciate if someone can give me guidance - is the first method (ie #1) the correct approach, or the second (#2)? Or another way? And what's the correct syntax?
Basically I just want to plot set contour lines on a map from one variable.
Thanks!