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일

0 개 추천

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일

0 개 추천

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월 16일
편집: Sophia 2016년 12월 16일
I saved the file as xlsx, but could not upload it to math works so changed it to els file which has changed somehow the rows and column values, but i have that in 361*361 format.
I want to plot the polygons at those lat/long positions wherever i have the values in sgt file, so basically plot polygons for values other than NaN's
Sophia
Sophia 2016년 12월 16일
편집: Image Analyst 2016년 12월 17일
Something like the plot attached here.
Walter Roberson
Walter Roberson 2016년 12월 17일
If you cannot attach the xlsx directly, then you can zip it and attach the zip .
In what you had attached previously there were no lat or long values; perhaps they will show up in the more complete data.
Sophia
Sophia 2016년 12월 17일
Here it is, sheet 1 and 2 have long and lat
Walter Roberson
Walter Roberson 2016년 12월 17일
The .xlsx is 361 x 361, but otherwise it looks much the same as the .xls file. It has no header labels and none of the columns or rows is sharply different from the others, so none of them can represent latitude or longitude vectors that the other values are to be interpreted as being framed by.
Sophia
Sophia 2016년 12월 19일
What does that mean??
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--');
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일

0 개 추천

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?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Contour Plots에 대해 자세히 알아보기

질문:

2016년 12월 16일

댓글:

2016년 12월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by