String[] lines; void setup() { size( 730, 400 ); background( 255 ); lines = loadStrings( "weather2014.txt" ); noStroke(); fill( 0 ); for( int idx = 1; idx < lines.length; ++idx ) { String line = lines[idx]; String[] words = splitTokens( line ); float lo_temp = float( words[1] ); float hi_temp = float( words[2] ); float lo_y = map( lo_temp, -40, 40, height, 0 ); float hi_y = map( hi_temp, -40, 40, height, 0 ); rect( (idx-1)*2, hi_y, 2, lo_y - hi_y ); } }