I am using PyX and trying to create a series of rectangles such that every next rectangle must start where the last rectangle ends. The code goes like this:
//start of loop with index i
back_pos = dep_list[i-1]
front_pos = list[i]
c.stroke(path.rect(back_pos, 0, front_pos, 1))
Following are some of the values in list. Basically the list contains increasing order of numbers.
back_pos = 0.04 front_pos = 0.04
back_pos = 0.04 front_pos = 0.21
back_pos = 0.21 front_pos = 0.21
back_pos = 0.21 front_pos = 0.57
back_pos = 0.57 front_pos = 0.72
But when I execute it I get some thing like this following picture
Can someone please suggest me what am I doing wrong ? and how can I fix it ?
p.s I changed the Y-axis in that code so that the starting and ending point of the rectangles are visible. Thanks :)