MATLAB: How to give color bar to the data in world map

colormapworldmap

I have three values: Altitude: 15273×1 double Latitude: 15273×1 double Data (bro): 15273×1 double
I used below code for plotting:
figure;
worldmap world
plotm(lats,lons,bro);
The result is in below:
</matlabcentral/answers/uploaded_files/119201/plot_result.jpg> I want to make above plot like below with world map and color bar but I do not know how? Would you please guide me?
</matlabcentral/answers/uploaded_files/119202/swath.png> I used some codes like below but it did not work. %
f = figure('Renderer', 'zbuffer', ...
% 'Position', [0,0,800,600], ...
% 'visible', 'off');
%

% latlim=[floor(min(min(lats))),ceil(max(max(lats)))];
% lonlim=[floor(min(min(lons))),ceil(max(max(lons)))];
%
% h = axesm('MapProjection','eqdcylin','MapLatLimit', ...
% latlim,'MapLonLimit',lonlim,'Frame','on','Grid','on', ...
% 'MeridianLabel','on','ParallelLabel','on', ...
% 'MLabelParallel','south');
% setm(h,'MapLatLimit',latlim,'MapLonLimit',lonlim);
% setm(h,'Frame','on','Grid','on');
% surfm(lats, lons, bro);
% coast = load('coast.mat');
% plotm(coast.lat,coast.long,'k')
% tightmap;
% h = colorbar();
My file is big thats why I put my code and data in google drive: https://drive.google.com/open?id=1ja38Nmk1puo34QAwpSHGQce8IKAhrh03

Best Answer

I've never used plotm, but from the documentation it seems to be for 2D only, while what you want is 3D. You may wanna look into plot3m, geoshow or scatterm.
If you want a surface plot, then I would suggest first interpolating your data on a rectangular grid using meshgrid() and griddata(). Then you can use something like
g=geoshow(lat, long, Z,...
'DisplayType', 'surf')
with your interpolated data.
Scattered data require no interpolation:
h=scatterm(lat, long, markersize, Z,'filled');