积分 112
贡献
精华
在线时间 小时
注册时间 2017-1-17
最后登录 1970-1-1
2 金钱
clc;clear all;close all;
data=load('data.txt');
%data(14252,3)=nan;%发现有一个错误的降水数据,值为7.4728e+04
lat=data(:,1);
lon=data(:,2);
rain=data(:,3);
clear data
level0=find(rain==0);
level1=find(rain>0&rain<2);
level2=find(rain>=2&rain<4);
level3=find(rain>=4&rain<6);
level4=find(rain>=6&rain<8);
level5=find(rain>=8&rain<10);
level6=find(rain>=10&rain<20);
level7=find(rain>=20&rain<50);
level8=find(rain>=50);
rain(level0)=nan;
rain(level1)=1;
rain(level2)=2;
rain(level3)=3;
rain(level4)=4;
rain(level5)=5;
rain(level6)=6;
rain(level7)=7;
rain(level8)=8;
cmap=[0,0,0;166,242,142;57,168,3;93,184,255;4,0,249;1,117,72;248,4,252;225,79,0;111,2,0]/255;
set(gcf,'position',[100 100 618 750])
scatter(lon,lat,10,rain)
set(gca,'fontsize',18,'linewidth',1.5,'box','on')
xlim([105 112])
ylim([31 40])
colormap(cmap)
cb=colorbar;
caxis([-0.5 8.5])
set(cb,'ytick',0:1:9,'yticklabel',{'0','0-2mm/h','2-4mm/h','4-6mm/h','6-8mm/h','8-10mm/h','10-20mm/h','20-50mm/h','>=50mm/h'});
map = shaperead('shaanxi.shp');
title('陕西省雷达降水','fontsize', 14);
hold on
bou1_4lx=[map(:).X];
bou1_4ly= [map(:).Y];
plot(bou1_4lx,bou1_4ly); % 画边界线
hold on
用matlab画的图,加载了shp地图文件,怎么讲shp外面的点去掉
我来回答