pyplot中文手册_Matplotlib中文手册 PDF 下载

主要内容:

函数:

1. matplotlib.pyplot.acorr(x, hold=None, **kwargs)

自相关函数

acorr(x, normed=True, detrend=mlab.detrend_none, usevlines=True, maxlags=10, **kwargs) #x 的自相关

如果 normed = True,通过零滞后自相关规范数据,x 通过非趋势可调用(默认没有归

一化)的方式除趋势

数据绘制形如 plot(lags, c, **kwargs)

返回值是元组(lags, c, line),其中:

¥lags 是一个长度为 2×maxlags + 1 的滞后(lags)向量

¥C 是 2×maxlags + 1 的自相关向量

¥line 是一个 line2d 实例,通过 plot()返回

默认 linestyle 是 None,默认的 marker 是'o',交叉相关性是通过 numpy.correlate()函

数、mode = 2 实现的。

若 usevlines 是 True, vlines()将被调用(而不调用 plot()函数),用来绘制从起点

到 acorr 的垂线。否则,plot()由 Line2D properties 属性参数(kwargs)决定。

maxlags 是正整数,决定 lags 的显示数目。默认值 None 将返回(2×len(x)- 1)

个 lags,返回值是一个元组(lags, c, linecol, b),其中:

linecol 是 linecollection

b 是 x-axis

其他参数参见 Line2D的 kwargs 属性

2 . matplotlib.pyplot.annotate(*args, **kwargs)

创建一个文本注释:从指定点指向目标点

annotate('注释内容', xy, xytext=None,xycoords='data',textcoords='data', arrowprops=None, **kwargs)

xy:被注释点的位置,xytext:注释文本的位置坐标

xycoords 和 textcoords 是字符串,指示 xy 和 xytext 的坐标关系:

Property Description

‘figure points’

points from the lower left corner of the

figure

起点从 figure 左下角

‘figure pixels’

pixels from the lower left corner of the

figure

pixels(像素)从 figure 左

下角

‘figure fraction’

0,0 is lower left of figure and 1,1 is upper

right

(0,0)是 figure 的左下

方,(1,1)是右上方

‘axes points’ points from lower left corner of axes 起点从 axes 的左下方

‘axes pixels’ pixels from lower left corner of axes

pixels(像素)从 axes 左

下角

‘axes fraction’

0,0 is lower left of axes and 1,1 is upper

right

(0,0)是 axes 的左下方,

(1,1)是右上方

‘data’

use the coordinate system of the object

being annotated (default)

使用被注释对象的坐标系 统

‘offset points’

Specify an offset (in points) from the xy

value

从 xy 点指定一个偏移量

‘polar’

you can specify theta, r for the

annotation, even in cartesian plots. Note

that if you are using a polar axes, you do

not need to specify polar for the

coordinate system since that is the native

“data” coordinate system.

即使在直角坐标系,也可

以指定(θ,r)的值。如果

使用极坐标,不需要指定

极点

通用箭头属性:

Key Description

width the width of the arrow in points 箭头宽度

frac

the fraction of the arrow length occupied

by the head

箭头尖端(头部)所占比

headwidth

the width of the base of the arrow head in

points

箭头尖端的尾部宽度

shrink

oftentimes it is convenient to have the

arrowtip and base a bit away from the

text and point being annotated. If d is the

distance between the text and annotated

point, shrink will shorten the arrow so

the tip and base are shink percent of the

distance d away from the endpoints. ie,

shrink=0.05 is 5%

缩短箭头,以容纳文字。

Shrink=0.05 表示缩短 5%

?kwargs any key for matplotlib.patches.polygon

通用绘图参数,包括

facecolor、alpha 等,可查

询 kwargs 表格。

花式箭头参数:

Key Description

arrowstyle the arrow style 箭头风格

connectionstyle the connection style

relpos default is (0.5, 0.5) 默认(0.5,0.5)

patchA default is bounding box of the text 默认边界框

patchB default is None 默认无

shrinkA default is 2 points 默认 2

shrinkB default is 2 points 默认 2

mutation_scale default is text size (in points) 默认为字体大小

mutation_aspect default is 1. 默认为 1 ? any key for matplotlib.patches.PathPatch

其他参数参见 kwargs

3. matplotlib.pyplot.arrow(x, y, dx, dy, hold=None, **kwargs) 为 axes 添加箭头

arrow(x, y, dx, dy, **kwargs)

绘制指定的箭头从(X,Y)指向(X + Y + dx,dy)。常用的参数:

width(箭头尾部宽度): 浮点数 (默认: 0.001)

length_includes_head(length 值

是否包含 head[箭头尖部]):

[True | False] (默认: False)

head_width(箭头 head 宽度): float(浮点数)或 None (默认: 3*width)

head_length: float(浮点数)或 None (默认: 1.5 * head_width)

shape(箭头形状):

[‘full’('完整的'), ‘left’('左半部分'), ‘right’('右半部分')]

(default: ‘full’)

overhang(箭头尖端形状): float(浮点数) (默认: 0)可以是负值,也可以大于 1

head_starts_at_zero:

[True | False] (默认: False)如果为 True,箭头尖部起

点在坐标 0 点,而 False 则终点在坐标 0 点

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值