Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

1 Ansicht (letzte 30 Tage)
Zachary Berent
Zachary Berent am 20 Aug. 2015
Geschlossen: MATLAB Answer Bot am 20 Aug. 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

Antworten (1)

Varun Bhaskar
Varun Bhaskar am 24 Aug. 2015
Hi,
Please find the following link to be useful resource:

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by