Colorbar and colormap scale

조회 수: 10 (최근 30일)
S
S 2016년 7월 13일
댓글: S 2016년 7월 14일
I am trying to add a colorbar to a series of images that contain colormap data. The best colormap for my data , for visual purposes is prism, but I have trouble with the scaling of the colorbar. I have gaze data, which I passed through a bivariate histogram and normalized them to percentages of the total gazes on the image. I select the colormap for my image (prism) and everything goes well. But trying to add a colorbar, produces inane results. In this example, the range of my colorbar is set with to: caxis([0 100]); If I change the range and make the caxis from 0 - maximum percentage in my matrix, still the result is equally wrong, only with changed values on the bar. I want my colorbar to reflect the colors in the image, but it seems the colorbar comes from another colormap. In my code I first call the function that creates the image and then the colorbar and the caxis command. Am I missing something? :S
  댓글 수: 2
Walter Roberson
Walter Roberson 2016년 7월 13일
That certainly isn't a colorbar for prism.
Please show your colorbar() call
S
S 2016년 7월 14일
The problem is solved. I was getting the colormap through a dialogue, and when I later created the colorbar, it was the default colorbar. So the solution was this:
showmap(rgb,zvalues,colorfun)
%create colorbar with range
colormap(colorfun);
h=colorbar('southoutside');
where "colorfun" is the colormap defined from the dialogue box

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

답변 (0개)

카테고리

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