how to show my output data in map.
이전 댓글 표시
sir i want to plot my own output data in map.please help me. how will do this.sir i have 8 years annual time series of rainfall frequency and sir my data size is (20x22x8)(lon,lat,time).
thank you in advance.please sir help me.
댓글 수: 1
José-Luis
2014년 6월 10일
채택된 답변
추가 답변 (3개)
David Sanchez
2014년 6월 10일
you could take a look at the demos within Matlab documentation. You will find many working examples on data representation, like this one:
z=peaks(25);
surf(z);
colormap(jet);

Adapt your data to any of those examples.
댓글 수: 5
devendra
2014년 6월 10일
David Sanchez
2014년 6월 10일
You say your data size is (20x22x8)(lon,lat,time), could you give an example row of any year? I guess you have a 20x22 matrix for each year, but I'm guessing what's the 20x22 data
José-Luis
2014년 6월 10일
There is no way you can get such a high-resolution map with the data you have.
David Sanchez
2014년 6월 11일
You will have to present your data by year:
XX YY]= meshgrid(X1,Y1);
z=ltm(:,:,1);
surf(XX,YY,z')
xlabel('XX')
ylabel('YY')
view([0 90])

댓글 수: 11
devendra
2014년 6월 11일
Kelly Kearney
2014년 6월 11일
I'm guessing the density of your data is too high, hence the outlines of the grid cells are overwhelming the colors. Try adding
shading flat
after whatever you did to plot.
As for reading from a shapefile, do you have the Mapping Toolbox? (Several people asked this when you posted your original question, and you have yet to answer). If so, look at shaperead.
devendra
2014년 6월 12일
devendra
2014년 6월 12일
Kelly Kearney
2014년 6월 12일
What is "map viewer"? Does your license include the Mapping Toolbox? If you type ver, do you see it listed?
Did shading flat help at all?
You're going to have to put some effort in here, or we can't help you.
José-Luis
2014년 6월 12일
You keep asking for help, but you are not really answering the requests for clarification properly. That makes it difficult for people to help you.
José-Luis
2014년 6월 12일
Have you tried reading the documentation
doc shaperead
doc plotm
devendra
2014년 6월 12일
devendra
2014년 6월 12일
peterhack
2016년 11월 11일
As I have a question on the above example I will utilize this thread, hope that is alright. I am using the presented code to mask the data points outside the border. Works fine so far. However, I want to use the DisplayType surface. Thus I am using geoshow to plot the data. Unfortunately it does not fill the whole map within the borders as a buffer is left. Any hint?
file = 'TM_WORLD_BORDERS-0.3.shp';
S = shaperead(file, 'usegeocoords', true, 'selector', ...
{@(x) strcmp(x,'India'), 'NAME'});
x = linspace(min(S.Lon), max(S.Lon), 100);
y = linspace(min(S.Lat), max(S.Lat), 100);
[x,y] = meshgrid(x,y);
z = rand(100);
isin = inpolygon(x,y,S.Lon,S.Lat);
z2 = z;
z2(~isin) = NaN;
lnlim = [65 100];
ltlim = [5 40];
lt = linspace(ltlim(1), ltlim(2), 3);
ln = linspace(lnlim(1), lnlim(2), 3);
for ii = 1:2
ltbox{ii} = lt([1 2 2 1 1]'+(ii-1));
lnbox{ii} = ln([1 1 2 2 1]'+(ii-1));
end
[lnmask, ltmask] = deal(cell(2));
for ii = 1:2
for jj = 1:2
[lnmask{ii,jj}, ltmask{ii,jj}] = polybool('-', ...
lnbox{ii}, ltbox{jj}, S.Lon, S.Lat);
end
end
ltboxall = ltlim([1 2 2 1 1]);
lnboxall = lnlim([1 1 2 2 1]);
[lnmaskall, ltmaskall] = polybool('-', lnboxall, ltboxall, S.Lon, S.Lat);
figure('color','w');
worldmap('India');
geoshow(y, x, z2, 'DisplayType','surface')
contourcmap('jet',min(z):1:max(z),'colorbar','on','location','horizontal')
for ii = 1:4
patchm(ltmask{ii}, lnmask{ii}, 'w', 'edgecolor', 'none');
end
plotm(ltmaskall, lnmaskall, 'k');
카테고리
도움말 센터 및 File Exchange에서 Mapping Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


