Question on a scatter plot
Show older comments
I did a bunch of searching but to no avail.
I am trying to make a plot with x and a corresponding y value (this is the easy part)
I want to include a 3rd value (which in my case is a corresponding RSM) And I want to make the lower values be one color, and gradually go to a different color for different values. So for every point on the plot, it has a color, darker being a low (or high) RMS value, and lighter being a high (or low) RMS.
I have tried gscatter, but I can't make it look like I need.
gscatter(x,y,RMS)
Thanks
Accepted Answer
More Answers (1)
Image Analyst
on 21 Oct 2013
0 votes
Scatter() takes arrays where you can define the size and color of the markers. Did you try to set them to something?
2 Comments
Michael
on 21 Oct 2013
Image Analyst
on 21 Oct 2013
Edited: Image Analyst
on 21 Oct 2013
Not if you do it correctly. Convert each value into a number from 0-255 where your min value is 0 and your max value is 255, for example using mat2gray() if you have the Image Processing Toolbox or manually if you don't. Then set each color in the colormap that you pass in to scatter() equal to the color from that row of a standard colormap like jet(255) so your min values will look blue and your max values will look red and in between values will be in between colors of the rainbow. You can use a simple for loop for that. I'll code it up later tonight when I have more time.
Categories
Find more on White 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!