Plot grid data with lat and lon

Hi,
I am trying to map some data with latitude and longitude with their velocity vectors. I have already horizontal velocities on map by below code, but I want to have vertical velocities as different vectors on same map (simultaneously).
worldmap([-45 -10],[110 155])
load coast
geoshow(lat,long)
hold on
quiverm(lati,longi,ul,ug,'m')
hold on
stem3m(lati,longi,uu,'r-')
tightmap
But I have nothing for stem3m???? just have horizontal velocities on map.
How can I have two vector for each point (lat,lon)? one horizontal and another vertical???
Many thanks, Mahdiyeh

 Accepted Answer

Are Mjaavatten
Are Mjaavatten on 16 Dec 2015
This may give you what you want:
lat = -89.5:0.5:90; lon = 0:359;
data = sin(lat/180*pi)'*sin(lon/360*pi); % sample 360 by 360 data array:
figure(1); % Flat, color-coded map
h2 = surf(lon,lat,data); view([0,90]); axis([0,360,-90,90]);
set(h2,'edgecolor','none'); % remove edges
figure(2); % Sphere plot
[x,y,z] = sphere(360); h = surf(x,y,z,data); set(h,'edgecolor','none'); axis equal

More Answers (0)

Asked:

on 15 Dec 2015

Edited:

Jan
on 20 Nov 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!