Scaling the colormap

Hi,
I have couple of number data as 512x512 matrix data, each point represents the height value. I plot the data by imagesc with gray colorscale and add a colorbar.
Each data has different maximum values as (18, 35, 50...) hence, MATLAB scale the colorbar automatically to the maximum of each data. But I want to use a universal scale maximum such as 50 which I can use for all individual data set.
Is it possible by using a code instead of clicking to colormap editor?
Thanks for help in advance

답변 (1개)

Wayne King
Wayne King 2011년 11월 19일

0 개 추천

You can use caxis() to provide a range of values -- min,max
You can also define your own colormap as a matrix map = and then call colormap(map)

댓글 수: 1

Özgür
Özgür 2011년 11월 19일
thanks for the answer Wayne King.
I also found another method to perform the same operation
set(gca, 'CLim', [cLow, cHigh]); but this command should be used before colorbar command.

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

카테고리

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

질문:

2011년 11월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by