Basically what I have to do is draw a NxN grid within certain boundaries given by a boundingBox and write a function for that. My idea is that I should draw horizontal and vertical lines and calculating the width and height by dividing the range of the boundaries by N. Then I want to draw the lines with pyplot using the ends of the lines, and this is where I'm having trouble. I have something like this, but it's not well thought out. The boundingBox is basically coordinates.
def drawGridLines(boundingBox, N):
lonrange = boundingBox[1][0] - boundingBox[0][0]
latrange = boundingBox[1][1] - boundingBox[0][1]
lonpieces = lonrange/N
latpieces = latrange/N
while (lonpieces <= N):
lon = lonpieces
pylab.plot(lon)
lonpieces = lonpieces + (lonrange/N)