interpを使用した際に方向により異なる着色がされる現象を回避したい
6 views (last 30 days)
Show older comments
A = [0 0 0;0 1 0;0 0 0];
p = pcolor(A);
set(p,'FaceColor','interp')
このコードを実行すると以下のような図が描かれます
また、
B = [0 0 0;0 0 0;0 0 0];
p = pcolor(B);
set(p, 'FaceColor','interp','AlphaData',A,'FaceAlpha','interp')
これを実行すると以下のような図が描かれます
右斜めか左斜めかによって着色の方法が異なる為、どちらも中央が1、周辺が0なのにもかかわらず、歪んだ図になってしまいます。
pcolorでinterpを用いて他の大きな作図する際にこれが問題となってしまうのですが、中心にインクを一滴垂らして広がるような、どの方向にも均等に着色する方法はありませんか。
よろしくお願いいたします。
0 Comments
Accepted Answer
Hernia Baby
on 4 Aug 2022
A = [0 0 0
0 1 0
0 0 0];
A = interp2(A,5,'cubic');
pcolor(A);
shading interp;
axis square;
0 Comments
More Answers (0)
See Also
Categories
Find more on 地理プロット in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!