Reputation: 525
I'm creating the following heatmap:
h = HeatMap(CorrelationsMV, 'RowLabels', labels, 'ColumnLabels', labels, 'Colormap', map);
colorbar;
caxis([-1, 1]);
And for some reason, the colorbar is displayed in a second, empty heatmap :
While what I need is simply that: (that I can do manually through the GUI, but I need it to be automated)
Upvotes: 0
Views: 1878
Reputation: 301
Instead using colorbar the colorbar_levels will help if using older versions of matlab. The use is simple. you can google it
[h_bar]=colorbar_levels(Levls,varargin)
Upvotes: 0
Reputation: 3071
The HeatMap
graphics object does not support colorbar
method.
You can render it to a regular axes with the method plot
, then use colorbar
as usual:
h = HeatMap(CorrelationsMV, 'RowLabels', labels, 'ColumnLabels', labels, 'Colormap', map);
then:
plot(h);
colorbar;
or:
ax=h.plot;
colorbar(ax);
Upvotes: 1