python annotate函数_Matplotlib库 标注点函数annotate()

Matplotlib库 标注在工作有很大作用:Annotate的构造函数为 :Annotation(s, xy, xytext=None, xycoords=‘data’, textcoords=None, arrowprops=None, annotation_clip=None, **kwargs) 用于绘制连接图上两点的箭头。关键参数:s 为注释文本内容xy 为被注释的坐标点,二维元组形如(...
摘要由CSDN通过智能技术生成

Matplotlib库 标注在工作有很大作用:

Annotate的构造函数为 :Annotation(s, xy, xytext=None, xycoords=‘data’, textcoords=None, arrowprops=None, annotation_clip=None, **kwargs) 用于绘制连接图上两点的箭头。

关键参数:

s 为注释文本内容

xy 为被注释的坐标点,二维元组形如(x,y)

xytext 为注释文本的坐标点,也是二维元组,默认与xy相同

xycoords为被注释点的坐标系属性(通常xycoords值为’data’,即以被注释的坐标点xy为参考)

Value Description

================= =============================================

'figure points' Points from the lower left of the figure

'figure pixels' Pixels from the lower left of the figure

'figure fraction' Fraction of figure from lower left

'axes points' Points from lower left corner of axes

'axes pixels' Pixels from lower left corner of axes

'axes fraction' Fraction of axes from lower left

'data' Use the coordinate system of the object being

annotated (default)

'polar' *(theta, r)* if not native 'data' coordinates

================= =============================================

textcoords 设置注释文本的坐标系属性(textcoords 选择为相对于被注释点xy的偏移量,‘offset points’或者’offset pixels’)

arrowprops

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值