Creating a heat map that would color different sectors of a circle
4 views (last 30 days)
Show older comments
Hi all,
I have plotted 197 circles each with 3 sectors on a single plot. I have a value (a number between 1 and 30) associated with each sector and would like to create a heat type map that would color each sector of a circle based on its associated value. The values are stored in 3x197 matrix.
Any help is much appreciated.
0 Comments
Accepted Answer
Image Analyst
on 8 Oct 2014
Are these circles on an image? You forgot to show your plot/image so we have to just guess. Anyway, assuming the circle values are in an image with values rounded to the nearest integer (1 to 30), you can just apply a colormap to the figure
colorMap = jet(30); % Create a colormap with 30 different colors.
% colorMap is just a numerical array at this point,
% it's not been sent to the display adapter yet. We'll do that next.
colormap(colorMap); % Apply the colorMap to our figure.
2 Comments
Image Analyst
on 8 Oct 2014
Edited: Image Analyst
on 8 Oct 2014
OK. It would have been helpful if you'd thought to post that image in your original post. I think you'll have to follow the approach suggested by Thorsten. I was going to suggest the same thing now after I see your image above.
More Answers (1)
Thorsten
on 8 Oct 2014
You can define a colormap with 30 entries with, e.g.,
cmap = jet(30);
and then draw a filled circle segment with code from http://www.mathworks.com/matlabcentral/answers/6322-drawing-a-segment-of-a-circle and color the segment by using the number as index to your colormap. You have to do this for all three segments for all your 197 circles.
See Also
Categories
Find more on Blue 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!