Mercurial > hg > may
changeset 149:145431ff5ee3
Use times as well as values
author | Chris Cannam |
---|---|
date | Sun, 28 Apr 2013 10:42:45 +0100 |
parents | b973e8a31bd6 |
children | e65bdec6470e |
files | yetilab/plot/plot.yeti |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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?<number> -> () = +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;