Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package studio10;
- import sedgewick.Draw;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.util.Scanner;
- public class plot{
- public static void main(String args[]) throws FileNotFoundException{
- Draw plot = new Draw();
- //SET EVERYTHING UP
- plot.setPenColor();
- plot.setCanvasSize(1500, 500);
- plot.setPenRadius(0.005);
- plot.setXscale(0, 0.3);
- plot.setYscale(-0.75, 1);
- //CREATE THE GRAPH VISUALS
- //plot.line(-0.5, , 0.5, 2);
- double timePassed = 0;
- File csvFile = new File("studios/studio9/steps/steps.csv");
- Scanner file = new Scanner(csvFile);
- while(file.hasNext()){
- String input = file.nextLine();
- String[] splitInput = input.split(",");
- //for(int i = 0; i < 3; i++){
- //System.out.print(splitInput[i]);
- plot.point(timePassed, (Double.parseDouble(splitInput[1])));
- timePassed += 0.001;
- //}
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement