comparison yetilab/plot/plot.yeti @ 115:30c790d2789e

plot -> plotMatrix
author Chris Cannam
date Thu, 18 Apr 2013 08:47:26 +0100
parents f73923903ba4
children 098b4efde5b1
comparison
equal deleted inserted replaced
114:3f5af01ff42a 115:30c790d2789e
30 double f(double x, double y) 30 double f(double x, double y)
31 mapFunction x y 31 mapFunction x y
32 end; 32 end;
33 new FMapper()); 33 new FMapper());
34 34
35 plot matrix = 35 plotMatrix matrix =
36 (mapper = newMatrixLogMapper matrix; 36 (mapper = newMatrixLogMapper matrix;
37 size = matrix.size; 37 size = matrix.size;
38 xrange = new Range(1, size.columns - 1); 38 xrange = new Range(1, size.columns - 1);
39 yrange = new Range(1, size.rows - 1); 39 yrange = new Range(1, size.rows - 1);
40 grid = new OrthonormalGrid(xrange, size.columns, yrange, size.rows); 40 grid = new OrthonormalGrid(xrange, size.columns, yrange, size.rows);
44 surface#setWireframeDisplayed(true); 44 surface#setWireframeDisplayed(true);
45 surface#setWireframeColor(Color#BLACK); 45 surface#setWireframeColor(Color#BLACK);
46 // chart = new Chart(Quality#Fastest, "swing"); 46 // chart = new Chart(Quality#Fastest, "swing");
47 chart = new Chart(Quality#Nicest); 47 chart = new Chart(Quality#Nicest);
48 chart#getScene()#getGraph()#add(surface); 48 chart#getScene()#getGraph()#add(surface);
49 ChartLauncher#openChart(chart)); 49 ChartLauncher#openChart(chart);
50 ());
50 51
51 plotStructure structure = 52 plotStructure structure =
52 case structure of 53 case structure of
53 Grid matrix: 54 Grid matrix:
54 plot matrix; 55 plotMatrix matrix;
55 //!!! 56 //!!!
56 _: failWith "Cannot plot this structure (only grids implemented so far)"; 57 _: failWith "Cannot plot this structure (only grids implemented so far)";
57 esac; 58 esac;
58 59
59 { plot, plotStructure } 60 {
61 plotMatrix,
62 plotStructure
63 }
60 64