changeset 553:25b925cf3c98

Merge
author Chris Cannam
date Mon, 31 Mar 2014 10:28:42 +0100
parents f20297bca167 (diff) 25800b390b07 (current diff)
children 3fdffd2d0649
files
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/may/plot.yeti	Fri Mar 28 13:16:12 2014 +0000
+++ b/src/may/plot.yeti	Mon Mar 31 10:28:42 2014 +0100
@@ -20,6 +20,7 @@
 import org.jzy3d.contour: DefaultContourColoringPolicy;
 import org.jzy3d.contour: MapperContourPictureGenerator;
 import org.jzy3d.chart.factories.AWTChartComponentFactory;
+import org.jzy3d.plot3d.text.drawable: DrawableTextBillboard, DrawableTextBitmap;
 
 import javax.imageio: ImageIO;
 
@@ -129,6 +130,11 @@
 */
     ());
 
+addCaption chart colour caption is ~Chart -> ~Color -> string -> () =
+   (scene = chart#getScene();
+    text = new DrawableTextBitmap(caption, new Coord3d(0, 0, 0), colour);
+    scene#add(text));
+
 /**
  * Plot a list of typed structures onto a single chart, and return the
  * resulting Chart object.
@@ -144,6 +150,9 @@
     for structures do s:
         colour = distinctColour j;
         case s of
+        Caption caption:
+            addCaption chart (new Color(0, 0, 0)) caption;
+            j := j - 1; // doesn't count as a distinct structure
         Grid matrix:
             plotMatrix chart colour matrix;
         Contour matrix: