Plot data (3d) only inside polygon

조회 수: 5 (최근 30일)
Shakir Hussain
Shakir Hussain 2019년 3월 26일
편집: Shakir Hussain 2019년 3월 26일
I am trying to plot data (45*56*6) only inside polygon and i tried these steps
imported shapefile and run query to sperate data point inside and outside polygon as
for i=1:6;
isin = inpolygon(X,Y,S.X,S.Y);
test(:,:,i(~isin)) = NaN;
end;
and plot
for i =1:6
subplot(3,2,i);
imagesc(D_masked(:,:,i));
set(a,'AlphaData',~isnan(a))
end
but it did not work for me as
imagesc(xyz,'AlphaData',~isnan(xyz))
xyz here is equal to 45*56 2d data.
Any kind of help is appreciatable.
  댓글 수: 2
KSSV
KSSV 2019년 3월 26일
It can be done...what problem you are facing? Don't use imagesc. Use pcolor.
Shakir Hussain
Shakir Hussain 2019년 3월 26일
편집: Shakir Hussain 2019년 3월 26일
In first section crossponding values of each slice of 3d data with logical 2d data has to replace with NaN by keeping rest of all values as it is (that are 0-100) which I could not figure out. Secondly I would like to use imagesc instead of pcolor.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by