[42] | 1 | <?php |
---|
| 2 | require_once('jpgraph/jpgraph.php'); |
---|
| 3 | require_once('jpgraph/jpgraph_matrix.php'); |
---|
| 4 | |
---|
| 5 | // Some (random) matrix |
---|
| 6 | $data = array( |
---|
| 7 | array(0,1,2,3,4,5,6,7,8,9,10), |
---|
| 8 | array(10,9,8,7,6,5,4,3,2,1,0), |
---|
| 9 | array(0,1,2,3,4,5,6,7,8,9,10), |
---|
| 10 | array(10,9,8,17,6,5,4,3,2,1,0), |
---|
| 11 | array(0,1,2,3,4,4,9,7,8,9,10), |
---|
| 12 | array(8,1,2,3,4,8,3,7,8,9,10), |
---|
| 13 | array(10,3,5,7,6,5,4,3,12,1,0), |
---|
| 14 | array(10,9,8,7,6,5,4,3,2,1,0), |
---|
| 15 | ); |
---|
| 16 | |
---|
| 17 | // Setup a bsic matrix graph and title |
---|
| 18 | $graph = new MatrixGraph(400,300); |
---|
| 19 | $graph->title->Set('Basic matrix example'); |
---|
| 20 | $graph->title->SetFont(FF_ARIAL,FS_BOLD,14); |
---|
| 21 | |
---|
| 22 | // Create a ,atrix plot using all default values |
---|
| 23 | $mp = new MatrixPlot($data); |
---|
| 24 | $graph->Add($mp); |
---|
| 25 | |
---|
| 26 | $graph->Stroke(); |
---|
| 27 | |
---|
| 28 | ?> |
---|