gpt4 book ai didi

python - matplotlib 多行注释

转载 作者:行者123 更新时间:2023-12-02 17:38:32 24 4
gpt4 key购买 nike

是否可以在 matplotlib 中显示多行注释?

这是单行注释:

ax.annotate('line1', xy=(xi,yi),  xycoords='data',
xytext=(-50, 30), textcoords='offset points',
arrowprops=dict(arrowstyle="->")
)

这就是我需要做的(这是以图形方式编辑的):

enter image description here

最佳答案

就像在行尾添加“\n”一样简单:

'line1 \n line2 \n line3"

ax.annotate('line1 \n line2', xy=(timeNow, y),  xycoords='data',
xytext=(-50, 30), textcoords='offset points',
arrowprops=dict(arrowstyle="->"),
verticalalignment='center',
horizontalalignment='center'
)

关于python - matplotlib 多行注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23545999/

24 4 0
文章推荐: .net - System.ArgumentException 列 不属于表
文章推荐: javascript - 我如何在不影响其他标签的情况下编辑特定的 h4 标签
文章推荐: javascript - 添加后拖放以重新排序
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com