diff yetilab/plot/plot.yeti @ 131:70eaf374a1b5

Make charts non-animated; add a list of nice colours
author Chris Cannam
date Mon, 22 Apr 2013 10:24:44 +0100
parents aef0fbc65f16
children f268b2982ed4
line wrap: on
line diff
--- a/yetilab/plot/plot.yeti	Sat Apr 20 22:01:45 2013 +0100
+++ b/yetilab/plot/plot.yeti	Mon Apr 22 10:24:44 2013 +0100
@@ -14,6 +14,17 @@
 import org.jzy3d.plot3d.rendering.canvas: Quality;
 import org.jzy3d.plot3d.rendering.view.modes: ViewPositionMode;
 
+chartColours = [
+    new Color(161, 54, 2), // red
+    new Color(207, 228, 148), // grey-green
+    new Color(82, 126, 154), // dark steel blue
+    new Color(251, 116, 43), // light red
+    new Color(126, 33, 28), // dried blood!
+    new Color(21, 183, 197), // light blue
+    new Color(188, 13, 207), // mid purple
+    new Color(200, 125, 234), // light purple
+];    
+
 newMatrixMapper matrix =
    (class MMapper extends Mapper
         double f(double x, double y)
@@ -56,7 +67,9 @@
     ());
 
 plotBarChart keys unit values =
-   (chart = new Chart(Quality#Nicest);
+   (quality = Quality#Nicest;
+    quality#setAnimated(false);
+    chart = new Chart(quality);
     var n = 0;
     scene = chart#getScene();
     ticks = new float[length keys];
@@ -83,7 +96,9 @@
     ());
 
 plotLines xkeys unit values =
-   (chart = new Chart(Quality#Nicest);
+   (quality = Quality#Nicest;
+    quality#setAnimated(false);
+    chart = new Chart(quality);
     scene = chart#getScene();
     keys = keys values;
     n = length xkeys;
@@ -137,7 +152,7 @@
 
 plotStacked keys xkeys unit values normalised =
    (quality = Quality#Nicest;
-//    quality#setAnimated(false);
+    quality#setAnimated(false);
     chart = new Chart(quality);
     scene = chart#getScene();
     stacked = stack keys xkeys values normalised;