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

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 1.1 KB
Line 
1<?php // content="text/plain; charset=utf-8"
2
3require_once ('jpgraph/jpgraph.php');
4require_once ('jpgraph/jpgraph_contourf.php');
5
6// Setup some data to use for the contour
7$data = array(
8    array (12,12,10,10),
9    array (10,10,8,14),
10    array (7,7,13,17),
11    array (4,5,8,12),
12    array (10,8,7,8));
13
14// create a basic graph as a container
15$graph = new Graph(300,300);
16$graph->SetMargin(30, 30, 40, 30);
17$graph->SetScale('intint');
18$graph->SetMarginColor('white');
19
20// Setup title of graph
21$graph->title->Set('Filled contour plot');
22$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
23
24$graph->subtitle->Set('(labels follows gradients)');
25$graph->subtitle->SetFont(FF_VERDANA,FS_ITALIC,10);
26
27// Create a new contour plot
28$cp = new FilledContourPlot($data,8);
29
30// Flip visually
31$cp->SetInvert();
32
33// Fill the contours
34$cp->SetFilled(true);
35
36// Display the labels
37$cp->ShowLabels(true,true);
38$cp->SetFont(FF_ARIAL,FS_BOLD,9);
39$cp->SetFontColor('black');
40
41// And add the plot to the graph
42$graph->Add($cp);
43
44// Send it back to the client
45$graph->stroke();
46
47?>
Note: See TracBrowser for help on using the repository browser.