Skip to content

Commit b64ecc0

Browse files
Merge pull request #146 from dwschmid/patch-1
findColorbarAxis.m fix for new Matlab releases
2 parents 5d96564 + e01b091 commit b64ecc0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
function colorbarAxis = findColorbarAxis(obj,colorbarHandle)
2-
if isHG2
2+
if isHG2
33
colorbarAxisIndex = find(arrayfun(@(x)(isequal(getappdata(x.Handle,'ColorbarPeerHandle'),colorbarHandle)),obj.State.Axis));
4+
% If the above returns empty then we are on a more recent Matlab
5+
% release where the appdata entry is called LayoutPeers
6+
if isempty(colorbarAxisIndex)
7+
colorbarAxisIndex = find(arrayfun(@(x)(isequal(getappdata(x.Handle,'LayoutPeers'),colorbarHandle)),obj.State.Axis));
8+
end
49
else
510
colorbarAxisIndex = find(arrayfun(@(x)(isequal(getappdata(x.Handle,'LegendColorbarInnerList'),colorbarHandle) + ...
611
isequal(getappdata(x.Handle,'LegendColorbarOuterList'),colorbarHandle)),obj.State.Axis));
712
end
813
colorbarAxis = obj.State.Axis(colorbarAxisIndex).Handle;
9-
end
14+
end

0 commit comments

Comments
 (0)