caxis with HeatMap?
조회 수: 15 (최근 30일)
이전 댓글 표시
I'd like to specify the scale of the colormap used for a heat map.
It seems that something like caxis would be appropriate but it doesn't appear to work. All of the examples are for functions like surf.
Is there a way to use caxis to do this, or something else that would work for a heat map?
Thanks very much.
댓글 수: 0
채택된 답변
Patrick Kalita
2011년 7월 6일
Maybe I should have mentioned this in the answer to your previous question, but maybe the HeatMap object's plot method would be useful here. That method will render the heatmap image into a standard MATLAB axes. Then you can use all the standard graphics functions like colorbar and caxis with it.
For example:
data = gallery('invhess',20);
hm = HeatMap(data);
ax = hm.plot; % 'ax' will be a handle to a standard MATLAB axes.
colorbar('Peer', ax); % Turn the colorbar on
caxis(ax, [-3 10]); % Adjust the color limits
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!