python 旋转文字方向
In this tutorial, we are going to rotate the text. We can manually align the text by adding a command for the angle of rotation within matplotlib.pyplot.text().
在本教程中,我们将旋转文本。 我们可以通过在matplotlib.pyplot.text()中添加旋转角度的命令来手动对齐文本。
The following are the illustrations of the rotated text.
以下是旋转文本的插图。
plt.text(30,20,'Matplotlib', rotation=90.)
#Rotation of 90 degree
plt.text(30,20,'Matplotlib', rotation=180.)
#Rotation of 180 degree
plt.text(30,20,'Matplotlib', fontsize=15, color='g', rotation=-30.