Facebook
From Kirsty Gordon, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 51
  1. size(400, 400);
  2. strokeWeight(1);
  3. strokeCap(PROJECT);
  4. line(40, 360, 300, 360);
  5. line(40, 360, 40, 20);
  6. strokeCap(ROUND);
  7.  
  8. int barwidth = 20;
  9. int gap = 10;
  10.  
  11. for (int x = 1; x < 9; x = x+1) {
  12. strokeWeight(9-x);
  13. fill(255-25*x,0,25*x);
  14. rect((barwidth+gap)*x+2*gap,40*x,barwidth,360-40*x);
  15. text(str(x), 30*x+barwidth+5, 380);
  16. }
  17.  
  18. strokeCap(SQUARE);
  19.  
  20. strokeWeight(1);
  21. fill(0);
  22. text("Decreasing Bars", 130, 30);
  23. text("freq", 1, 180);
  24. text("number", 160, 390);
  25.  
  26. for (int x = 1; x < 10; x = x+1) {
  27. line(40, 400-40*x, 30, 400-40*x);
  28. text(str(9-x), 20, 40*x);
  29. }
  30.  
  31. save("activity4.png");