changeset 20565:17e507df10e3

Set the default colormap to 'viridis' * script/image/colormap.m: set the default colormap to viridis instead of jet.
author Carlo de Falco <carlo.defalco@polimi.it>
date Thu, 01 Oct 2015 17:35:34 +0200
parents 2e7a09136516
children dcfbf4c1c3c8
files NEWS scripts/image/colormap.m
diffstat 2 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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 <arichard@stark.cc.oh.us>
@@ -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