When I create an image and a color bar as follow,
hi = imagesc(rand(256, 256));hc = colorbar('peer', gca,'EastOutside','position',[0.1 0.05 0.02 0.8]);
and then change the range of my data using the command,
set(hi, 'CData', 200*rand(256,256));
and try to update the color bar using the command,
hc = colorbar('peer', gca,'EastOutside','position',[0.1 0.05 0.02 0.8]);
a new color bar is place on top of the old one. I expected the color bar to be updated.
Best Answer