Jump to content

Graphing


newbiePHP

Recommended Posts

Hey guys,

 

$ydata  = array(53.814,53.815,53.8067,53.8059,53.807,53.7935,53.802,53.8062,53.8126,53.8143,53.8075,53.8066,53.8059 ); 
$xdata = array (-3.05544, -3.05542, -3.05452, -3.05176, -3.05493, -3.05712, -3.05591, -3.05591, -3.05591, -3.05592, -3.05572, -3.05474, -3.05197 );

// Create the graph. These two calls are always required 
$graph  = new Graph(350, 250,"auto");     
$graph->SetScale( "textlin"); 

// Create the linear plot 
$lineplot1 =new LinePlot($ydata);
$lineplot2 =new LinePlot($xdata); 
$lineplot1 ->SetColor("blue"); 

// Add the plot to the graph 
$graph->Add( $lineplot1);
$graph->Add( $lineplot2);  

// Display the graph 
$graph->Stroke(); 

 

I'm trying to graph this co-ordinates. Basically you take the first number from y data and the first from x data and thats you point..so

 

point1=(53.814,-3.05544)

point2=(53.815,-3.05542)

...etc

 

How do I go about doing this? The code prints out 2 different lines instead of just the one line.

 

Any help would be really appreciated!!

 

Thanks,

newbiePHP

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.