Modify colorbar in .fig file
Show older comments
Hello,
Is there anyway to rescale the colors in a figure and hence the colorbar?
eg. Right now colorbar is 0.1 to 0.5 BUT I want the colors in the figure rescaled to 0.1 to 0.7.
Is there anyway to do this without replotting the figure?
Thank you, S
Answers (7)
Tom
on 23 Feb 2012
1 vote
Try: caxis([0.1 0.7])
1 Comment
Sean de Wolski
on 23 Feb 2012
+1, You're right, this is probably more what sas0701 is looking for.
Sean de Wolski
on 23 Feb 2012
figure;
imagesc(magic(20));
h = colorbar;
pause %pause so you can see the change on the next line
set(h,'ylim',[30 60]);
Like this?
sas0701
on 23 Feb 2012
0 votes
2 Comments
Tom
on 23 Feb 2012
I tried it by opening a saved figure which had a color bar on, and it worked for me. But maybe you could try what Sean wrote, though you'll have to find the handle of the color bar yourself:
someone smarter than me might know a quicker way, but to get started you can do H=get(gcf,'children'), and find which one of those has the tag 'Colorbar'
Sean de Wolski
on 23 Feb 2012
h = findobj('tag','Colorbar')
sas0701
on 23 Feb 2012
0 votes
3 Comments
Tom
on 23 Feb 2012
What do you mean by rescaling - relative to what? Do you want new colors? A picture of the figure might be useful
sas0701
on 23 Feb 2012
Sean de Wolski
on 23 Feb 2012
Post the image to a free webhosting site and then use the << url>> tag to poast it in your question. Edit your original question to include the new info:
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
sas0701
on 23 Feb 2012
0 votes
sas0701
on 24 Feb 2012
0 votes
2 Comments
Sean de Wolski
on 24 Feb 2012
CLim is the property of an axes; so get the children of the figure, and modify the clim property of them using set()
sas0701
on 24 Feb 2012
Categories
Find more on Orange 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!