# HG changeset patch # User Chris Cannam # Date 1396257362 -3600 # Node ID f20297bca167873fa3e41e62537abacc4276d440 # Parent 5d6aeb765804d711d7db9656bbb6f98d2823d0f0 Start on captions diff -r 5d6aeb765804 -r f20297bca167 src/may/plot.yeti --- a/src/may/plot.yeti Tue Mar 25 10:32:01 2014 +0000 +++ b/src/may/plot.yeti Mon Mar 31 10:16:02 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: