How to use matplotlib set_yscale
问题 I am plotting a function with Matplotlib, and I would like to set the y-axis to log-scale. However, I keep getting an error using set_yscale() . After setting values for my x values and y values, I write import matplotlib as plt plot1 = plt.figure() plt.plot(x, y) plt.set_xscale("log") This results in the error: AttributeError: 'module' object has no attribute 'set_xscale' So, I try plot1 = plt.figure() plt.plot(x, y) plt.set_xscale("log") I get the same error. How do you call this function?