필터 지우기
필터 지우기

How to get an area plot with varying colour intensity (1-D plot).

조회 수: 2 (최근 30일)
jitendra
jitendra 2016년 10월 10일
편집: Massimo Zanetti 2016년 10월 10일
How to get 1-D area plot with varying colour intensity?

답변 (2개)

KSSV
KSSV 2016년 10월 10일
t = linspace(0,2*pi) ;
x = sin(pi/2*t) ;
fill(x,t,x) ; % patch also can be used
If you have the exact fft data, you can get the one shown in image.

Massimo Zanetti
Massimo Zanetti 2016년 10월 10일
편집: Massimo Zanetti 2016년 10월 10일
I have found this workaround...
%3d coordinates of a curve
x = 0:.05:2*pi;
y = sin(x);
z = zeros(1,numel(x));
%color vector: a set of values that are mapped in the colorbar
col = rand(1,numel(x));
%plot the curve as a surface
surface([x;x],[z;y],[z;z],[col;col],...
'facecol','no',...
'edgecol','interp',...
'linew',2);
grid on; view([90,45,45]);
colorbar;
xlabel('x');
ylabel('y');
zlabel('z');
view([0,90]);
I have used random colors, but you play with it.

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by