Plotting hitmap with different box size
Mostrar comentarios más antiguos
Hello,
I have a 64x9 matrix and I want to plot a heatmap with different box sizes. Figure as below.

Can someone please help me with this? Added sample data file
5 comentarios
jonas
el 27 de Jul. de 2018
What do the size signify?
Mudasser Seraj
el 27 de Jul. de 2018
Walter Roberson
el 27 de Jul. de 2018
Neither heatmap() or HeatMap() (from Bioinformatics toolbox) can do this for you.
You might want to look in the File Exchange to see if you can find some code to adapt.
Mudasser Seraj
el 27 de Jul. de 2018
Editada: Mudasser Seraj
el 27 de Jul. de 2018
jonas
el 27 de Jul. de 2018
You can do this quite easily with scatter3. I'll give it a try.
Respuesta aceptada
Más respuestas (1)
Here's an alternative using scatter3.
%%Some data
[X,Y]=meshgrid(1:10,1:10);
Z=rand(10,10).*2-1;
figure;hold on
%%Scale for color
zc=(Z+1).*100;
cn = ceil(max(zc(:)));
cm = colormap(parula(cn));
%%Scale Z for box size
zb=abs(Z(:).*850);
%%plot and fix visuals
h=scatter3(X(:), Y(:), Z(:), zb,cm(ceil(zc),:),'s','filled')
colorbar
caxis([-1 1])
set(h,'markeredgecolor','k')
set(gca,'xtick',1:10,'ytick',1:10)
box on
axis([0,11,0,11])
view(2)
grid on
See attachment
1 comentario
Mudasser Seraj
el 30 de Jul. de 2018
Categorías
Más información sobre Data Distribution Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
