[42] | 1 | <?php |
---|
| 2 | require_once ('jpgraph/jpgraph.php'); |
---|
| 3 | require_once ('jpgraph/jpgraph_matrix.php'); |
---|
| 4 | |
---|
| 5 | $data = array( |
---|
| 6 | array(0,1,2,3,4,5,6,7,8,9,10), |
---|
| 7 | array(10,9,8,7,6,5,4,3,2,1,0), |
---|
| 8 | array(0,1,2,3,4,5,6,7,8,9,10), |
---|
| 9 | array(10,9,8,17,6,5,4,3,2,1,0), |
---|
| 10 | array(0,1,2,3,4,4,9,7,8,9,10), |
---|
| 11 | array(8,1,2,3,4,8,3,7,8,9,10), |
---|
| 12 | array(10,3,5,7,6,5,4,3,12,1,0), |
---|
| 13 | array(10,9,8,7,6,5,4,3,2,1,0), |
---|
| 14 | ); |
---|
| 15 | |
---|
| 16 | // Do the meshinterpolation once for the data |
---|
| 17 | doMeshInterpolate($data,3); |
---|
| 18 | $r=count($data);$c=count($data[0]); |
---|
| 19 | |
---|
| 20 | $graph = new MatrixGraph(250,220); |
---|
| 21 | $graph->title->Set('Meshinterpolation=3'); |
---|
| 22 | $graph->title->SetFont(FF_ARIAL,FS_BOLD,14); |
---|
| 23 | |
---|
| 24 | $mp = new MatrixPlot($data,1); |
---|
| 25 | $mp->colormap->SetMap(0); |
---|
| 26 | $mp->SetSize(200,160); |
---|
| 27 | $mp->SetCenterPos(0.5,0.55); |
---|
| 28 | $mp->legend->Show(false); |
---|
| 29 | $graph->Add($mp); |
---|
| 30 | $graph->Stroke(); |
---|
| 31 | |
---|
| 32 | ?> |
---|