I print a seaborn line plot using the below code.
timeplot = sns.lineplot(x='YearMonth', y='count', data=delivered_by_month)
This works fine, but x axis labels are overlapping, so I wanted to rotate them.
So I added an additional line like this after the above line.
timeplot.set_xticklabels(labels=timeplot.get_xticklabels(), rotation=90, ha="right")
Now X-axis labels just disappeared. I confirmed that all labels got cleared by running the below code.
for m in timeplot.get_xticklabels():
print (m)
For this, I got an output like below.
Text(0, 0, '')
Text(1, 0, '')
Text(2, 0, '')
Text(3, 0, '')
Text(4, 0, '')
If I print labels before the rotation code, I get a proper output like below.
Text(0, 0, '2010-10')
Text(1, 0, '2010-11')
Text(2, 0, '2010-12')
Text(3, 0, '2010-2')
Text(4, 0, '2010-3')
Any input will be helpful.