tick tick label and axis label position in matplotlib code example
Example: matplotlib tick label position left and right x axis
plt.setp(ax.xaxis.get_majorticklabels(), ha='right')
plt.setp(ax.xaxis.get_majorticklabels(), ha='right')