Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Why does my image come up twice - once as a HeatMap and once as a figure?

1 vue (au cours des 30 derniers jours)
Zachary Berent
Zachary Berent le 20 Août 2015
Clôturé : MATLAB Answer Bot le 20 Août 2021
Hi, sorry Matlab noob.
Whenever I run my script to plot my heatmap, it pops up twice, once as a heat map after HMobj = HeatMap(...) and then as a figure after ax = HMobj.plot; (sample below). Why does this happen? Can I only get it to pop up once?
I've tried hold on, and other similar tactics from other questions, with no luck.
Side note: I'm trying to make a custom axis for my Heatmap, from [-1 2], although some of my files will only go [0 2] or so, but i want to keep the scale the same for all. So if you know a shorter way to do this, thanks.
feature = [1 0 0; 0 2 1; -1 0 0];
Map = [0 0 1; 1 1 1; 0 0 0; 0 1 0];
HMobj = HeatMap(feature,'ColorMap',Map);
addTitle(HMobj,'Blue is off; Green is on; Black is pattern');
ax = HMobj.plot; % 'ax' will be a handle to a standard MATLAB axes.
colorbar('Peer', ax); % Turn the colorbar on
caxis(ax, [-1 2]); % Adjust the color limits

Réponses (1)

Varun Bhaskar
Varun Bhaskar le 24 Août 2015
Hi,
Please find the following link to be useful resource:

Cette question est clôturée.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by