Question

I tried to fit a HeatMap as a subplot of a plot. However it seems they are not compatible. Every time using a HeatMap function, it seems it will always open a HeatMap 'canvas'. If save the result of HeatMap as a object and use plot or view to put it into a figure, it always open a new figure window rather than plot on the existing one, even with the hold on; command. Is there a way to make the HeatMap as one of the subplots?

A heatmap example code:

y = [1,2,3,4;5,6,7,8;4,3,2,1;8,7,6,5];
obj = HeatMap(y,'Symmetric','false','colormap','jet'); %this will generate a HeatMap canvas
plot(HeatMap); %this will display or render the heatmap object into a figure window
Was it helpful?

Solution

It seems I should use imagesc rather than HeatMap function as imagesc is more compatible. By using imagesc to plot the matrix, I can easily set the heatmap as a subplot.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top