For the following code:
ax = plt.gca()
ticks = ax.get_xticklabels(True)
ax.set_xticklabels(labels,True)
plt.show()
The set_xticklabels is working and the plot is shown as expected . But the get_xticklabels returns an empty list. Is there any way to obtain the 'default' xticklabels before they are manually set?
I think the function you need is ax.get_xticks()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With