How to get M_Map You can download the M_Map toolbox either as a gzipped tar-file , or as zip archive (Click on these links to download). If you are unpacking the zip file MAKE SURE YOU ALSO UNPACK SUBDIRECTORIES! Both are around 650k in size. Once you have this archive, read the Getting started section of the User's guide to correctly install this toolbox, and sections 9 and 10.1 to install TerrainBase and GSHHS respectively. A number of examples have been given to highlight the various capabilities of M_Map (thumbnails are shown above). You can also get m_namebox (a set of utilities for automatically adding names to your map), through its home page at http://www.nersc.no/~even/ . Matlab 是我们常用的一个画图和计算、仿真工具,在我们海洋科研中,经常在画图时需要加上底图(譬如海岸线,国界、省界线等等)。常用的一个工具包是M_map。但这里我要讲的是利用matlab自带的一个画图工具包话底图,这个工具包就是worldmap. worldmap的一般用法约为: figure; worldmap('china'); polcmap; 或者 figure; worldmap china; polcmap; 如果要加入颜色的画,一般可以这样: figure worldmap('china','patch') scaleruler 这时候问题就出来了。因为鬼子偷偷的讲台湾和大陆用两种颜色表示;甚至,如果你放大图片的画,会发现钓鱼岛也是不同颜色。这个是我们不能忍受的!!!!! 于是我就费了一点时间,琢磨这个画图,然后修改。下面是这个脚本程序,在matlab中执行就可,这时候台湾和钓鱼岛和大陆就是一个颜色了^_^。 用兴趣的朋友可以把这个用法举一反三((ZHOU Feng)zhoufeng@sio.org.cn。matlab版本是6.5)。 不过老实说,我不太用matlab自带的这个画图包,用M_map比较多一点。试验一下,感觉还可以用用。 画上述图的代码如下: % 把台湾和大陆合成一个文件保存起来,这样画图用patch就是一种颜色(Zhou Feng, 2008-06-30, SOED, Hangzhou)。 % % by ZHOU Feng % zhoufeng@sio.org.cn % SOED, 2nd Institute of Oceanography % 2008-06-30 s1 = worldhi('china'); s2 = worldhi('taiwan'); disp(s1); % add Taiwan together (ZHOU Feng)zhoufeng@sio.org.cn s = s1; s.lat = ; s.long= ; % add the Diaoyu Island (钓鱼岛) % 钓鱼岛群岛由钓鱼岛、黄尾岛、赤尾岛、南小岛、北小岛、大南小岛、大北小岛和飞濑岛等岛屿组成,总面积约7平方公里。 % 地理位置:东经123°-124°34′北纬25°40′-26°。 % % ---这里的分辨率只有两块 -- s3 = worldhi('japan'); %(ZHOU Feng)zhoufeng@sio.org.cn x = s3.long; y = s3.lat; idx = find(x123.0 x124.5); idy = find(y 25.5 y 26.0); m = length(idy); id= ; %(ZHOU Feng)zhoufeng@sio.org.cn end end %%longd = x(id); %%latd = y(id); % % find nan dtmp = find(diff(id)1); if isempty(dtmp) disp('no change') elseif length(dtmp)==1 idnew = ; else for j=1:length(dtmp) idnew = ; % 未试验,可能有误 end end longd = x(idnew); latd = y(idnew); s.lat = ; s.long= ; worldmap china h = displaym(s); polcmap OK!!!!!!!!!!!!!!!