MATLAB Answers

0

Divided colorbar automatically. Stop the blending of colors displayed

Asked by mashtine on 10 Mar 2016
Latest activity Commented on by mashtine on 11 Mar 2016
Hi there,
When I use the colorbar function I get a scale of blended colors and I would like to demarcate each color without having to define each of those colors explicitly. Is there a way to turn off this blending on colors so that I get specific color segments in the colorbar.
I am confused as to why I am having so much trouble finding information on this. Seems fairly simple!

  0 Comments

Sign in to comment.

2 Answers

Answer by Kelly Kearney
on 10 Mar 2016
 Accepted Answer

The default number of colors in a colormap is 64; if you decrease the number of colors, you get more discrete blocks:
colormap(parula(64));
colorbar;
vs
colormap(parula(10));
colorbar;
For more explicit control over color intervals, you might want to check out cptcmap.m

  1 Comment

Sign in to comment.


Answer by Image Analyst
on 10 Mar 2016

No. I think to demarcate each intensity somehow (like a special color, like every 10th gray level is black or whatever), you're going to have to specify the colormap very precisely. Don't be afraid of doing that. I have confidence in you that it's well within your abilities.

  1 Comment

Sign in to comment.