Creating a heat map that would color different sectors of a circle

4 views (last 30 days)
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.

Accepted Answer

Image Analyst
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
Amir A
Amir A on 8 Oct 2014
Hi,
I'm sorry, this is my first post so i am still kinda new to the whole thing. I have attached my plot which includes 197 circles, each with 3 sectors. Once the color map is set, how do i plot each sector individually to get the heat map?
Thank you very much.
Image Analyst
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.

Sign in to comment.

More Answers (1)

Thorsten
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.

Community Treasure Hunt

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

Start Hunting!