Closed
Description
- [1.5.1,3.5.1,OSX] Matplotlib version, Python version and Platform (Windows, OSX, Linux ...)
- [pip ] How did you install Matplotlib and Python (pip, anaconda, from source ...)
from matplotlib.pyplot import subplots,gca
fig,ax = subplots()
ax.plot(range(0,10),range(0,10))
label_list = list(ax.xaxis.get_ticklabels())
print('First label is :',label_list[0].get_text())
label_list = list(ax.get_xaxis().get_ticklabels())
print('First label is :',label_list[0].get_text())
label_list = list(gca().xaxis.get_ticklabels())
print('First label is :',label_list[0].get_text())
label_list = list(gca().get_xaxis().get_ticklabels())
print('First label is :',label_list[0].get_text())
Returns empty for all calls.
I found quite frustating since testing the code manually in ipython works. While running the source from the shell or with %run in ipython it doesn't. Am I missing some update command before getting the tick labels or mpl is wrongly configured somehow?