How can I plot points of different color shade each iteration?
13 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have an iterative algorithm and every iteration it gives me some points.
I want to plot the points at each iteration on the same graph such that the final result is like this:
The problem is that I want that for each iteration the color of the points changes a little (like having a gradient of colors). This way I have a scale of color and it is possible to undersand which points belong to which iteration. I also want to insert in the graph a legend of the color shade.
I don't know if I explained myself well.
Thank you for the help
0 件のコメント
回答 (1 件)
KALYAN ACHARJYA
2019 年 11 月 7 日
編集済み: KALYAN ACHARJYA
2019 年 11 月 7 日
One way:
col=[define colors here];
% define colors in strings, like 'b','r'...see color in Matlab.
% Define colors equal to loop iterations
for loop ieration
scatter(variable1,variable2,col(i))
end
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Genetic Algorithm についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!