source: trunk/xgraph/jpgraph/Examples/matrixex00.php @ 42

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 1.4 KB
Line 
1<?php
2require_once ('jpgraph/jpgraph.php');
3require_once ('jpgraph/jpgraph_matrix.php');
4
5$data = array(
6array(0,1,2,3,4,5,6,7,8,9,10),
7array(10,9,8,7,6,5,4,3,2,1,0),
8array(0,1,2,3,4,5,6,7,8,9,10),
9array(10,9,8,17,6,5,4,3,2,1,0),
10array(0,1,2,3,4,4,9,7,8,9,10),
11array(8,1,2,3,4,8,3,7,8,9,10),
12array(10,3,5,7,6,5,4,3,12,1,0),
13array(10,9,8,7,6,5,4,3,2,1,0),
14);
15
16doMeshInterpolate($data,4);
17
18$graph = new MatrixGraph(850,580);
19$graph->title->Set('Matrix example 00');
20$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
21
22//$graph->SetColor('darkgreen@0.8');
23
24$mp = array();
25$n = 5;
26for($i=0; $i < $n; ++$i){
27    $mp[$i] = new MatrixPlot($data);
28    $mp[$i]->colormap->SetMap($i);
29    if( $i < 2 )
30        $mp[$i]->SetSize(0.35);
31    else
32        $mp[$i]->SetSize(0.21);   
33}
34
35$hor1 = new LayoutHor(array($mp[0],$mp[1]));
36$hor2 = new LayoutHor(array($mp[2],$mp[3],$mp[4]));
37$vert = new LayoutVert(array($hor1,$hor2));
38$vert->SetCenterPos(0.45,0.5);
39
40//$mp = new MatrixPlot($data);
41//$mp->colormap->SetMap(2);
42//$mp->SetCenterPos(0.5, 0.45);
43//$mp->SetLegendLayout(0);
44//$mp->SetSize(0.6);
45//$mp->legend->Show(false);
46//$mp->SetModuleSize(5,5);
47
48//$mp->legend->SetModuleSize(20,4);
49//$mp->legend->SetSize(20,0.5);
50
51//$t = new Text('A text string',10,10);
52//$graph->Add($t);
53
54//$graph->Add($mp);
55
56$graph->Add($vert);
57$graph->Stroke();
58
59?>
Note: See TracBrowser for help on using the repository browser.