Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. package studio10;
  2.  
  3. import sedgewick.Draw;
  4.  
  5. import java.io.File;
  6. import java.io.FileNotFoundException;
  7. import java.util.Scanner;
  8.  
  9. public class plot{
  10. public static void main(String args[]) throws FileNotFoundException{
  11. Draw plot = new Draw();
  12. //SET EVERYTHING UP
  13. plot.setPenColor();
  14. plot.setCanvasSize(1500, 500);
  15. plot.setPenRadius(0.005);
  16. plot.setXscale(0, 0.3);
  17. plot.setYscale(-0.75, 1);
  18.  
  19. //CREATE THE GRAPH VISUALS
  20. //plot.line(-0.5, , 0.5, 2);
  21. double timePassed = 0;
  22. File csvFile = new File("studios/studio9/steps/steps.csv");
  23. Scanner file = new Scanner(csvFile);
  24. while(file.hasNext()){
  25. String input = file.nextLine();
  26. String[] splitInput = input.split(",");
  27. //for(int i = 0; i < 3; i++){
  28. //System.out.print(splitInput[i]);
  29. plot.point(timePassed, (Double.parseDouble(splitInput[1])));
  30. timePassed += 0.001;
  31. //}
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement