How to make a 2D rainbow plot like
https://en.wikipedia.org/wiki/Visible_spectrum#/media/File:Spectrum.svg https://en.wikipedia.org/wiki/Visible_spectrum#/media/File:Spectrum.svg
This will make 1D line.
x=1:10; y = [2 2 2 2 2 2 2 2 2 2];length = size(x, 2);
d = length:-1:1;
p = patch([x ],[y ], [d ], 'EdgeColor', 'interp');
axis off
How to add the second dimension?

1 件のコメント

Rik
Rik 2017 年 10 月 10 日
Have a look at the doc for patch. If your code works (which depends on the colormap), it will most likely work for the FaceColor property.

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

 採用された回答

KSSV
KSSV 2017 年 10 月 10 日

1 投票

x=1:10; y = [2 2 2 2 2 2 2 2 2 2];length = size(x, 2);
d = length:-1:1;
p = patch([x ],[y ], [d ], 'EdgeColor', 'interp','Linewidth',20);

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeColor and Styling についてさらに検索

製品

タグ

質問済み:

Ole
2017 年 10 月 10 日

コメント済み:

Rik
2017 年 10 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by