Plot array data with its values only inside polygon

3 ビュー (過去 30 日間)
Shakir Hussain
Shakir Hussain 2019 年 2 月 19 日
コメント済み: Shakir Hussain 2019 年 2 月 19 日
I have a data 420*940*6 (the value of each grid varies from 0-100) and I want to plot data only inside polygon (s). lat (420*1) and lon1(940*1).
we can plot this signle page data in this way
S = shaperead(polygon);
N = length(S);
[X,Y] = meshgrid(lon1,lat1);
data= test;
for k = 1:N
idx = insidepoly(X(:),Y(:),S(k).X,S(k).Y);
hold on
plot(X(idx), Y(idx), 'r*')
end
How we can plot all pages (6) together according to values (0-100) as the attached figure?
Guide me in this regard.tp_sc-test.jpg

回答 (1 件)

KSSV
KSSV 2019 年 2 月 19 日
Read about inpolygon. This will pick the values lying inside the given polygon.
  1 件のコメント
Shakir Hussain
Shakir Hussain 2019 年 2 月 19 日
We can pick the values inside polygon and plot by inpolygon/insidepoly easily but I want to plot as per the values of each grid whcih varies frim 0-100.

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

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by