How to plot polygons

4 ビュー (過去 30 日間)
Sophia
Sophia 2016 年 12 月 16 日
コメント済み: Walter Roberson 2016 年 12 月 19 日
Please find attached the excel sheet that contains the long, lat and the statistically significant values in trends. I am able to plot these points where i have values in sgt file, but i want to plot it as a polygon. Any suggestions on how to plot the polygons wherever i have the data values.

回答 (3 件)

Sean de Wolski
Sean de Wolski 2016 年 12 月 16 日
Look at geoshow and patchm.
  1 件のコメント
Sophia
Sophia 2016 年 12 月 16 日
編集済み: Sophia 2016 年 12 月 16 日
I tried this, but it does not work
for ii = 1:361;
for jj= 1:361
if ~isnan(sgt(ii,jj));
h = patchm(lat,long,sgt,'b')
else
end
end
end

サインインしてコメントする。


Walter Roberson
Walter Roberson 2016 年 12 月 16 日
What are we looking at in that file? There is no header on it, and there are 361 rows by 256 columns, so it is not a matter of having a lat column, a long column, and a small number of columns of data corresponding to each location. Examination shows that none of the columns greatly differ from the others, so none of the columns correspond to latitude or longitude.
You also do not describe the kind of polygon that you want to plot over.
I suggest
num = xlsread('Plot_stats.xls');
surf(num, 'edgecolor', 'none')
  8 件のコメント
Sophia
Sophia 2016 年 12 月 19 日
編集済み: Sophia 2016 年 12 月 19 日
I Plotted this on top of my figure, but the result shows for each pixel not as polygon..since i am using plot
% Keep only statistically significant values
sgt = idanom_trend_per_winter;
sgt(idanom_trend_per_winter > 0.05 | isnan(idanom_trend_per_winter)) = NaN;
k = ((~isnan(sgt(:,:))));
lng = long(k(:,:));
lt = lat(k(:,:));
[i2,j2] = find((lat(k(:,:))) & (long(k(:,:))));
m_plot(lng(i2,j2),lt(i2,j2),'k--');
Walter Roberson
Walter Roberson 2016 年 12 月 19 日
If
idanom_trend_per_winter = xlsread('Plot_stats.xlsx', 'sgt');
then you have the problem that it is 269 x 256, not 361 x 361.

サインインしてコメントする。


Image Analyst
Image Analyst 2016 年 12 月 17 日
Did you try plot() to do the dashed lines, and fill() or patch() to fill the inside with colored tints?
  2 件のコメント
Sophia
Sophia 2016 年 12 月 17 日
I have already plotted my values using contourf, i just need to highlight the areas where i have statistically significant trends
Image Analyst
Image Analyst 2016 年 12 月 17 日
Did you try fill() or patch() to fill the inside with colored tints?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by