Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#745 closed upgrade (Done)

Updated Matlab Colormaps

Reported by: arango Owned by:
Priority: major Milestone: Release ROMS/TOMS 3.7
Component: Matlab Version: 3.7
Keywords: Cc:

Description (last modified by arango)

The color maps released on src:ticket:744 were modified to allow interpolation according to the number of colors requested. All the color maps have 256 values, except cm_delta with 512 values.

All the color maps have an optional input argument for the number of colors desired. For example, cm_balance.m has:

% CM_BALANCE: 256 color palette from CMOCEAN
%
% cmap = cm_balance(M)
%
% BALANCE colormap by Kristen Thyng.
%
% On Input:
%
%    M        Number of colors (integer, OPTIONAL)
%
% On Ouput:
%
%    cmap     Mx3 colormap matrix
%
% Usage:
%
%    colormap(cm_balance)
%    colormap(flipud(cm_balance))
%
% https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb
%
% Thyng, K.M., C.A. Greene, R.D. Hetland, H.M. Zimmerle, and S.F DiMarco, 2016:
%   True colord of oceanography: Guidelines for effective and accurate colormap
%   selection, Oceanography, 29(3), 9-13, http://dx.doi.org/10.5670/oceanog.2016.66
%

If we want to overwrite the default number of colors, we can use for example:

>> colormap(cm_balance(128));

or equivalent

>> cmocean('balance', 128);

notice that in cmocean the cm_ prefix is dropped. Read documentation by issuing the help command in Matlab.


Here are some of the examples with various color maps:

cm_balance:

https://www.myroms.org/trac/balance.png

cm_curl:

https://www.myroms.org/trac/curl.png

cm_delta:

https://www.myroms.org/trac/delta.png

cm_haline:

https://www.myroms.org/trac/haline.png

cm_matter:

https://www.myroms.org/trac/matter.png

cm_speed:

https://www.myroms.org/trac/speed.png

cm_solar:

https://www.myroms.org/trac/solar.png

cm_thermal:

https://www.myroms.org/trac/thermal.png

viridis:

https://www.myroms.org/trac/viridis.png

Change History (3)

comment:1 by arango, 7 years ago

Component: NonlinearMatlab
Resolution: Done
Status: newclosed
Type: bugupgrade

comment:2 by arango, 7 years ago

Description: modified (diff)

comment:3 by arango, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.