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 で Create Plots on Maps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


