My question is how can I restore matplotlib axis captions to default after changing them. For example, in the code below, I built squares of numbers from 1 to 9, and then changed yticks to [20, 40, 60]. By default, the yticks for this graph were [0, 10, 20, 30, 40, 50, 60, 70, 80] before I changed them. So, from now on, how can I return these yticks to default?
import matplotlib.pyplot as plt import numpy as np x = np.arange(9) + 1 y = x ** 2 fig, ax1 = plt.subplots() ax1.plot(x, y) ax1.set_yticks([20, 40, 60]) plt.show()
source share