title: Plotting a grid in Python
body: <p>I'm trying to start 2D contour plot for a flow net and I'm having trouble getting the initial grid to show up properly.</p>
  
  <p>Given the number of columns and the number of rows, how can I write a function that will plot a grid so that all points in the given range appear?</p>
  
  <p>I tried plotting for 4 columns and 3 rows of points by doing this:</p>
  
  <pre><code>r = 3
  
  c = 4
  
  x = [i for i in range(c)]
  
  y = [i for i in range(r)]
  
  plot(x,y,'ro')
  
  grid()
  
  show()
  </code></pre>
  
  <p>and get this error:</p>
  
  <pre><code>'ValueError: x and y must have same first dimension'
  </code></pre>
  
  <p>So I tried testing it on a 4x4 grid and got this and I get close to what I want, however it only plots points (0,0), (1,1), (2,2), and (3,3)</p>
  
  <p>However, I also want the points (0,0), (1,0), (2,0), (3,0), (1,0), (1,1)...(3,2), (3,3) to appear, as I will later need to plot vectors from this point indicating the direction of flow for my flow net.</p>
  
  <p>Sorry, I know my terminology isn't that great.  Does anyone know how to do this and how to make it work for grids that aren't square?</p>