How to have Subplots of heatmaps in Matlab

30 visualizaciones (últimos 30 días)
Sachindra Dhanapala Arachchige
Sachindra Dhanapala Arachchige el 17 de Abr. de 2018
Hi, I am trying to plot several heatmaps on the same figure as subplots. However I end up with individual figures. What the code produces is a figure named "HeatMap 1" and blank figure named "Figure 1". The figures do not have a coloubar as well, though i turned it on within the code. When I manually turn on the colorbar its limits are different from the limits that I specified in the code. Could someone kindly help me with this.
My code is as follows.
subplot(3,1,1);
HeatMap(Final_assessment_00001,'RowLabels', yvalues, 'ColumnLabels', xvalues, 'Colormap',autumn, 'Symmetric', false);
ax = H.plot; % 'ax' will be a handle to a standard MATLAB axes.
colorbar('Peer', ax); % Turn the colorbar on
caxis(ax, [-20 20]); % Adjust the color limits
subplot(3,1,2);
HeatMap(Final_assessment_00002,'RowLabels', yvalues, 'ColumnLabels', xvalues, 'Colormap',autumn, 'Symmetric', false);
ax = H.plot; % 'ax' will be a handle to a standard MATLAB axes.
colorbar('Peer', ax); % Turn the colorbar on
caxis(ax, [-20 20]); % Adjust the color limits
subplot(3,1,3);
HeatMap(Final_assessment_00003,'RowLabels', yvalues, 'ColumnLabels', xvalues, 'Colormap',autumn, 'Symmetric', false);
ax = H.plot; % 'ax' will be a handle to a standard MATLAB axes.
colorbar('Peer', ax); % Turn the colorbar on
caxis(ax, [-20 20]); % Adjust the color limits

Respuestas (1)

Walter Roberson
Walter Roberson el 17 de Abr. de 2018
This is not possible with the Bioinformatics HeatMap routine. HeatMap stores attaches several behaviors to the figure and those behaviors need to have a different result for each plot.
  3 comentarios
Walter Roberson
Walter Roberson el 17 de Abr. de 2018
No, you switched from using the Bioinformatics HeatMap to using the newer and different heatmap. HeatMap vs heatmap. You had asked about HeatMap and for those it is not possible to put them in a subplot.
Sachindra Dhanapala Arachchige
Sachindra Dhanapala Arachchige el 17 de Abr. de 2018
oh, yes. it seems you are correct. It's different heatmap, but does the job!. Thanks again!!!!

Iniciar sesión para comentar.

Categorías

Más información sobre Data Distribution Plots en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by