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 Comments
KSSV (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/452434-plot-data-3d-only-inside-polygon#comment_685941
Shakir Hussain (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/452434-plot-data-3d-only-inside-polygon#comment_685948
Sign in to comment.