Matlab colorbar peak value with exponentials

How can I control or monitor the exponential used in my colorbar?
Context: I am displaying an image and want to superimpose numbers (data values) on the image that will correspond (ignoring the exponential) to the numbers used in the colorbar beside the image.
My problem is that when I specify the following peak values, the associated exponentials in the colorbar are used:
Max val ______ Peak exponential
1.0e-5 ______ 10 X 10^-6
1.2e-5 ______ 1.2 X 10^-5
1.5e-5 ______ 15 X 10^-6
1.6e-5 ______ 1.6 X 10^-5
When I look deeper, the transition points between showing 10^-5 and 10^-6 seem pretty arbitrary (ie. 1.2748e-5 vs 1.2749e-5 displays exponentials of 1.2X10^-5 and 12X10^-6 respectively). The code I use to control the colorbar max/min is:
bots = 0; tops = 1.0e-5;
imagesc(A,[bots tops]);
Thanks,
Mike

답변 (2개)

Walter Roberson
Walter Roberson 2012년 6월 6일

0 개 추천

The only way to control the exponential is to set its axes tick labels manually. (A colorbar is actually an extra axes with a simple graphic drawn on it.)

댓글 수: 1

Mike
Mike 2012년 6월 6일
I don't need to control the exponential. is there any deterministic way of finding out what exponential is or will be displayed given a peak scale value?

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

Mike
Mike 2012년 6월 6일

0 개 추천

Found an answer... I can use
cb = colorbar;
labelVals = str2num(get(cb,'yticklabel'));
and process from there.

질문:

2012년 6월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by