1plt.gca().axes.get_xaxis().set_visible(False)
2plt.gca().axes.get_yaxis().set_visible(False)
1# Basic syntax:
2ax.set_yticklabels([])
3ax.set_xticklabels([])
4
5# Example usage:
6import matplotlib.pyplot as plt
7
8# Create Figure and Axes instances
9fig,ax = plt.subplots(1)
10
11# Make your plot, set your axes labels
12ax.plot(range(1, 10),range(10, 1, -1))
13ax.set_ylabel('Y Label')
14ax.set_xlabel('X Label')
15
16# Turn off tick labels — tick marks remain but values are removed
17ax.set_yticklabels([])
18ax.set_xticklabels([])
19
20plt.show()