Skip to content

Commit

Permalink
CUBEHELIX_VIEW: test code to call either COLORMAP or COLORORDER.
Browse files Browse the repository at this point in the history
  • Loading branch information
DrosteEffect committed Jan 13, 2024
1 parent ce61d0e commit a13ace1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cubehelix_view.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@
hgv = [];
nmr = dfn;
%
if false
% >R2019a only!
fnh = @colororder; %#ok<UNRCH>
else % default
fnh = @colormap;
end
%
err = 'First input <N> must be a real scalar numeric or [].';
if nargin==0 || isnumeric(N)&&isequal(N,[])
N = dfn;
Expand All @@ -89,7 +96,7 @@
'SC:cubehelix_view:N:NotAxesNorFigureHandles',...
'First input <N> may be an array of figure or axes handles.')
hgv = N(:);
nmr = arrayfun(@(h)size(colormap(h),1),hgv);
nmr = arrayfun(@(h)size(fnh(h),1),hgv);
N = nmr(1);
else
error('SC:cubehelix_view:N:UnsupportedInput', err)
Expand Down Expand Up @@ -272,7 +279,7 @@ function chvUpDt()
% Update external axes/figure colormaps:
nmr(1) = N;
for k = 1:numel(hgv)
colormap(hgv(k),cubehelix(nmr(k), prw(1:4),prw(5:6),prw(7:8)));
fnh(hgv(k),cubehelix(nmr(k), prw(1:4),prw(5:6),prw(7:8)));
end
%
drawnow()
Expand Down

0 comments on commit a13ace1

Please sign in to comment.