Advertisement
Kendred

Data Vis using Processing Follow Along Code

Nov 6th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. float [] milesRun = {4,15,25,10,19,1,26};
  2.  
  3. void setup() {
  4. size(350,200);
  5. background(255);
  6. fill(120,120,200);
  7. stroke(255);
  8. }
  9.  
  10. void draw() {
  11. int count = 0;
  12. int multiplier = -5;
  13. float rectWidth = width/(milesRun.length);
  14.  
  15. while(count < milesRun.length) {
  16. rect(rectWidth * count,height,rectWidth,milesRun[count]*multiplier);
  17. count++;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement