How to fix axes in heatmap plot? The heatmaps are presented as a movie.

2 views (last 30 days)
I have a movie builded with heatmaps. When each heatmap is displayed, the axes are changing and I need the axes fixed.
The code that I am using is the following
% Declear all;
clc;
syms x y z S
var = {'GeneX','GeneY','GeneZ'};
Jnovo=[1,y^3,2*x;0,y^3,2*x;x^2,y^3,2*x];
Jsolnew(x,y,z,S) = [Jnovo]
A=rand(4,300);% import data from directory
a2=A;% coordinates of the equilibrium point.
numofGraphs=30;
bx=length(a2(1,1:numofGraphs));
workspace;
numberOfFrames = numofGraphs;
t = linspace(0, 5, numberOfFrames);
hFigure = figure;
vidHeight = 344;
vidWidth = 446;
allTheColorMaps = cell(numberOfFrames,1);
allTheColorMaps(:) = {zeros(256, 3)};
set(gcf, 'renderer', 'zbuffer');
for frameIndex = 1 : numberOfFrames
JacACDCnew(:,:,frameIndex) = Jsolnew(a2(1,frameIndex),a2(2,frameIndex),a2(3,frameIndex),a2(4,frameIndex));
ACDC_HmapJnew = double(JacACDCnew(:,:,frameIndex));
heatmap(var,var,ACDC_HmapJnew,'ColorScaling','log');
caption = sprintf('Frame #%d of %d, t = %.1f', frameIndex, numberOfFrames, t(frameIndex));
title(['Jac','s=',num2str(frameIndex)]);
drawnow;% allow to see the graph inmediately
end
% close(writerObj);
But in this moment, I have a problem with the color, for example the value 1 is changing the color, but this is wrong because the value 1 is always constant, and the color is changing when the next heatmap is plotted
I hope to find a way to fix the axes and see the evolution of the colors.

Answers (0)

Categories

Find more on Data Distribution Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!