source: issm/oecreview/Archive/20545-21336/ISSM-21249-21250.diff@ 21337

Last change on this file since 21337 was 21337, checked in by Mathieu Morlighem, 8 years ago

CHG: added Archive/20545-21336

File size: 2.2 KB
  • ../trunk-jpl/src/m/plot/colormaps/bluewhitered.m

     
    1 function newmap = bluewhitered(m)
     1function newmap = bluewhitered(m,CAXIS)
    22%BLUEWHITERED   Blue, white, and red color map.
    33%   BLUEWHITERED(M) returns an M-by-3 matrix containing a blue to white
    44%   to red colormap, with white corresponding to the CAXIS value closest
     
    3333   m = size(get(gcf,'colormap'),1);
    3434end
    3535
    36 
    3736bottom = [0 0 0.5];
    3837botmiddle = [0 0.5 1];
    3938middle = [1 1 1];
     
    4140top = [0.5 0 0];
    4241
    4342% Find middle
    44 lims = get(gca, 'CLim');
     43if nargin < 2
     44        lims = get(gca, 'CLim');
     45else
     46        lims = CAXIS;
     47end
    4548
    4649% Find ratio of negative to positive
    4750if (lims(1) < 0) & (lims(2) > 0)
     
    119122%     newmap(:,i) = min(max(interp1(oldsteps, new(:,i), newsteps)', 0), 1);
    120123% end
    121124%
    122 % % set(gcf, 'colormap', newmap), colorbar
    123  No newline at end of file
     125% % set(gcf, 'colormap', newmap), colorbar
  • ../trunk-jpl/src/m/plot/colormaps/bluewhitered_smooth.m

     
    1 function newmap = bluewhitered_smooth(m)
     1function newmap = bluewhitered_smooth(m,CAXIS)
    22%BLUEWHITERED   Blue, white, and red color map.
    33%   BLUEWHITERED(M) returns an M-by-3 matrix containing a blue to white
    44%   to red colormap, with white corresponding to the CAXIS value closest
     
    4545% top = [0.7 0.0 0.15];
    4646
    4747% Find middle
    48 lims = get(gca, 'CLim');
     48if nargin < 2
     49        lims = get(gca, 'CLim');
     50else
     51        lims = CAXIS;
     52end
    4953
    5054% Find ratio of negative to positive
    5155if (lims(1) < 0) & (lims(2) > 0)
     
    123127%     newmap(:,i) = min(max(interp1(oldsteps, new(:,i), newsteps)', 0), 1);
    124128% end
    125129%
    126 % % set(gcf, 'colormap', newmap), colorbar
    127  No newline at end of file
     130% % set(gcf, 'colormap', newmap), colorbar
Note: See TracBrowser for help on using the repository browser.