assign colarmap to multiple lines' lengths
3 次查看(过去 30 天)
显示 更早的评论
I have a graph with weights associated to the edges. I plot the edges as lines and I would like to assign colors in a continuous colormap to each edge. Does any one know how to do it? Thanks.
0 个评论
回答(2 个)
Kelly Kearney
2013-6-25
Do you mean something like this?
x = 1:10;
y = rand(1,10);
w = 1:10; % weights
patch([x NaN],[y NaN],[c NaN], 'edgecolor', 'interp', 'facecolor', 'none')
0 个评论
Zhenjia
2013-6-26
1 个评论
Walter Roberson
2013-6-26
patch would not require that you divide the lines if you do not want the crossing to influence the coloring.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Color and Styling 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!