I just finished writing code to make a plot using pylab in Python and now I would like to superimpose a grid of 10x10 onto the scatter plot. How do I do that?
My cur
You want to use pyplot.grid:
pyplot.grid
x = numpy.arange(0, 1, 0.05) y = numpy.power(x, 2) fig = plt.figure() ax = fig.gca() ax.set_xticks(numpy.arange(0, 1, 0.1)) ax.set_yticks(numpy.arange(0, 1., 0.1)) plt.scatter(x, y) plt.grid() plt.show()
ax.xaxis.grid and ax.yaxis.grid can control grid lines properties.
ax.xaxis.grid
ax.yaxis.grid