can any one tell me how can i change the color of different part of a contour?like an image i attached here.I have no idea.thanks in advance

1 回表示 (過去 30 日間)
can any one tell me how can i change the color of different part of a contour?like an image i attached here.I have no idea.thanks in advance
  3 件のコメント
fariba amini
fariba amini 2016 年 7 月 14 日
I have the coordinates which are mentioned in image. thanks.I will try it.
fariba amini
fariba amini 2016 年 7 月 14 日
Dear Siva: I did what you said. but I've got a problem. I dont know how to change the color in "for loop".I use plot command in a "for loop".but I can not change the color in plot command.for example in first iteration I want to have red color and in second iteration i wanna have green color.I dont know what to do. thanks in advance

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

採用された回答

Walter Roberson
Walter Roberson 2016 年 7 月 14 日
colortable = [0 0 0; %black
0 .8 .1; %bright-ish green-ish
.05 .5 0.05; %darker green-ish
... %etc
];
for K = 1 : number_of_segments
these_x = segment_x{K};
these_y = segment_y{K};
this_color = colortable(K,:);
plot(these_x, these_y, 'Color', this_color);
hold on
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by