Impossible to display two binary maps with different colors with subplot

I am typing to plot two binary maps (A & B) with two different color map (map1 is red and map2 is green) in one figure using the subplot command. My codes goes as follow:
subplot(121) imshow(A,map1); subplot(122) imshow(B,map2);
Strangely enough, Matlab always display the two maps in the color of map2. This is not the case when the two maps are displayed in separate figures. How come?
Thanks for your help

 채택된 답변

Walter Roberson
Walter Roberson 2012년 11월 14일

0 개 추천

There is only one colormap per figures.
I recommend you use the FEX contribution "freezeColors" http://www.mathworks.com/matlabcentral/fileexchange/7943-freezecolors-unfreezecolors

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Blue에 대해 자세히 알아보기

질문:

2012년 11월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by