python画图加注释_【IT专家】python画图笔记——注释

简介: python画图加注释_【IT专家】python画图笔记——注释

python画图加注释python画图笔记——注释

注释简介注释位于

matplotlib.pyplot

下,需要需要实例化后再

在画布上填写注释

import

matplotlib.pyplot

as

plt

fig=plt.figure()

ax=fig.add_subplot(1,1,1)

注释有三种,分别为

ax.text()

:文本注释,只能填写文本

ax.arrow()

:箭头标记,不能填写文本

ax.annotate()

:箭头注释,在箭头的位置可以

填写文本二

.

参数解释

1.texttext(x, y, s, fontdict=None, withdash=False, **kwargs) x,y

注释的坐标位置(标量)

s

:注释的内容(字符串)

fontdict

:重新设置注释内容的

文本格式,包括字体颜色、背景大小和颜色、字体大小等(字典)

withdash

:创建

一个替代注释内容

“s”

的对象,参照英文单词解释,这应该是一个破折号

**kwargs

包括

| agg_filter: unknown | alpha: float (0.0 transparent through 1.0 opaque)

| animated:

[True | False]

| axes: an :class:~matplotlib.axes.Axes instance

| backgroundcolor: any

matplotlib

color

|

bbox:

FancyBboxPatch

prop

dict

|

clip_box:

a

:class:matplotlib.transforms.Bbox

instance

|

clip_on:

[True

|

False]

|

clip_path:

[

(:class:~matplotlib.path.Path,

:class:~matplotlib.transforms.Transform)

| :class:~matplotlib.patches.Patch | None ]

| color: any matplotlib color

| contains: a

callable function

| family or fontfamily or fontname or name: [FONTNAME | ‘serif’ |

‘sans-serif’

|

‘cursive’

|

‘fantasy’

|

‘monospace’

]

|

figure:

a

:class:matplotlib.figure.Figure

instance

|

fontproperties

or

font_properties:

a

:class:matplotlib.font_manager.FontProperties

instance

|

gid:

an

id

string

|

horizontalalignment or ha: [ ‘center’ | ‘right’ | ‘left’ ]

| label: string or anything printable

with

‘%s’

conversion.

|

linespacing:

float

(multiple

of

font

size)

|

multialignment:

[‘left’ | ‘right’ | ‘center’ ]

| path_effects: unknown | picker: [None|float|boolean|callable]

|

position:

(x,y)

|

rasterized:

[True

|

False

|

None]

|

rotation:

[

angle

in

degrees

|

‘vertical’ | ‘horizontal’ ]

| rotation_mode: unknown | size or fontsize: [size in points | ‘xx-

small’ | ‘x-small’ | ‘small’ | ‘medium’ | ‘large’ | ‘x-large’ | ‘xx-large’ ]

| sketch_params:

目录
相关文章
|
1月前
|
数据可视化 API Python
画图实战-Python实现某产品全年销量数据多种样式可视化
画图实战-Python实现某产品全年销量数据多种样式可视化
38 0
|
1月前
|
算法 Python
关联规则算法及其画图(python
关联规则算法及其画图(python
25 2
|
3月前
|
Python
小笔记:Python 使用字符串调用函数
小笔记:Python 使用字符串调用函数
41 0
|
3月前
|
数据采集 Python
【Python自动化】多线程BFS站点结构爬虫代码,支持中断恢复,带注释
【Python自动化】多线程BFS站点结构爬虫代码,支持中断恢复,带注释
28 0
|
3月前
|
JavaScript 前端开发 测试技术
[小笔记]TypeScript/JavaScript模拟Python中的Range函数
[小笔记]TypeScript/JavaScript模拟Python中的Range函数
27 0
|
20小时前
|
Python
python 海龟画图tutle螺旋线
python 海龟画图tutle螺旋线
5 0
|
1天前
|
存储 设计模式 算法
|
1天前
|
存储 索引 Python
|
7天前
|
Python
02-python的基础语法-01python字面量/注释/数据类型/数据类型转换
02-python的基础语法-01python字面量/注释/数据类型/数据类型转换
|
29天前
|
Python
Python类定义:从小白到专家的旅程
Python类定义:从小白到专家的旅程
8 0