【发布时间】:2021-01-08 04:57:40
【问题描述】:
如何在 matplotlib 的 add_artist Text 中将单词居中?
from matplotlib.text import Text
import matplotlib.pyplot as plt
fig = plt.figure()
fig.add_artist(Text(0.4, 0.6, text=r"Hello" "\n" r"world!!!!!!!"))
plt.show()
输出左对齐。
【问题讨论】:
-
这个方法有什么问题?
-
我添加了图片。我得到了左对齐的文本。
-
哦,我现在明白了,感谢您的澄清!
标签: python-3.x matplotlib text