interpを使用した際に方向により異なる着色がされる現象を回避したい
Ältere Kommentare anzeigen
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を用いて他の大きな作図する際にこれが問題となってしまうのですが、中心にインクを一滴垂らして広がるような、どの方向にも均等に着色する方法はありませんか。
よろしくお願いいたします。
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu 数学 finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!