Thursday, September 18, 2014

Map data matlab plot

Plotting Map in Matlab with the colorbar and NaNs set as transparent white.

Just call it with the lat,lon and Z (same size), and do caxis of your desire at the end. Voila!
Save it.
function hhf = mapme(Latitude, Longitude, Z)
hhf = figure
load coast
latlim=[floor(min(min(Latitude))),ceil(max(max(Latitude)))];
lonlim=[floor(min(min(Longitude))),ceil(max(max(Longitude)))];
ax = worldmap(latlim, lonlim);
pcolorm(Latitude, Longitude, Z);
geoshow(lat, long,'Color', 'black' )
colormap;
set(gcf,'Color','white')
% map2 = colormap; map2( 64, : ) = 1; colormap(map2);
colorbar

Wednesday, September 10, 2014

Map/ Figure with white color bar assignment to the lowest value

Sometimes we need the figures or plots showing the maps. The oceans/missing values are indicated in the data as NaN or -9999. This code will plot the data with the lowest value being shown as white color.
A = rand(55);

figure;
imagesc(A)
colormap(jet(33))
map2 = colormap; map2( 1, : ) = 1; colormap(map2)
cmap = colormap; % cmap nicely puts colormap into 3 col data
colorbar

Open Chrome or Firefox from command using matlab

This simple script in Windows 7/8 worked fine.

Sometime I need to open multiple urlwant string
urlwant = ["nabinkm.com"]
Voila!
   system(['start chrome ',urlwant])