matplotlib.pyplot.axline¶
-
matplotlib.pyplot.
axline
(xy1, xy2=None, *, slope=None, **kwargs)[源代码]¶ 加一条无限长的直线。
直线可以由两点定义 xy1 和 xy2 ,或一点 xy1 和A 斜坡 .
这在屏幕上画了一条直线,不管x和y标度如何,因此也适用于在半对数图中画指数衰减,在对数图中画幂律,等等, 斜坡 只能与线性刻度一起使用;它对所有其他刻度没有明确的意义,因此行为未定义。请使用点指定线 xy1 , xy2 对于非线性比例。
参数: - xy1、xy2(浮标,浮标)
线要通过的点。或者 xy2 或 斜坡 必须给予。
- slope可选浮动
线条的坡度。或者 xy2 或 斜坡 必须给予。
返回: 其他参数: - **kwargs
有效Kwargs是
Line2D
属性,但“transform”除外:财产 描述 agg_filter
一种过滤函数,它接受一个(m,n,3)浮点数组和一个dpi值,并返回一个(m,n,3)数组。 alpha
浮动或无 animated
布尔 antialiased
或者aa布尔 clip_box
Bbox
clip_on
布尔 clip_path
面片或(路径、变换)或无 color
或c颜色 contains
未知的 dash_capstyle
“对接”、“圆形”、“突出” dash_joinstyle
'miter'、'round'、'bevel' dashes
浮动顺序(点中的开/关墨迹)或(无,无) data
(2,N)阵列或两个一维阵列 drawstyle
或ds{'default','steps','steps pre','steps mid','steps post'},default:'默认' figure
Figure
fillstyle
'full'、'left'、'right'、'bottom'、'top'、'none' gid
STR in_layout
布尔 label
对象 linestyle
或ls'-'、'-'、'-'、'-'、':'、'、'、'(偏移量、开/关顺序)、… linewidth
或lw浮动 marker
标记样式字符串, Path
或MarkerStyle
markeredgecolor
或mec颜色 markeredgewidth
或者喵喵浮动 markerfacecolor
或mfc颜色 markerfacecoloralt
或mfcalt颜色 markersize
或ms浮动 markevery
None或int or(int,int)或slice或List [int] 或float或(float,float)或List [bool] path_effects
AbstractPathEffect
picker
未知的 pickradius
浮动 rasterized
布尔或无 sketch_params
(比例:浮动,长度:浮动,随机性:浮动) snap
布尔或无 solid_capstyle
“对接”、“圆形”、“突出” solid_joinstyle
'miter'、'round'、'bevel' transform
matplotlib.transforms.Transform
url
STR visible
布尔 xdata
一维阵列 ydata
一维阵列 zorder
浮动
实例
画一条穿过(0,0)和(1,1)的粗红线:
>>> axline((0, 0), (1, 1), linewidth=4, color='r')