MATLAB: Colorbar displays in new figure

Bioinformatics Toolboxcolorbarcolormapheatmap

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.

Best Answer

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.