In Matplotlib, a lot of examples are presented in the form ax = subplot(111) , and then the functions are applied to ax , for example ax.xaxis.set_major_formatter(FuncFormatter(myfunc)) . (found here )
Alternatively, when I don't need subtitles, I can just do plt.figure() and then build whatever I need with plt.plot() or similar functions.
Now I am exactly in the second case, but I want to call the set_major_formatter function on the X axis. Calling it on plt , of course, will not work:
>>> plt.xaxis.set_major_formatter(FuncFormatter(myfunc)) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'xaxis'
What am I supposed to do here?
source share