1import matplotlib.pyplot as plt
2
3fig = plt.figure()
4ax = fig.add_subplot(111)
5
6ax.plot(range(10))
7ax.set_xlabel('X-axis')
8ax.set_ylabel('Y-axis')
9
10ax.spines['bottom'].set_color('red')
11ax.spines['top'].set_color('red')
12ax.xaxis.label.set_color('red')
13ax.tick_params(axis='x', colors='red')
14
15plt.show()