title: PyPlot - Setting grid line spacing for plot
body: <p>I have an undirected graph created by Networkx that I am displaying using pyplot and I want to allow the user to specify the spacing between grid lines. I don't want to manually enter the ticks as this requires knowing the final size of the plot (if there's a way to do this I would like to know) which could vary based on the graph being displayed.</p>
  
  <p>Is there any method that allows you to set the spacing amount? I've looked for a while and can't find anything, thanks.</p>
  
  <p>The code below relates to the creating of the plot not the graph.</p>
  
  <pre><code>#Spacing between each line
  intervals = float(sys.argv[1])
  
  nx.draw(displayGraph, pos, node_size = 10)
  plt.axis('on')
  plt.grid('on')
  plt.savefig("test1.png")
  </code></pre>
  
  <p>I need to find a way to get the grid to have spacing intervals that are defined by the user. I've found ways to do it but it relies on also saying how many grid lines you want and that causes the lines to not be evenly spaced over the plot</p>