[python 学习]关于matplotlib注释显示换行的问题

其实原理很简单,就是位置稍微写不同就行

plt.text(x + width / 2, y + height / 2, '%s' % melt[0],
         ha='center',
         va='bottom',

         fontsize=7)  # 添加加工时间数字标识-----
plt.text(x + width / 2, y + height / 4, '%s/%s' % ( melt[1][0], melt[1][1]),
         ha='center',
         va='bottom',
         fontsize=7)

同学说应该也可以用/n,但是我试了不太行,不知道是不是方法的问题

原来plt.text()不是每次执行下面最新的那行………………学到了

你可能感兴趣的:(python)