All the map plotting functions plot to the current axis, regardless of whether it's a subplot or not. So to plot to specific ones, either make sure your desired subplot is the current axis, or pass (... 'parent', mysubax) as properties.
Do you have coordinates to go along with your plotted arrays, or are you just assuming they fill the full global space? I'm assuming the latter in this example. Also, I cleaned up some of the unnecessary code (the limits and origin you specified are the defaults, and subplot is unnecessary when you're passing specific axes coordinates).
[Uwin, Vwin, Usum, Vsum] = deal(rand(50,100));
lt = linspace(-90, 90, size(Uwin,1));
ln = linspace(-180, 180, size(Uwin,2));
data = {Uwin, Vwin, Usum, Vsum};
pos = [...
0.04, 0.56, 0.45, 0.5
0.54, 0.56, 0.45, 0.5
0.04, 0.07, 0.45, 0.5
0.54, 0.07, 0.45, 0.5];
for ii = 1:4
ax(ii) = axes('position', pos(ii,:));
axesm('eqdcylin');
gridm on;
surfm(lt, ln, data{ii});
geoshow(coast, 'color', 'k');
tightmap;
end
Best Answer