import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, np.pi*4, 100) y = np.cos(x) + np.sin(x) fig, ax = plt.subplots() ax.plot(x, y) xmin, xmax, ymin, ymax = ax.axis() xlocs = ax.get_xticks() xlabels = ax.get_xticklabels() ylocs = ax.get_yticks() ylabels = ax.get_yticklabels() print('xlocs: {}'.format(xlocs)) print('xlabels: {}'.format(xlabels)) print('ylocs: {}'.format(ylocs)) print('ylabels: {}'.format(ylabels)) print('xmin: {}\nxmax: {}\nymin: {}\nymax: {}'.format(xmin,xmax,ymin,ymax))