newbiePHP Posted December 5, 2007 Share Posted December 5, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/80271-graphing/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.