matplotlib ticks both left right code example
Example 1: change the side of the axis plt python
f = plt.figure()
ax = f.add_subplot(111)
ax.yaxis.tick_right()
ax.yaxis.set_label_position("right")
plt.plot([2,3,4,5])
ax.set_xlabel("$x$ /mm")
ax.set_ylabel("$y$ /mm")
plt.show()
Example 2: matplotlib tick label position left and right x axis
plt.setp(ax.xaxis.get_majorticklabels(), ha='right')