changeset 22442:638625a0186f

Update to latest line plot color order for Matlab compatibility (bug #48465) * graphics.cc (default_colororder): Return new default line plot color scheme. Colors are compatible with Matlab R2014b and later versions. * lines.m: Update doc string to reflect new default color order. * NEWS: Mention new default line plot color order.
author Mike Miller <mtmiller@octave.org>
date Tue, 06 Sep 2016 15:06:34 -0700
parents bb8914d68f25
children 70aa2b362a31
files NEWS libinterp/corefcn/graphics.cc scripts/image/lines.m
diffstat 3 files changed, 31 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Tue Sep 06 12:08:38 2016 -0700
+++ b/NEWS	Tue Sep 06 15:06:34 2016 -0700
@@ -16,6 +16,10 @@
 
     Examples: 0b101 == 5 or 0B1100_0001 == 0xC1
 
+ ** The default set of colors used to plot lines has been updated to be
+    compatible with Matlab's new default color scheme.  The line plot
+    color scheme can be set with the axes property "ColorOrder".
+
  ** 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
--- a/libinterp/corefcn/graphics.cc	Tue Sep 06 12:08:38 2016 -0700
+++ b/libinterp/corefcn/graphics.cc	Tue Sep 06 15:06:34 2016 -0700
@@ -242,24 +242,32 @@
 {
   Matrix retval (7, 3, 0.0);
 
-  retval(0,2) = 1.0;
-
-  retval(1,1) = 0.5;
-
-  retval(2,0) = 1.0;
-
-  retval(3,1) = 0.75;
-  retval(3,2) = 0.75;
-
-  retval(4,0) = 0.75;
-  retval(4,2) = 0.75;
-
-  retval(5,0) = 0.75;
-  retval(5,1) = 0.75;
-
-  retval(6,0) = 0.25;
-  retval(6,1) = 0.25;
-  retval(6,2) = 0.25;
+  retval(0,1) = 0.447;
+  retval(0,2) = 0.741;
+
+  retval(1,0) = 0.850;
+  retval(1,1) = 0.325;
+  retval(1,2) = 0.098;
+
+  retval(2,0) = 0.929;
+  retval(2,1) = 0.694;
+  retval(2,2) = 0.125;
+
+  retval(3,0) = 0.494;
+  retval(3,1) = 0.184;
+  retval(3,2) = 0.556;
+
+  retval(4,0) = 0.466;
+  retval(4,1) = 0.674;
+  retval(4,2) = 0.188;
+
+  retval(5,0) = 0.301;
+  retval(5,1) = 0.745;
+  retval(5,2) = 0.933;
+
+  retval(6,0) = 0.635;
+  retval(6,1) = 0.078;
+  retval(6,2) = 0.184;
 
   return retval;
 }
--- a/scripts/image/lines.m	Tue Sep 06 12:08:38 2016 -0700
+++ b/scripts/image/lines.m	Tue Sep 06 15:06:34 2016 -0700
@@ -21,7 +21,7 @@
 ## @deftypefnx {} {@var{map} =} lines (@var{n})
 ## Create color colormap.  This colormap is composed of the list of colors
 ## in the current axes @qcode{"ColorOrder"} property.  The default is blue,
-## green, red, cyan, pink, yellow, and gray.
+## orange, yellow, purple, green, light blue, and dark red.
 ##
 ## The argument @var{n} must be a scalar.
 ## If unspecified, the length of the current colormap, or 64, is used.