How can I color a plot based on range of values?

6 views (last 30 days)
Sandhyaa S
Sandhyaa S on 10 Mar 2015
Answered: dpb on 10 Mar 2015
I have two vectors : X and Y. 'X' contains values of size of a component and 'Y' contains their deviations from performance. I would like to plot Y vs X as points and would like to color the plot based on certain range of values. The coloring should be such that it must denote the no. of components having a particular range of deviation (For example:If I have a range X1-X6 and Y1-Y6 and I find a large no. of components falling under that category I would like to color it red and would like other colors like green, blue, orange to indicate the no.of components as the values gradually move away from the X1-X6 and Y1-Y6 ; thus showing variation in the no. of components.) I hope this is possible in MATLAB. I did search for some answers but none of them helped me.
Please help. Thank you.

Answers (1)

dpb
dpb on 10 Mar 2015
doc scatter

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!