Modify colorbar in .fig file
조회 수: 5 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (7개)
Sean de Wolski
2012년 2월 23일
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?
댓글 수: 0
sas0701
2012년 2월 23일
댓글 수: 2
Tom
2012년 2월 23일
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'
sas0701
2012년 2월 23일
댓글 수: 3
Sean de Wolski
2012년 2월 23일
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
2012년 2월 24일
댓글 수: 2
Sean de Wolski
2012년 2월 24일
CLim is the property of an axes; so get the children of the figure, and modify the clim property of them using set()
참고 항목
카테고리
Help Center 및 File Exchange에서 Colormaps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!