필터 지우기
필터 지우기

colorbar/colormap issue

조회 수: 1 (최근 30일)
Jung
Jung 2016년 1월 27일
댓글: Jung 2016년 1월 28일
So I am trying to set my colorbar scale equal throughout the figures to show temporal variation in each grid. Now when I use caxis([min max]), colorbar scale changes but the map itself does not change at all and retain the same color. I'll attach the initial script. Let me know if you guys know how I can resolve this issue
Thanks,
initial code
h=imsc(grNPP2010,'jet',[0.75 0.75 0.75],grNPP2010==0,'w',isnan(grNPP2010));
c= colorbar;
axpos = get(gca,'Position');
cpos = get(c,'Position');
cpos(3) = 0.5*cpos(3);
set(c,'Position',cpos);
set(gca,'Position',axpos);
set(gca,'xtick',[]);
set(gca,'ytick',[]);
% text(0.05,0.1,['(b) dif. GPP (gC m^{-2} mon^{-1})'],'units','n','fontsize',10,'fontweight','b');
title('2010','fontsize',12,'fontweight','b');
caxis([0.06 600]);
  댓글 수: 2
Image Analyst
Image Analyst 2016년 1월 28일
What version are you using? Before R2014b there could only be one color map that applied to all axes in the entire figure. Starting with R2014b, each axes can have its own private colormap.
Jung
Jung 2016년 1월 28일
I am using R2014a. I'll update the version and see if the same issue occurs.
Thanks

댓글을 달려면 로그인하십시오.

답변 (1개)

Chad Greene
Chad Greene 2016년 1월 28일
I'm guessing the problem is imsc. Is that a specialized function you created? What happens if you change that line to
h=imagesc(grNPP2010);

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by