matplotlib.pyplot.text(xysfontdict=Nonewithdash=<deprecated parameter>**kwargs)[source]

向坐标轴添加内容,x,y代表添加文字的位置的坐标。

Add text to the axes.

Add the text s to the axes at location xy in data coordinates.

Parameters:
x, y : scalars

The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the transform parameter.

s : str

The text.

fontdict : dictionary, optional, default: None

A dictionary to override the default text properties. If fontdict is None, the defaults are determined by your rc parameters.

withdash : boolean, optional, default: False

Creates a TextWithDash instance instead of a Text instance.

Returns:
text : Text

The created Text instance.

Other Parameters:
**kwargs : Text properties.

Other miscellaneous text parameters.

Examples

Individual keyword arguments can be used to override any given parameter:

>>> text(x, y, s, fontsize=12)

The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords (0,0 is lower-left and 1,1 is upper-right). The example below places text in the center of the axes:

>>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center',
... verticalalignment='center', transform=ax.transAxes)

You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword bboxbbox is a dictionary of Rectangle properties. For example:

>>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))

matplotlib.pyplot.text的更多相关文章

  1. python 使用 matplotlib.pyplot来画柱状图和饼图

    导入包 import matplotlib.pyplot as plt 柱状图 最简柱状图 # 显示高度 def autolabel(rects): for rect in rects: height ...

  2. Matplotlib.pyplot 常用方法

    1.介绍 Matplotlib 是一个 Python 的 2D绘图库,它以各种硬拷贝格式和跨平台的交互式环境生成出版质量级别的图形.通过 Matplotlib,开发者可以仅需要几行代码,便可以生成绘图 ...

  3. matplotlib.pyplot 导引

    matplotlib.pyplot 是采用 python 语言和使用数值数学库 numpy 数组数据的绘图库.其主要目标是用于数据的可视化显示. 输出图形组成 matplotlib.pyplot 模块 ...

  4. python matplotlib.pyplot学习记录

    matplotlib是python中很强大的绘图工具,在机器学习中经常用到 首先是导入 import matplotlib.pyplot as plt plt中有很多方法,记录下常用的方法 plt.p ...

  5. scikit-learn:matplotlib.pyplot经常使用绘图功能总结(1)

    參考:http://matplotlib.org/api/pyplot_api.html 绘图功能总结(2):http://blog.csdn.net/mmc2015/article/details/ ...

  6. Python:matplotlib.pyplot

    翻译总结自:matplotlib.pyplot - Matplotlib 3.4.3 documentation 函数 说明 acorr x的自相关性图 angle_spectrum 角度谱 anno ...

  7. matplotlib.pyplot 绘图详解 matplotlib 安装

    apt-get install python-matplotlib 转载自: http://www.cnblogs.com/qianlifeng/archive/2012/02/13/2350086. ...

  8. matplotlib.pyplot.hist

    **n, bins, patches = plt.hist(datasets, bins, normed=False, facecolor=None, alpha=None)** ## 函数说明 用于 ...

  9. 数据分析之matplotlib.pyplot模块

    首先都得导模块. import numpy as np import pandas as pd import matplotlib.pyplot as plt from pandas import S ...

随机推荐

  1. .NET Core 获取程序运行环境信息与反射的应用

    目录 RuntimeInformation.Environment 获取信息 反射获取信息 获取某个属性的值以及别名 反射获取信息 使用 总结 笔者的九篇反射系统文章已经完结,但是笔者会持续更新反射在 ...

  2. Internet上的音频/视频概述

    Internet上的音频/视频概述 计算机网络最初是为传送数据信息设计的.因特网 IP 层提供的"尽最大努力交付"服务,以及每一个分组独立交付的策略,对传送数据信息也是很合适的. ...

  3. 达拉草201771010105《面向对象程序设计(java)》第十三周学习总结

    达拉草201771010105<面向对象程序设计(java)>第十三周学习总结 第一部分:理论知识 事件处理基础: 事件源:能够产生事件的对象都可 以成为事件源,如文本框.按钮等.一个事件 ...

  4. 7-46 jmu-python-求单词长度 (10 分)

    输入n个单词,计算每个单词长度.对单词长度排序,分行输出单词长度及其单词. 输入格式: 行1:单词个数n 分行输入n个单词 输出格式: 分行输出单词长度及其单词.(单词长度,单词)用元组表示 输入样例 ...

  5. MVC03

    1.添加model model 的作用是什么? 处理项目的数据模型,与数据库交互 .net推荐的处理数据的方式:使用 idd framework 1)新建model 右键models文件夹,选择添加, ...

  6. Vue+Axios+iview+vue-router实战管理系统项目

    项目实现登陆验证,iviewui组件使用,vue-router路由拦截,在删除登陆存储的token后,直接路由进登陆页面,实战数据请求,本地data.json,笔者也是初出茅庐,在项目运行后,会一直c ...

  7. js 打开新窗口方式

    之前的项目,有个功能是下载文件,这里只要在浏览器输入 url 就会下载那个文件了.当时我只是简单得使用 window.open ,但是却会被浏览器进行拦截,要手动开启才行,然后就搜索研究其他方法,就看 ...

  8. python——字符串截取

    str = ‘0123456789’ print str[0:3] #截取第一位到第三位的字符 print str[:] #截取字符串的全部字符 print str[6:] #截取第七个字符到结尾 p ...

  9. 【5min+】AspNet Core中的全局异常处理

    系列介绍 [五分钟的dotnet]是一个利用您的碎片化时间来学习和丰富.net知识的博文系列.它所包含了.net体系中可能会涉及到的方方面面,比如C#的小细节,AspnetCore,微服务中的.net ...

  10. LVM简介及CentOS7 LVM操作实战

    LVM简介LVM是逻辑盘卷管理(LogicalVolumeManager)的简称,它是Linux环境下对磁盘分区进行管理的一种机制,LVM是建立在硬盘和 分区之上的一个逻辑层,来提高磁盘分区管理的灵活 ...