Created
August 30, 2016 16:36
-
-
Save meresmclr/76f04dbe2bd954e9b04a1e6f7a14e0eb to your computer and use it in GitHub Desktop.
make matplotlib label axes with integers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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