Can data values be used to colour lines in the plot() function? As is the case with the scatter function
Show older comments
I have a series of (x,y) (x1,y1) point pairs with an associated attribute numerical value A.
I would like to plot each pair of points and colour the line joining them so the colour is representative of the size of A.
I know attributes can be used in the scatter() function to colour points http://www.mathworks.co.uk/help/techdoc/ref/scatter.html
Can this be done to colour the lines in plot graphs? I am assuming here that I will have to plot each pair of points separately, probably using a simple plot() function and hold on command, then loop through each pair of points. I would like to colour the lines to represent the entire range of A, can I integrate this into the plot command or should I setup a vector of colour specifiers relating to A?
Many Thanks
Mel
Accepted Answer
More Answers (0)
Categories
Find more on Discrete Data Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!