9951 explained code solutions for 126 technologies


python-matplotlibHow to change grid spacing


import matplotlib.pyplot as plt
plt.plot([1,2,10,6,15,3,4,2,5,1,7,3,4])
plt.locator_params(nbins=6)
plt.grid(True)
plt.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities

.plot(

plot specified data

locator_params(nbins=6)

change bins number for ticks to change gird spacing

.grid(

add and configure grid

.show()

render chart in a separate window