[英]How to rescale matplotlib figure to text?
您可以將文本相對於軸的地方,如解釋在這里 :
import matplotlib.pyplot as plt
import matplotlib.text as txt
fig = plt.figure()
ax = fig.add_subplot(111)
t = txt.Text(0.5,0.5, 'Hello',transform=ax.transAxes)
ax.add_artist(t)
plt.show()
無論您如何更改軸,此示例都會將文本始終放在繪圖的中心。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.