Skip to content

Instantly share code, notes, and snippets.

@meresmclr
Created August 30, 2016 16:36
Show Gist options
  • Save meresmclr/76f04dbe2bd954e9b04a1e6f7a14e0eb to your computer and use it in GitHub Desktop.
Save meresmclr/76f04dbe2bd954e9b04a1e6f7a14e0eb to your computer and use it in GitHub Desktop.
make matplotlib label axes with integers
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
#...
ax = plt.figure().gca()
#...
ax.xaxis.set_major_locator(MaxNLocator(integer=True))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment