문제

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
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top