ax.get_xticklabels & ax.get_yticklabels is returning a list of empty strings when I run the code via script/ipython interpreter, but works as expected (returns list of ticklabels) when called in ipython notebook. This makes me think it's a backend bug, but I'm mystified.
Env:
Python 3.5.1 |Continuum Analytics, Inc.| (default, Dec 7 2015, 11:24:55)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
matplotlib version:
1.5.1 (installed in different anaconda env to verify not a beta bug)
2.0.0b1.post1730.dev0+gfdce976 (last pulled in a few hours ago)
This will reproduce it: (I use agg here, but MacOSX is exhibiting the same behavior)
changed the title [-]get_ticklabels returns "" in ipython/python interpreter[/-][+]get_ticklabels returns '' in ipython/python interpreter[/+]on Jun 24, 2016
Activity
Tillsten commented on Jun 24, 2016
Afaik the ticks will be popluated at draw time.
story645 commented on Jun 24, 2016
works, but still won't work with 'MacOSX' backend,
partizanos commented on Oct 1, 2020
@story645
You can use instead
[i.get_text() for i in plt.xticks()[1]]