Login   Register  
PHP Classes
elePHPant
Icontem

File: sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Yuriy Rusinov  >  graph2d  >  sample.php  >  Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: some graphs
Class: graph2d
Generates two dimensional graphic images
Author: By
Last change:
Date: 10 years ago
Size: 897 bytes
 

Contents

Class file image Download
<?php
    
require_once ('graph2d.class.php');

    
$xmin=0.0;
    
$xmax=1.0;
    
$xstep=0.001;

    
$ymin=0.0;
    
$ymax=1.0;
    
$ystep=0.1;

    
$xarr=array();
    
$yarr1=array();
    
$yarr2=array();
    
$yarr3=array();

    
$n=1001;
    for (
$i=0$i<$n$i++)
    {
        
$xarr[$i]=$xmin+$xstep*$i;
        
$yarr1[$i]=$xarr[$i];
        
$yarr2[$i]=$xarr[$i]*$xarr[$i];
        
$yarr3[$i]=sqrt ($xarr[$i]);
    }

    
$test=new graph2d ("jpeg"70035060202040);

    
$test->SetAxisScales ($xmin$xmax0.11$ymin$ymax$ystep1);

    
$test->SetTitle ("Test");
    
$test->SetXLegend ("X");
    
$test->SetYLegend ("Y");

    
$test->GraphCoord();

    
$test->Draw($xarr$yarr10xFF00);

    
$test->Draw($xarr$yarr200xFF0);

    
$test->Draw($xarr$yarr3000xFF);

    
$test->ImageOut("");

    
$test->Close();

?>