Colorbar displays in new figure
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello,
I am trying to add a colorbar to a heat map. I can do this for the most part through the GUI, but I'd like to do this from the command line.
hmo = HeatMap(dmo,'RowLabels', tblist, 'ColumnLabels', tblist, 'Colormap', bipolar);
colorbar;
displays the heat map, but causes the colorbar to display in a new figure (with a white plot area).
Thanks.
댓글 수: 0
채택된 답변
Patrick Kalita
2011년 7월 6일
The HeatMap object just doesn't support adding a colorbar programmatically. It is not a regular axes, which is why the colorbar function doesn't do what you expected.
댓글 수: 0
추가 답변 (3개)
Paulo Silva
2011년 7월 6일
Let me know if this is correct, you have the GUI open and you want to add the colorbar from a code on the command line?
If that's really what you want the problem can be corrected by going to GUI Options (layout editor (GUIDE) of your GUI) and clicking on the background with the right mouse button, select GUI Options and change the command-line accessibility to ON, that will allow the GUI figure and axes to become the current ones and the colorbar shows on them.
댓글 수: 0
Lucio Cetto
2011년 7월 11일
Adding to what Patrick said, please not that you can pass a PVP to the constructor HeatMap object with the colormap:
HeatMap(...,'COLORMAP',CMAP)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Colormaps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!