multiple colours in a trajectory plot
古いコメントを表示
I have a time series X, which I can plot in x-y plane.
plot(X(:,1), X(:,2), 'r.')
This gives a red dot colour. What I want to do is I want to make this graph such that the colour represents the colour of the rainbow. (Red at the start, violet in the end) This is so we can give a time sense of the trajectory.
How do we do this?
採用された回答
その他の回答 (1 件)
Walter Roberson
2018 年 4 月 10 日
0 投票
It is not possible to have multiple colors on a line create by a single call to plot() or the underlying function line() .
You can look in the File Exchange for a couple of contributions for drawing colored lines. One of them uses surface objects, and one of them uses patch objects.
カテゴリ
ヘルプ センター および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
