matplotlib hide gridlines code example Example 1: matplotlib get rid of gridlines ax.grid(False) Example 2: grid off matplotlib plt.grid(b=None)