How do I plot a third variable as line color???
Show older comments
Hello all--
I'm looking to plot many curves (given by cells X and Y), and I'd like to specify the color of each curve by a third variable (array Z) and display a colorbar for Z.
Currently this is my code:
for i=1:length(X)
plot(X{i}, Y{i}, 'color', [1 0 Z(i)/max(Z)])
end
This allows me to plot each line as varying shades based on Z, but I have no clue how to make a colorbar.
Any help would be much appreciated!
Thanks, Jason
Accepted Answer
More Answers (0)
Categories
Find more on Orange in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!