﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
745	Updated Matlab Colormaps	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:''' ==

[[Image(http://www.myroms.org/trac/balance.png, center, 600)]]

== '''cm_curl:''' ==

[[Image(http://www.myroms.org/trac/curl.png, center, 600)]]

== '''cm_delta:''' ==

[[Image(http://www.myroms.org/trac/delta.png, center, 600)]]

== '''cm_haline:''' ==

[[Image(http://www.myroms.org/trac/haline.png, center, 600)]]

== '''cm_matter:''' ==

[[Image(http://www.myroms.org/trac/matter.png, center, 600)]]

== '''cm_speed:''' ==

[[Image(http://www.myroms.org/trac/speed.png, center, 600)]]

== '''cm_solar:''' ==

[[Image(http://www.myroms.org/trac/solar.png, center, 600)]]

== '''cm_thermal:''' ==

[[Image(http://www.myroms.org/trac/thermal.png, center, 600)]]

== '''cm_viridis:''' ==

[[Image(http://www.myroms.org/trac/viridis.png, center, 600)]]
"	upgrade	closed	major	Release ROMS/TOMS 3.7	Matlab	3.7	Done		
