Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

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

1 visualización (últimos 30 días)
Zachary Berent
Zachary Berent el 20 de Ag. de 2015
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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

Respuestas (1)

Varun Bhaskar
Varun Bhaskar el 24 de Ag. de 2015
Hi,
Please find the following link to be useful resource:

La pregunta está cerrada.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by