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개)

카테고리

제품

태그

질문:

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