Answers for "matplotlib ticks both left right"

0

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()
Posted by: Guest on November-28-2020
0

matplotlib tick label position left and right x axis

plt.setp(ax.xaxis.get_majorticklabels(), ha='right')
Posted by: Guest on May-11-2020

Python Answers by Framework

Browse Popular Code Answers by Language