Matplotlib tick label position code example
Example 1: own labels for ticks matplotlib
ax.set_xticklabels(labels)
Example 2: matplotlib tick label position left and right x axis
plt.setp(ax.xaxis.get_majorticklabels(), ha='right')
ax.set_xticklabels(labels)
plt.setp(ax.xaxis.get_majorticklabels(), ha='right')