Rank: 281756 based on 0 downloads (last 30 days) and 0 file submitted
photo

Alexander

E-mail

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by Alexander View all
Updated File Comments Rating
04 Nov 2014 Customizable Heat Maps Visualize data as a heatmap with many customizable options. Author: Ameya Deoras

There's also a bug in @getGraphicsObjectsPositions. If there's only one column in a heatmap (i.e. one column label), then "extents" is not a cell array. So you need to add the following check in two corresponding places where it is being used as a cell array:

if iscell(extents)
extents = vertcat(extents{:}); % Collect heights in one matrix
end

03 Nov 2014 Customizable Heat Maps Visualize data as a heatmap with many customizable options. Author: Ameya Deoras

And another small issue: you should not rely on the fact that axes are the current axes. Specifically, all the calls to @colorbar, such as the one below, should specify axes through 'peer' property:

c = colorbar(p.Colorbar{:});
% should be
c = colorbar(p.Colorbar{:}, 'peer', p.hAxes);
% etc

03 Nov 2014 Customizable Heat Maps Visualize data as a heatmap with many customizable options. Author: Ameya Deoras

To clarify, I made the following changes:

% in parseInputs():
p.addParamValue('XTick','NOT_SET');
p.addParamValue('YTick','NOT_SET');

% in setAxesTickLabels():
if ~isequal(p.YTick, 'NOT_SET')
ytick = p.YTick;
else
ytick = get(p.hAxes, 'YTick');
end
% and the same for XTick

Also, adjustAxesToAccommodateTickLabels() throws an exception when you pass empty hXText to it (that happens if you set 'XTick' to []). So I had to add the following to the beginning of this function:

if isempty(hXText)
return;
end

03 Nov 2014 Customizable Heat Maps Visualize data as a heatmap with many customizable options. Author: Ameya Deoras

Great utility, thanks!

One thing it still does not allow you to do, is set custom ticks on x/y axis. If there are too many ticks, you cannot use 'ShowAllTicks' option, and the ticks Matlab chooses by default may not be the ones you actually want. Essentially I had to modify the function to add two optional key-value parameters: 'XTick' and 'YTick' (the change is trivial, but would be nice to see it in the official version)

And another minor thing: when using it to plot correlations, you generally want your axes to be square, so I always end up adding the following line after using @heatmap:
set(axh, 'DataAspectRatio', [1 1 1]);
Would be nice if @heatmap accepted a flag and did it automatically if requested

15 Jan 2013 subtightplot Asymmetric subplots with variable inner gaps and outer margins. Author: Felipe G. Nievinski

Very useful. Thought of writing it myself before found this submission.

Contact us