mpl_toolkits.axisartist.axislines.AxesZero#

class mpl_toolkits.axisartist.axislines.AxesZero(*args, grid_helper=None, **kwargs)[源代码][源代码]#

基类:Axes

在图形中构建一个坐标轴。

参数:
fig

Axes 是在 Figure fig 中构建的。

*args

*args 可以是一个 (左, 底, 宽, 高) 的矩形或一个单一的 Bbox。这指定了 Axes 所在的位置(在图形坐标中)。

*args 也可以由三个数字或一个三位数的数字组成;在后一种情况下,数字被视为独立的数字。这些数字被解释为 (nrows, ncols, index)(nrows, ncols) 指定子图数组的大小,而 index 是正在创建的子图的基于1的索引。最后,*args 也可以直接是一个 SubplotSpec 实例。

sharex, sharey : Axes, 可选坐标轴,可选

x- 或 y-axis 与输入 Axes 中的 x- 或 y-轴共享。请注意,无法取消共享轴。

frameonbool, 默认: True

Axes 框架是否可见。

box_aspect浮点数,可选

为 Axes 框设置固定纵横比,即高度与宽度的比率。详情请参见 set_box_aspect

forward_navigation_eventsbool 或 "auto",默认:"auto"

控制是否将平移/缩放事件传递到此图表下方的 Axes。"auto" 对于补丁不可见的图表为 True,否则为 False

**kwargs

其他可选的关键字参数:

属性

描述

可调整

{'box', 'datalim'}

agg_filter

一个过滤函数,它接收一个 (m, n, 3) 的浮点数组和一个 dpi 值,并返回一个 (m, n, 3) 数组和两个从图像左下角开始的偏移量

alpha

标量或无

锚点

(float, float) 或 {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}

animated

布尔

aspect

{'auto', 'equal'} 或 float

autoscale_on

布尔

autoscalex_on

未知

autoscaley_on

未知

axes_locator

Callable[[Axes, Renderer], Bbox]

axisbelow

布尔值或 'line'

box_aspect

浮点数或无

clip_box

BboxBase 或 None

clip_on

布尔

clip_path

补丁或(路径,变换)或无

facecolor 或 fc

color

figure

FigureSubFigure

forward_navigation_events

布尔值或“自动”

frame_on

布尔

gid

str

in_layout

布尔

标签

对象

鼠标悬停

布尔

导航

布尔

navigate_mode

未知

路径效果

AbstractPathEffect 的列表

picker

None 或 bool 或 float 或 callable

position

[左, 底, 宽, 高] 或 Bbox

prop_cycle

Cycler

rasterization_zorder

浮点数或无

光栅化

布尔

sketch_params

(scale: float, length: float, randomness: float)

snap

布尔值或无

subplotspec

未知

标题

str

transform

Transform

url

str

可见

布尔

xbound

(下限: float, 上限: float)

xlabel

str

xlim

(左: 浮点数, 右: 浮点数)

xmargin

浮点数大于 -0.5

xscale

未知

xticklabels

未知

xticks

未知

ybound

(下限: float, 上限: float)

ylabel

str

ylim

(底部: 浮点数, 顶部: 浮点数)

ymargin

浮点数大于 -0.5

yscale

未知

yticklabels

未知

yticks

未知

zorder

浮动

返回:
Axes

新的 Axes 对象。

clear()[源代码][源代码]#

清除坐标轴。

set(*, adjustable=<UNSET>, agg_filter=<UNSET>, alpha=<UNSET>, anchor=<UNSET>, animated=<UNSET>, aspect=<UNSET>, autoscale_on=<UNSET>, autoscalex_on=<UNSET>, autoscaley_on=<UNSET>, axes_locator=<UNSET>, axisbelow=<UNSET>, box_aspect=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, facecolor=<UNSET>, forward_navigation_events=<UNSET>, frame_on=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, mouseover=<UNSET>, navigate=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, position=<UNSET>, prop_cycle=<UNSET>, rasterization_zorder=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, subplotspec=<UNSET>, title=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xbound=<UNSET>, xlabel=<UNSET>, xlim=<UNSET>, xmargin=<UNSET>, xscale=<UNSET>, xticklabels=<UNSET>, xticks=<UNSET>, ybound=<UNSET>, ylabel=<UNSET>, ylim=<UNSET>, ymargin=<UNSET>, yscale=<UNSET>, yticklabels=<UNSET>, yticks=<UNSET>, zorder=<UNSET>)[源代码]#

一次性设置多个属性。

支持的属性有

属性

描述

可调整

{'box', 'datalim'}

agg_filter

一个过滤函数,它接收一个 (m, n, 3) 的浮点数组和一个 dpi 值,并返回一个 (m, n, 3) 数组和两个从图像左下角开始的偏移量

alpha

标量或无

锚点

(float, float) 或 {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}

animated

布尔

aspect

{'auto', 'equal'} 或 float

autoscale_on

布尔

autoscalex_on

未知

autoscaley_on

未知

axes_locator

Callable[[Axes, Renderer], Bbox]

axisbelow

布尔值或 'line'

box_aspect

浮点数或无

clip_box

BboxBase 或 None

clip_on

布尔

clip_path

补丁或(路径,变换)或无

facecolor 或 fc

color

figure

FigureSubFigure

forward_navigation_events

布尔值或“自动”

frame_on

布尔

gid

str

in_layout

布尔

标签

对象

鼠标悬停

布尔

导航

布尔

navigate_mode

未知

路径效果

AbstractPathEffect 的列表

picker

None 或 bool 或 float 或 callable

position

[左, 底, 宽, 高] 或 Bbox

prop_cycle

Cycler

rasterization_zorder

浮点数或无

光栅化

布尔

sketch_params

(scale: float, length: float, randomness: float)

snap

布尔值或无

subplotspec

未知

标题

str

transform

Transform

url

str

可见

布尔

xbound

(下限: float, 上限: float)

xlabel

str

xlim

(左: 浮点数, 右: 浮点数)

xmargin

浮点数大于 -0.5

xscale

未知

xticklabels

未知

xticks

未知

ybound

(下限: float, 上限: float)

ylabel

str

ylim

(底部: 浮点数, 顶部: 浮点数)

ymargin

浮点数大于 -0.5

yscale

未知

yticklabels

未知

yticks

未知

zorder

浮动

使用 mpl_toolkits.axisartist.axislines.AxesZero 的示例#

轴线样式

Axis line styles

使用 axisartist 自定义轴脊

Custom spines with axisartist

简单轴线

Simple Axisline