【问题标题】:add text to plot matplotlib [duplicate]添加文本以绘制 matplotlib [重复]
【发布时间】:2018-02-19 14:12:27
【问题描述】:
mean = 100
sigma = 0.01

ax.text(0.95, 0.90,mean,verticalalignment='bottom',horizontalalignment='right',transform=ax.transAxes,color='green', fontsize=10)

我想在绘图中添加以下文本(右上角):

平均值:100

西格玛:0.01

帮助..我不知道如何在情节中添加两行文本。显然,这个图只显示平均值,而不是 'mean: 100'

【问题讨论】:

    标签: python matplotlib


    【解决方案1】:

    您可以为此使用annotations

    只需将 xytext 放在绘图中的任何位置

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-30
      • 2018-01-04
      • 1970-01-01
      • 2021-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多