# HG changeset patch # User Chris Cannam # Date 1367142165 -3600 # Node ID 145431ff5ee358a0a204858d00f5952a7ad79a5a # Parent b973e8a31bd65b91f358faadd3ade9657c597264 Use times as well as values diff -r b973e8a31bd6 -r 145431ff5ee3 yetilab/plot/plot.yeti --- a/yetilab/plot/plot.yeti Sun Apr 28 10:35:29 2013 +0100 +++ b/yetilab/plot/plot.yeti Sun Apr 28 10:42:45 2013 +0100 @@ -52,23 +52,26 @@ ChartLauncher#openChart(chart); ()); -plotCurve values is list? -> () = +plotCurve curve = (chart = new Chart(Quality#Nicest); scene = chart#getScene(); - n = length values; - line = new FlatLine2d([0..n-1] as ~float[], values as ~float[], 0); + xx = map (.time) curve; + yy = map (.value) curve; + line = new FlatLine2d(xx as ~float[], yy as ~float[], 0); line#setWireframeDisplayed(true); line#setWireframeColor(Color#BLACK); line#setWireframeWidth(2); line#setFaceDisplayed(false); scene#add(line); chart#getView()#setViewPoint(new Coord3d(0, 0, 0)); +/* axes = chart#getAxeLayout(); axes#setXAxeLabelDisplayed(false); axes#setYAxeLabelDisplayed(false); axes#setZAxeLabelDisplayed(true); axes#setZAxeLabel("unit goes here"); //!!! axes#setYTickLabelDisplayed(false); +*/ ChartLauncher#openChart(chart); ()); @@ -77,7 +80,7 @@ Grid matrix: plotMatrix matrix; Curve curve: - plotCurve (map (.value) curve); //!!! this is wrong, but just to see + plotCurve curve; _: failWith "Cannot plot this structure (only grids implemented so far)"; esac;