Filling Area with gray color scale.
조회 수: 11 (최근 30일)
이전 댓글 표시
I am working on a figure and a came up with a surface area which is cone shape(plotted by two variables X and Y), and has five layers. I want to fill the area of each layer based on the intensity of gray color represented by matrix Z. The figures changes therefore i cannot save it first and modify it rather I want to modify it on the plot as facecolor. When I use imshow(I, []);, the two figures are plotted differently.
How can I fill the area (Area) with various layers of imshow(I, []) colors? Be free to use ant example or linspace to generate X, Y and Z values.
X=[j,i]; % currently j=5,the maximum value of L i=301 ,but this can change based on the variable.
Y=[j,i]; % Y is not directly related to X, but the size varies.
Z=[j,i-1]; % Z varies from 0 to max of 100 and is set to represent a measure of the intensity of the gray color
I = mat2gray(Z,[0 max(max(Z))]);
imshow(I, []);
Color=['I' 'r' 'c' 'm' 'k'];
figure(14)
hold on
for j=L:-1:1 % is set currently at 5.
Area(j,:)=area(X(j,:),Y(j,:),'FaceColor',Color(j)); %Area layers.
end
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!