Works like plot.php, except for getting the data