# HG changeset patch # User Carlo de Falco # Date 1443713734 -7200 # Node ID 17e507df10e3a9a50241d6a875415d85d3d35bcf # Parent 2e7a091365162c167f4bd78319eb4cca78b1b099 Set the default colormap to 'viridis' * script/image/colormap.m: set the default colormap to viridis instead of jet. diff -r 2e7a09136516 -r 17e507df10e3 NEWS --- a/NEWS Wed Sep 23 12:14:43 2015 +0200 +++ b/NEWS Thu Oct 01 17:35:34 2015 +0200 @@ -1,6 +1,12 @@ Summary of important user-visible changes for version 4.2: --------------------------------------------------------- + ** The default colormap is now set to 'viridis' which is also + the default colormap in matplotlib. This new colormap fixes + some of the main issues with the old default colormap 'jet' + such as its bad 'luminance profile' and is also more similar + to Matlab's new default colormap 'parula'. + ** Octal ('\NNN') and hex ('\xNN') escape sequences in single quoted strings are now interpreted by the function do_string_escapes(). The *printf family of functions now supports octal and hex escape diff -r 2e7a09136516 -r 17e507df10e3 scripts/image/colormap.m --- a/scripts/image/colormap.m Wed Sep 23 12:14:43 2015 +0200 +++ b/scripts/image/colormap.m Thu Oct 01 17:35:34 2015 +0200 @@ -37,7 +37,7 @@ ## must be between 0 and 1 inclusive. The new colormap is returned. ## ## @code{colormap ("default")} restores the default colormap (the -## @code{jet} map with 64 entries). The default colormap is returned. +## @code{virdis} map with 64 entries). The default colormap is returned. ## ## The map may also be specified by a string, @qcode{"@var{map_name}"}, where ## @var{map_name} is the name of a function that returns a colormap. @@ -52,7 +52,7 @@ ## colormaps. The options @qcode{"register"} and @qcode{"unregister"} ## add or remove the colormap @var{name} from this list. ## -## @seealso{jet} +## @seealso{virdis} ## @end deftypefn ## Author: Tony Richardson @@ -79,7 +79,7 @@ map = varargin{1}; if (ischar (map)) if (strcmp (map, "default")) - map = jet (64); + map = virdis (64); elseif (strcmp (map, "list")) cmap = map_list; return; @@ -132,9 +132,9 @@ %! ## Create an image for displaying a colormap %! image (1:64, linspace (0, 1, 64), repmat ((1:64)', 1, 64)); %! axis ([1, 64, 0, 1], "ticy", "xy"); -%! ## Show 'jet' colormap -%! colormap (jet (64)); -%! title "colormap (jet (64))" +%! ## Show 'virdis' colormap +%! colormap (virdis (64)); +%! title "colormap (virdis (64))" %! disp ("Press a key to continue"); %! pause (); %! ## Show 'colorcube' colormap @@ -152,7 +152,7 @@ %! cmap = (get (gcf, "colormap")); %! assert (cmap, cmaptst); %! colormap ("default"); -%! assert (colormap (), jet (64)); +%! assert (colormap (), virdis (64)); %! colormap ("ocean"); %! assert (colormap, ocean (64)); %! unwind_protect_cleanup